summaryrefslogtreecommitdiffstats
path: root/Source/WebKit2/WebProcess/InjectedBundle
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/WebProcess/InjectedBundle')
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp5
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp10
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h4
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h3
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h1
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.cpp43
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.h42
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp20
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h3
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp10
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h6
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp16
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h3
-rw-r--r--Source/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp29
14 files changed, 193 insertions, 2 deletions
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
index a58dbda..587968c 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
@@ -128,6 +128,11 @@ void WKBundleOverrideXSSAuditorEnabledForTestRunner(WKBundleRef bundleRef, WKBun
toImpl(bundleRef)->overrideXSSAuditorEnabledForTestRunner(toImpl(pageGroupRef), enabled);
}
+void WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
+{
+ toImpl(bundleRef)->overrideAllowUniversalAccessFromFileURLsForTestRunner(toImpl(pageGroupRef), enabled);
+}
+
void WKBundleReportException(JSContextRef context, JSValueRef exception)
{
InjectedBundle::reportException(context, exception);
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp
index 0e91d8e..6bed7a4 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp
@@ -76,6 +76,16 @@ void WKBundleNodeHandleSetHTMLInputElementAutofilled(WKBundleNodeHandleRef htmlI
toImpl(htmlInputElementHandleRef)->setHTMLInputElementAutofilled(filled);
}
+bool WKBundleNodeHandleGetHTMLInputElementLastChangeWasUserEdit(WKBundleNodeHandleRef htmlInputElementHandleRef)
+{
+ return toImpl(htmlInputElementHandleRef)->htmlInputElementLastChangeWasUserEdit();
+}
+
+bool WKBundleNodeHandleGetHTMLTextAreaElementLastChangeWasUserEdit(WKBundleNodeHandleRef htmlTextAreaElementHandleRef)
+{
+ return toImpl(htmlTextAreaElementHandleRef)->htmlTextAreaElementLastChangeWasUserEdit();
+}
+
WKBundleNodeHandleRef WKBundleNodeHandleCopyHTMLTableCellElementCellAbove(WKBundleNodeHandleRef htmlTableCellElementHandleRef)
{
RefPtr<InjectedBundleNodeHandle> nodeHandle = toImpl(htmlTableCellElementHandleRef)->htmlTableCellElementCellAbove();
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h
index aaa95e6..6006596 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h
@@ -50,7 +50,11 @@ WK_EXPORT WKRect WKBundleNodeHandleGetRenderRect(WKBundleNodeHandleRef nodeHandl
WK_EXPORT void WKBundleNodeHandleSetHTMLInputElementValueForUser(WKBundleNodeHandleRef htmlInputElementHandle, WKStringRef value);
WK_EXPORT bool WKBundleNodeHandleGetHTMLInputElementAutofilled(WKBundleNodeHandleRef htmlInputElementHandle);
WK_EXPORT void WKBundleNodeHandleSetHTMLInputElementAutofilled(WKBundleNodeHandleRef htmlInputElementHandle, bool filled);
+WK_EXPORT bool WKBundleNodeHandleGetHTMLInputElementLastChangeWasUserEdit(WKBundleNodeHandleRef htmlInputElementHandle);
+/* HTMLTextAreaElement Specific Operations */
+WK_EXPORT bool WKBundleNodeHandleGetHTMLTextAreaElementLastChangeWasUserEdit(WKBundleNodeHandleRef htmlTextAreaElementHandle);
+
/* HTMLTableCellElement Specific Operations */
WK_EXPORT WKBundleNodeHandleRef WKBundleNodeHandleCopyHTMLTableCellElementCellAbove(WKBundleNodeHandleRef htmlTableCellElementHandle);
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
index 4be67d5..e01f51f 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
@@ -168,6 +168,7 @@ typedef void (*WKBundlePageWillRunJavaScriptPromptCallback)(WKBundlePageRef page
typedef void (*WKBundlePageMouseDidMoveOverElementCallback)(WKBundlePageRef page, WKBundleHitTestResultRef hitTestResult, WKEventModifiers modifiers, WKTypeRef* userData, const void *clientInfo);
typedef void (*WKBundlePageDidScrollCallback)(WKBundlePageRef page, const void *clientInfo);
typedef void (*WKBundlePagePaintCustomOverhangAreaCallback)(WKBundlePageRef page, WKGraphicsContextRef graphicsContext, WKRect horizontalOverhang, WKRect verticalOverhang, WKRect dirtyRect, const void* clientInfo);
+typedef WKStringRef (*WKBundlePageGenerateFileForUploadCallback)(WKBundlePageRef page, WKStringRef originalFilePath, const void* clientInfo);
struct WKBundlePageUIClient {
int version;
@@ -180,6 +181,8 @@ struct WKBundlePageUIClient {
WKBundlePageMouseDidMoveOverElementCallback mouseDidMoveOverElement;
WKBundlePageDidScrollCallback pageDidScroll;
WKBundlePagePaintCustomOverhangAreaCallback paintCustomOverhangArea;
+ WKBundlePageGenerateFileForUploadCallback shouldGenerateFileForUpload;
+ WKBundlePageGenerateFileForUploadCallback generateFileForUpload;
};
typedef struct WKBundlePageUIClient WKBundlePageUIClient;
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
index bb0bd9f..79c796a 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
@@ -65,6 +65,7 @@ WK_EXPORT void WKBundleRemoveAllUserContent(WKBundleRef bundle, WKBundlePageGrou
// Will make WebProcess ignore this preference until a preferences change notification, only for WebKitTestRunner use.
WK_EXPORT void WKBundleOverrideXSSAuditorEnabledForTestRunner(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
+WK_EXPORT void WKBundleOverrideAllowUniversalAccessFromFileURLsForTestRunner(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
#ifdef __cplusplus
}
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.cpp
new file mode 100644
index 0000000..d97784e
--- /dev/null
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.cpp
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKBundlePrivateWin.h"
+
+#include "InjectedBundle.h"
+#include "WKAPICast.h"
+#include "WKBundleAPICast.h"
+
+using namespace WebKit;
+
+void WKBundleSetHostAllowsAnyHTTPSCertificate(WKBundleRef bundleRef, WKStringRef host)
+{
+ toImpl(bundleRef)->setHostAllowsAnyHTTPSCertificate(toWTFString(host));
+}
+
+void WKBundleSetClientCertificate(WKBundleRef bundleRef, WKStringRef host, WKCertificateInfoRef certificateInfoRef)
+{
+ toImpl(bundleRef)->setClientCertificate(toWTFString(host), toImpl(certificateInfoRef));
+}
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.h b/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.h
new file mode 100644
index 0000000..e404ec8
--- /dev/null
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/win/WKBundlePrivateWin.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKBundlePrivateWin_h
+#define WKBundlePrivateWin_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT void WKBundleSetHostAllowsAnyHTTPSCertificate(WKBundleRef bundle, WKStringRef host);
+WK_EXPORT void WKBundleSetClientCertificate(WKBundleRef bundle, WKStringRef host, WKCertificateInfoRef certificateInfo);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKBundlePrivateWin_h */
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
index 858941e..5e15872 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
@@ -30,12 +30,13 @@
#include "WebFrameLoaderClient.h"
#include <JavaScriptCore/APICast.h>
#include <WebCore/Document.h>
+#include <WebCore/Frame.h>
#include <WebCore/HTMLFrameElement.h>
#include <WebCore/HTMLIFrameElement.h>
-#include <WebCore/Frame.h>
#include <WebCore/HTMLInputElement.h>
#include <WebCore/HTMLNames.h>
#include <WebCore/HTMLTableCellElement.h>
+#include <WebCore/HTMLTextAreaElement.h>
#include <WebCore/IntRect.h>
#include <WebCore/JSNode.h>
#include <WebCore/Node.h>
@@ -132,7 +133,6 @@ bool InjectedBundleNodeHandle::isHTMLInputElementAutofilled() const
return static_cast<HTMLInputElement*>(m_node.get())->isAutofilled();
}
-
void InjectedBundleNodeHandle::setHTMLInputElementAutofilled(bool filled)
{
if (!m_node->hasTagName(inputTag))
@@ -141,6 +141,22 @@ void InjectedBundleNodeHandle::setHTMLInputElementAutofilled(bool filled)
static_cast<HTMLInputElement*>(m_node.get())->setAutofilled(filled);
}
+bool InjectedBundleNodeHandle::htmlInputElementLastChangeWasUserEdit()
+{
+ if (!m_node->hasTagName(inputTag))
+ return false;
+
+ return static_cast<HTMLInputElement*>(m_node.get())->lastChangeWasUserEdit();
+}
+
+bool InjectedBundleNodeHandle::htmlTextAreaElementLastChangeWasUserEdit()
+{
+ if (!m_node->hasTagName(textareaTag))
+ return false;
+
+ return static_cast<HTMLTextAreaElement*>(m_node.get())->lastChangeWasUserEdit();
+}
+
PassRefPtr<InjectedBundleNodeHandle> InjectedBundleNodeHandle::htmlTableCellElementCellAbove()
{
if (!m_node->hasTagName(tdTag))
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h b/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
index 0dcebf6..e4a5ab9 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
@@ -63,6 +63,9 @@ public:
void setHTMLInputElementValueForUser(const String&);
bool isHTMLInputElementAutofilled() const;
void setHTMLInputElementAutofilled(bool);
+ bool htmlInputElementLastChangeWasUserEdit();
+ bool htmlTextAreaElementLastChangeWasUserEdit();
+
PassRefPtr<InjectedBundleNodeHandle> htmlTableCellElementCellAbove();
PassRefPtr<WebFrame> documentFrame();
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
index b887374..24dc7f9 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
@@ -108,6 +108,16 @@ void InjectedBundle::overrideXSSAuditorEnabledForTestRunner(WebPageGroupProxy* p
(*iter)->settings()->setXSSAuditorEnabled(enabled);
}
+void InjectedBundle::overrideAllowUniversalAccessFromFileURLsForTestRunner(WebPageGroupProxy* pageGroup, bool enabled)
+{
+ // Override the preference for all future pages.
+ WebPreferencesStore::overrideAllowUniversalAccessFromFileURLsForTestRunner(enabled);
+
+ // Change the setting for existing ones.
+ const HashSet<Page*>& pages = PageGroup::pageGroup(pageGroup->identifier())->pages();
+ for (HashSet<Page*>::iterator iter = pages.begin(); iter != pages.end(); ++iter)
+ (*iter)->settings()->setAllowUniversalAccessFromFileURLs(enabled);
+}
static PassOwnPtr<Vector<String> > toStringVector(ImmutableArray* patterns)
{
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
index cf844c9..6896669 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
@@ -59,6 +59,7 @@ typedef void* PlatformBundle;
class ImmutableArray;
class InjectedBundleScriptWorld;
+class WebCertificateInfo;
class WebPage;
class WebPageGroupProxy;
@@ -79,12 +80,17 @@ public:
void initializeClient(WKBundleClient*);
void postMessage(const String&, APIObject*);
void postSynchronousMessage(const String&, APIObject*, RefPtr<APIObject>& returnData);
+#if PLATFORM(WIN)
+ void setHostAllowsAnyHTTPSCertificate(const String&);
+ void setClientCertificate(const String&, const WebCertificateInfo*);
+#endif
// TestRunner only SPI
void setShouldTrackVisitedLinks(bool);
void removeAllVisitedLinks();
void activateMacFontAscentHack();
void overrideXSSAuditorEnabledForTestRunner(WebPageGroupProxy* pageGroup, bool enabled);
+ void overrideAllowUniversalAccessFromFileURLsForTestRunner(WebPageGroupProxy*, bool);
// UserContent API
void addUserScript(WebPageGroupProxy*, InjectedBundleScriptWorld*, const String& source, const String& url, ImmutableArray* whitelist, ImmutableArray* blacklist, WebCore::UserScriptInjectionTime, WebCore::UserContentInjectedFrames);
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
index 7bb4f89..532d058 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.cpp
@@ -99,4 +99,20 @@ void InjectedBundlePageUIClient::paintCustomOverhangArea(WebPage* page, Graphics
m_client.paintCustomOverhangArea(toAPI(page), toAPI(context.get()), toAPI(horizontalOverhangArea), toAPI(verticalOverhangArea), toAPI(dirtyRect), m_client.clientInfo);
}
+String InjectedBundlePageUIClient::shouldGenerateFileForUpload(WebPage* page, const String& originalFilePath)
+{
+ if (!m_client.shouldGenerateFileForUpload)
+ return String();
+ RefPtr<WebString> generatedFilePath = adoptRef(toImpl(m_client.shouldGenerateFileForUpload(toAPI(page), toAPI(originalFilePath.impl()), m_client.clientInfo)));
+ return generatedFilePath ? generatedFilePath->string() : String();
+}
+
+String InjectedBundlePageUIClient::generateFileForUpload(WebPage* page, const String& originalFilePath)
+{
+ if (!m_client.shouldGenerateFileForUpload)
+ return String();
+ RefPtr<WebString> generatedFilePath = adoptRef(toImpl(m_client.generateFileForUpload(toAPI(page), toAPI(originalFilePath.impl()), m_client.clientInfo)));
+ return generatedFilePath ? generatedFilePath->string() : String();
+}
+
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h
index 94925b7..47a5ca8 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h
+++ b/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageUIClient.h
@@ -55,6 +55,9 @@ public:
bool shouldPaintCustomOverhangArea();
void paintCustomOverhangArea(WebPage*, WebCore::GraphicsContext*, const WebCore::IntRect&, const WebCore::IntRect&, const WebCore::IntRect&);
+
+ String shouldGenerateFileForUpload(WebPage*, const String& originalFilePath);
+ String generateFileForUpload(WebPage*, const String& originalFilePath);
};
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp b/Source/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp
index 1e593fc..4b415a4 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/win/InjectedBundleWin.cpp
@@ -28,6 +28,8 @@
#include "WKBundleAPICast.h"
#include "WKBundleInitialize.h"
+#include "WebCertificateInfo.h"
+#include <WebCore/ResourceHandle.h>
#include <WebCore/SimpleFontData.h>
#include <windows.h>
@@ -35,6 +37,10 @@
#include <shlobj.h>
#include <shlwapi.h>
+#if USE(CFNETWORK)
+#include <WebCore/CertificateCFWin.h>
+#endif
+
using namespace WebCore;
namespace WebKit {
@@ -86,4 +92,27 @@ void InjectedBundle::activateMacFontAscentHack()
SimpleFontData::setShouldApplyMacAscentHack(true);
}
+void InjectedBundle::setHostAllowsAnyHTTPSCertificate(const String& host)
+{
+#if USE(CFNETWORK)
+ ResourceHandle::setHostAllowsAnyHTTPSCertificate(host);
+#endif
+}
+
+void InjectedBundle::setClientCertificate(const String& host, const WebCertificateInfo* certificateInfo)
+{
+#if USE(CFNETWORK)
+ ASSERT(certificateInfo);
+ if (!certificateInfo)
+ return;
+
+ const Vector<PCCERT_CONTEXT> certificateChain = certificateInfo->platformCertificateInfo().certificateChain();
+ ASSERT(certificateChain.size() == 1);
+ if (certificateChain.size() != 1)
+ return;
+
+ ResourceHandle::setClientCertificate(host, WebCore::copyCertificateToData(certificateChain.first()).get());
+#endif
+}
+
} // namespace WebKit