Diff
Modified: trunk/Source/WebKit2/ChangeLog (218293 => 218294)
--- trunk/Source/WebKit2/ChangeLog 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/ChangeLog 2017-06-14 22:19:49 UTC (rev 218294)
@@ -1,3 +1,25 @@
+2017-06-14 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r218263, r218265, and r218266.
+ https://bugs.webkit.org/show_bug.cgi?id=173383
+
+ "These revisions caused multiple API test to Time out on
+ macOS" (Requested by mlewis13 on #webkit).
+
+ Reverted changesets:
+
+ "Add API::InjectedBundle::Client"
+ https://bugs.webkit.org/show_bug.cgi?id=173357
+ http://trac.webkit.org/changeset/218263
+
+ "[GTK] Use API::InjectedBundle::Client in WebKitWebExtension"
+ https://bugs.webkit.org/show_bug.cgi?id=173358
+ http://trac.webkit.org/changeset/218265
+
+ "Add API::InjectedBundle::ResourceLoadClient"
+ https://bugs.webkit.org/show_bug.cgi?id=173362
+ http://trac.webkit.org/changeset/218266
+
2017-06-14 Brent Fulgham <[email protected]>
[WK2][iOS] Remove dead-code "import "removed-dev-nodes.sb” from sandboxes (173378)
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (218293 => 218294)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2017-06-14 22:19:49 UTC (rev 218294)
@@ -1218,8 +1218,6 @@
7A821F4E1E2F67A800604577 /* LegacyCustomProtocolManagerClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7A821F4D1E2F679E00604577 /* LegacyCustomProtocolManagerClient.mm */; };
7A821F501E2F7A7500604577 /* APICustomProtocolManagerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A821F4F1E2F7A5C00604577 /* APICustomProtocolManagerClient.h */; };
7A8A9D581EF119B0009801AE /* APIInjectedBundleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A8A9D571EF119AA009801AE /* APIInjectedBundleClient.h */; };
- 7A8A9D5A1EF13029009801AE /* APIInjectedBundleBundleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A8A9D591EF13020009801AE /* APIInjectedBundleBundleClient.h */; };
- 7A8A9D5C1EF14598009801AE /* APIInjectedBundlePageResourceLoadClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A8A9D5B1EF1458E009801AE /* APIInjectedBundlePageResourceLoadClient.h */; };
7AAD175F1EA6AF99003B0894 /* WebResourceLoadStatisticsStoreCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7AAD175E1EA6AF37003B0894 /* WebResourceLoadStatisticsStoreCocoa.mm */; };
7AB6EA451EEAAE3800037B2B /* APIIconDatabaseClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AB6EA441EEAAE2300037B2B /* APIIconDatabaseClient.h */; };
7AB6EA471EEAB6B800037B2B /* APIGeolocationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AB6EA461EEAB6B000037B2B /* APIGeolocationProvider.h */; };
@@ -3509,8 +3507,6 @@
7A821F4D1E2F679E00604577 /* LegacyCustomProtocolManagerClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LegacyCustomProtocolManagerClient.mm; sourceTree = "<group>"; };
7A821F4F1E2F7A5C00604577 /* APICustomProtocolManagerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APICustomProtocolManagerClient.h; sourceTree = "<group>"; };
7A8A9D571EF119AA009801AE /* APIInjectedBundleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundleClient.h; sourceTree = "<group>"; };
- 7A8A9D591EF13020009801AE /* APIInjectedBundleBundleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundleBundleClient.h; sourceTree = "<group>"; };
- 7A8A9D5B1EF1458E009801AE /* APIInjectedBundlePageResourceLoadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundlePageResourceLoadClient.h; sourceTree = "<group>"; };
7A9CD8C01C77984900D9F6C7 /* WebResourceLoadStatisticsStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebResourceLoadStatisticsStore.cpp; sourceTree = "<group>"; };
7A9CD8C11C77984900D9F6C7 /* WebResourceLoadStatisticsStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceLoadStatisticsStore.h; sourceTree = "<group>"; };
7A9CD8C21C779AD600D9F6C7 /* WebResourceLoadStatisticsStore.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebResourceLoadStatisticsStore.messages.in; sourceTree = "<group>"; };
@@ -7259,10 +7255,8 @@
1F0181681858DC1500F92884 /* Cocoa */,
BC989D4516181691000D46D3 /* mac */,
377512301DF0DEE2008A351C /* APIInjectedBundleEditorClient.h */,
- 7A8A9D591EF13020009801AE /* APIInjectedBundleBundleClient.h */,
076E884F1A13CBC6005E90FC /* APIInjectedBundlePageContextMenuClient.h */,
7A3ACE1A1EEEF78C00A864A4 /* APIInjectedBundlePageLoaderClient.h */,
- 7A8A9D5B1EF1458E009801AE /* APIInjectedBundlePageResourceLoadClient.h */,
);
path = API;
sourceTree = "<group>";
@@ -8722,7 +8716,6 @@
1CA8B946127C882A00576C2B /* WebInspectorProxyMessages.h in Headers */,
1C891D6619B124FF00BA79DD /* WebInspectorUI.h in Headers */,
1CBBE4A119B66C53006B7D81 /* WebInspectorUIMessages.h in Headers */,
- 7A8A9D5C1EF14598009801AE /* APIInjectedBundlePageResourceLoadClient.h in Headers */,
A55BA82B1BA38E61007CD33D /* WebInspectorUtilities.h in Headers */,
2DA944A01884E4F000ED86DB /* WebIOSEventFactory.h in Headers */,
1A85E4721E303F3700914599 /* WebKit.apinotes in Headers */,
@@ -8864,7 +8857,6 @@
51EFC1CF1524E62500C9A938 /* WKBundleDOMWindowExtension.h in Headers */,
7CBB81211AA0F970006B1942 /* WKBundleFileHandleRef.h in Headers */,
BCD25F1711D6BDE100169B0E /* WKBundleFrame.h in Headers */,
- 7A8A9D5A1EF13029009801AE /* APIInjectedBundleBundleClient.h in Headers */,
BCF049E611FE20F600F86A58 /* WKBundleFramePrivate.h in Headers */,
BC49862F124D18C100D834E1 /* WKBundleHitTestResult.h in Headers */,
BC204EF211C83EC8008F3375 /* WKBundleInitialize.h in Headers */,
Deleted: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h 2017-06-14 22:19:49 UTC (rev 218294)
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2017 Igalia S.L.
- *
- * 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.
- */
-
-#pragma once
-
-#include <wtf/Forward.h>
-
-namespace WebKit {
-class InjectedBundle;
-class WebPage;
-class WebPageGroupProxy;
-}
-
-namespace API {
-class Object;
-
-namespace InjectedBundle {
-
-class Client {
-public:
- virtual ~Client() = default;
-
- virtual void didCreatePage(WebKit::InjectedBundle&, WebKit::WebPage&) { }
- virtual void willDestroyPage(WebKit::InjectedBundle&, WebKit::WebPage&) { }
- virtual void didInitializePageGroup(WebKit::InjectedBundle&, WebKit::WebPageGroupProxy&) { }
- virtual void didReceiveMessage(WebKit::InjectedBundle&, const WTF::String&, API::Object*) { }
- virtual void didReceiveMessageToPage(WebKit::InjectedBundle&, WebKit::WebPage&, const WTF::String&, API::Object*) { }
-};
-
-} // namespace InjectedBundle
-
-} // namespace API
Deleted: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/APIInjectedBundlePageResourceLoadClient.h 2017-06-14 22:19:49 UTC (rev 218294)
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2017 Igalia S.L.
- *
- * 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.
- */
-
-#pragma once
-
-namespace WebKit {
-class WebFrame;
-class WebPage;
-}
-
-namespace WebCore {
-class ResourceError;
-class ResourceRequest;
-class ResourceResponse;
-}
-
-namespace API {
-
-namespace InjectedBundle {
-
-class ResourceLoadClient {
-public:
- virtual ~ResourceLoadClient() = default;
-
- virtual void didInitiateLoadForResource(WebKit::WebPage&, WebKit::WebFrame&, uint64_t /*identifier*/, const WebCore::ResourceRequest&, bool /*pageIsProvisionallyLoading*/) { }
- virtual void willSendRequestForFrame(WebKit::WebPage&, WebKit::WebFrame&, uint64_t /*identifier*/, WebCore::ResourceRequest&, const WebCore::ResourceResponse&) { }
- virtual void didReceiveResponseForResource(WebKit::WebPage&, WebKit::WebFrame&, uint64_t /*identifier*/, const WebCore::ResourceResponse&) { }
- virtual void didReceiveContentLengthForResource(WebKit::WebPage&, WebKit::WebFrame&, uint64_t /*identifier*/, uint64_t contentLength) { }
- virtual void didFinishLoadForResource(WebKit::WebPage&, WebKit::WebFrame&, uint64_t /*identifier*/) { }
- virtual void didFailLoadForResource(WebKit::WebPage&, WebKit::WebFrame&, uint64_t /*identifier*/, const WebCore::ResourceError&) { }
- virtual bool shouldCacheResponse(WebKit::WebPage&, WebKit::WebFrame&, uint64_t /*identifier*/) { return true; }
- virtual bool shouldUseCredentialStorage(WebKit::WebPage&, WebKit::WebFrame&, uint64_t /*identifier*/) { return true; }
-};
-
-} // namespace InjectedBundle
-
-} // namespace API
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp 2017-06-14 22:19:49 UTC (rev 218294)
@@ -29,7 +29,6 @@
#include "APIArray.h"
#include "APIData.h"
#include "InjectedBundle.h"
-#include "InjectedBundleClient.h"
#include "InjectedBundleScriptWorld.h"
#include "WKAPICast.h"
#include "WKBundleAPICast.h"
@@ -50,7 +49,7 @@
void WKBundleSetClient(WKBundleRef bundleRef, WKBundleClientBase *wkClient)
{
- toImpl(bundleRef)->setClient(std::make_unique<InjectedBundleClient>(wkClient));
+ toImpl(bundleRef)->initializeClient(wkClient);
}
void WKBundlePostMessage(WKBundleRef bundleRef, WKStringRef messageNameRef, WKTypeRef messageBodyRef)
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp 2017-06-14 22:19:49 UTC (rev 218294)
@@ -36,7 +36,6 @@
#include "InjectedBundlePageEditorClient.h"
#include "InjectedBundlePageFormClient.h"
#include "InjectedBundlePageLoaderClient.h"
-#include "InjectedBundlePageResourceLoadClient.h"
#include "InjectedBundlePageUIClient.h"
#include "PageBanner.h"
#include "WKAPICast.h"
@@ -101,7 +100,7 @@
void WKBundlePageSetResourceLoadClient(WKBundlePageRef pageRef, WKBundlePageResourceLoadClientBase* wkClient)
{
- toImpl(pageRef)->setInjectedBundleResourceLoadClient(std::make_unique<InjectedBundlePageResourceLoadClient>(wkClient));
+ toImpl(pageRef)->initializeInjectedBundleResourceLoadClient(wkClient);
}
void WKBundlePageSetPolicyClient(WKBundlePageRef pageRef, WKBundlePagePolicyClientBase* wkClient)
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp 2017-06-14 22:19:49 UTC (rev 218294)
@@ -21,8 +21,9 @@
#include "WebKitWebExtension.h"
#include "APIDictionary.h"
-#include "APIInjectedBundleBundleClient.h"
#include "APIString.h"
+#include "WKBundleAPICast.h"
+#include "WKBundlePage.h"
#include "WebKitPrivate.h"
#include "WebKitWebExtensionPrivate.h"
#include "WebKitWebPagePrivate.h"
@@ -144,51 +145,67 @@
WEBKIT_TYPE_WEB_PAGE);
}
-class WebExtensionInjectedBundleClient final : public API::InjectedBundle::Client {
-public:
- explicit WebExtensionInjectedBundleClient(WebKitWebExtension* extension)
- : m_extension(extension)
- {
- }
+static void webkitWebExtensionPageCreated(WebKitWebExtension* extension, WebPage* page)
+{
+ GRefPtr<WebKitWebPage> webPage = adoptGRef(webkitWebPageCreate(page));
+ extension->priv->pages.add(page, webPage);
+ g_signal_emit(extension, signals[PAGE_CREATED], 0, webPage.get());
+}
-private:
- void didCreatePage(InjectedBundle&, WebPage& page) override
- {
- GRefPtr<WebKitWebPage> webPage = adoptGRef(webkitWebPageCreate(&page));
- m_extension->priv->pages.add(&page, webPage);
- g_signal_emit(m_extension, signals[PAGE_CREATED], 0, webPage.get());
- }
+static void webkitWebExtensionPageDestroy(WebKitWebExtension* extension, WebPage* page)
+{
+ extension->priv->pages.remove(page);
+}
- void willDestroyPage(InjectedBundle&, WebPage& page) override
- {
- m_extension->priv->pages.remove(&page);
- }
+static void webkitWebExtensionDidReceiveMessage(WebKitWebExtension*, const String& messageName, API::Dictionary& message)
+{
+ if (messageName == String::fromUTF8("PrefetchDNS")) {
+ API::String* hostname = static_cast<API::String*>(message.get(String::fromUTF8("Hostname")));
+ WebProcess::singleton().prefetchDNS(hostname->string());
+ } else
+ ASSERT_NOT_REACHED();
+}
- void didReceiveMessage(InjectedBundle&, const String& messageName, API::Object* messageBody) override
- {
- ASSERT(messageBody->type() == API::Object::Type::Dictionary);
- API::Dictionary& message = *static_cast<API::Dictionary*>(messageBody);
- if (messageName == String::fromUTF8("PrefetchDNS")) {
- API::String* hostname = static_cast<API::String*>(message.get(String::fromUTF8("Hostname")));
- WebProcess::singleton().prefetchDNS(hostname->string());
- } else
- ASSERT_NOT_REACHED();
- }
+static void didCreatePage(WKBundleRef, WKBundlePageRef page, const void* clientInfo)
+{
+ webkitWebExtensionPageCreated(WEBKIT_WEB_EXTENSION(clientInfo), toImpl(page));
+}
- void didReceiveMessageToPage(InjectedBundle&, WebPage& page, const String& messageName, API::Object* messageBody) override
- {
- ASSERT(messageBody->type() == API::Object::Type::Dictionary);
- if (auto* webPage = m_extension->priv->pages.get(&page))
- webkitWebPageDidReceiveMessage(webPage, messageName, *static_cast<API::Dictionary*>(messageBody));
- }
+static void willDestroyPage(WKBundleRef, WKBundlePageRef page, const void* clientInfo)
+{
+ webkitWebExtensionPageDestroy(WEBKIT_WEB_EXTENSION(clientInfo), toImpl(page));
+}
- WebKitWebExtension* m_extension;
-};
+static void didReceiveMessage(WKBundleRef, WKStringRef name, WKTypeRef messageBody, const void* clientInfo)
+{
+ ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
+ webkitWebExtensionDidReceiveMessage(WEBKIT_WEB_EXTENSION(clientInfo), toImpl(name)->string(), *toImpl(static_cast<WKDictionaryRef>(messageBody)));
+}
+static void didReceiveMessageToPage(WKBundleRef, WKBundlePageRef page, WKStringRef name, WKTypeRef messageBody, const void* clientInfo)
+{
+ ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
+ if (WebKitWebPage* webPage = WEBKIT_WEB_EXTENSION(clientInfo)->priv->pages.get(toImpl(page)))
+ webkitWebPageDidReceiveMessage(webPage, toImpl(name)->string(), *toImpl(static_cast<WKDictionaryRef>(messageBody)));
+}
+
WebKitWebExtension* webkitWebExtensionCreate(InjectedBundle* bundle)
{
WebKitWebExtension* extension = WEBKIT_WEB_EXTENSION(g_object_new(WEBKIT_TYPE_WEB_EXTENSION, NULL));
- bundle->setClient(std::make_unique<WebExtensionInjectedBundleClient>(extension));
+
+ WKBundleClientV1 wkBundleClient = {
+ {
+ 1, // version
+ extension, // clientInfo
+ },
+ didCreatePage,
+ willDestroyPage,
+ 0, // didInitializePageGroup
+ didReceiveMessage,
+ didReceiveMessageToPage
+ };
+ WKBundleSetClient(toAPI(bundle), &wkBundleClient.base);
+
return extension;
}
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm 2017-06-14 22:19:49 UTC (rev 218294)
@@ -80,7 +80,7 @@
bundleClient.didCreatePage = didCreatePage;
bundleClient.willDestroyPage = willDestroyPage;
- WKBundleSetClient(toAPI(&bundle), &bundleClient.base);
+ bundle.initializeClient(&bundleClient.base);
}
- (void)_setPrincipalClassInstance:(id <WKWebProcessPlugIn>)principalClassInstance
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm 2017-06-14 22:19:49 UTC (rev 218294)
@@ -333,7 +333,7 @@
client.didFinishLoadForResource = didFinishLoadForResource;
client.didFailLoadForResource = didFailLoadForResource;
- WKBundlePageSetResourceLoadClient(toAPI(&page), &client.base);
+ page.initializeInjectedBundleResourceLoadClient(&client.base);
}
- (id <WKWebProcessPlugInLoadDelegate>)loadDelegate
@@ -350,7 +350,7 @@
setUpResourceLoadClient(self, *_page);
} else {
WKBundlePageSetPageLoaderClient(toAPI(_page.get()), nullptr);
- WKBundlePageSetResourceLoadClient(toAPI(_page.get()), nullptr);
+ _page->initializeInjectedBundleResourceLoadClient(nullptr);
}
}
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp 2017-06-14 22:19:49 UTC (rev 218294)
@@ -32,6 +32,8 @@
#include "NotificationPermissionRequestManager.h"
#include "SessionTracker.h"
#include "UserData.h"
+#include "WKAPICast.h"
+#include "WKBundleAPICast.h"
#include "WebConnectionToUIProcess.h"
#include "WebCookieManager.h"
#include "WebCoreArgumentCoders.h"
@@ -107,12 +109,9 @@
{
}
-void InjectedBundle::setClient(std::unique_ptr<API::InjectedBundle::Client>&& client)
+void InjectedBundle::initializeClient(const WKBundleClientBase* client)
{
- if (!client)
- m_client = std::make_unique<API::InjectedBundle::Client>();
- else
- m_client = WTFMove(client);
+ m_client.initialize(client);
}
void InjectedBundle::postMessage(const String& messageName, API::Object* messageBody)
@@ -508,27 +507,27 @@
void InjectedBundle::didCreatePage(WebPage* page)
{
- m_client->didCreatePage(*this, *page);
+ m_client.didCreatePage(this, page);
}
void InjectedBundle::willDestroyPage(WebPage* page)
{
- m_client->willDestroyPage(*this, *page);
+ m_client.willDestroyPage(this, page);
}
void InjectedBundle::didInitializePageGroup(WebPageGroupProxy* pageGroup)
{
- m_client->didInitializePageGroup(*this, *pageGroup);
+ m_client.didInitializePageGroup(this, pageGroup);
}
void InjectedBundle::didReceiveMessage(const String& messageName, API::Object* messageBody)
{
- m_client->didReceiveMessage(*this, messageName, messageBody);
+ m_client.didReceiveMessage(this, messageName, messageBody);
}
void InjectedBundle::didReceiveMessageToPage(WebPage* page, const String& messageName, API::Object* messageBody)
{
- m_client->didReceiveMessageToPage(*this, *page, messageName, messageBody);
+ m_client.didReceiveMessageToPage(this, page, messageName, messageBody);
}
void InjectedBundle::setUserStyleSheetLocation(WebPageGroupProxy* pageGroup, const String& location)
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h 2017-06-14 22:19:49 UTC (rev 218294)
@@ -25,10 +25,10 @@
#pragma once
-#include "APIInjectedBundleBundleClient.h"
#include "APIObject.h"
+#include "InjectedBundleClient.h"
#include "SandboxExtension.h"
-#include <_javascript_Core/_javascript_.h>
+#include "WKBundle.h"
#include <WebCore/UserContentTypes.h>
#include <WebCore/UserScriptTypes.h>
#include <wtf/RefPtr.h>
@@ -84,7 +84,7 @@
void setBundleParameters(const IPC::DataReference&);
// API
- void setClient(std::unique_ptr<API::InjectedBundle::Client>&&);
+ void initializeClient(const WKBundleClientBase*);
void postMessage(const String&, API::Object*);
void postSynchronousMessage(const String&, API::Object*, RefPtr<API::Object>& returnData);
@@ -161,7 +161,7 @@
RefPtr<SandboxExtension> m_sandboxExtension;
- std::unique_ptr<API::InjectedBundle::Client> m_client;
+ InjectedBundleClient m_client;
#if PLATFORM(COCOA) && WK_API_ENABLED
RetainPtr<WKWebProcessBundleParameters> m_bundleParameters;
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.cpp 2017-06-14 22:19:49 UTC (rev 218294)
@@ -33,49 +33,44 @@
namespace WebKit {
-InjectedBundleClient::InjectedBundleClient(const WKBundleClientBase* client)
+void InjectedBundleClient::didCreatePage(InjectedBundle* bundle, WebPage* page)
{
- initialize(client);
-}
-
-void InjectedBundleClient::didCreatePage(InjectedBundle& bundle, WebPage& page)
-{
if (!m_client.didCreatePage)
return;
- m_client.didCreatePage(toAPI(&bundle), toAPI(&page), m_client.base.clientInfo);
+ m_client.didCreatePage(toAPI(bundle), toAPI(page), m_client.base.clientInfo);
}
-void InjectedBundleClient::willDestroyPage(InjectedBundle& bundle, WebPage& page)
+void InjectedBundleClient::willDestroyPage(InjectedBundle* bundle, WebPage* page)
{
if (!m_client.willDestroyPage)
return;
- m_client.willDestroyPage(toAPI(&bundle), toAPI(&page), m_client.base.clientInfo);
+ m_client.willDestroyPage(toAPI(bundle), toAPI(page), m_client.base.clientInfo);
}
-void InjectedBundleClient::didInitializePageGroup(InjectedBundle& bundle, WebPageGroupProxy& pageGroup)
+void InjectedBundleClient::didInitializePageGroup(InjectedBundle* bundle, WebPageGroupProxy* pageGroup)
{
if (!m_client.didInitializePageGroup)
return;
- m_client.didInitializePageGroup(toAPI(&bundle), toAPI(&pageGroup), m_client.base.clientInfo);
+ m_client.didInitializePageGroup(toAPI(bundle), toAPI(pageGroup), m_client.base.clientInfo);
}
-void InjectedBundleClient::didReceiveMessage(InjectedBundle& bundle, const String& messageName, API::Object* messageBody)
+void InjectedBundleClient::didReceiveMessage(InjectedBundle* bundle, const String& messageName, API::Object* messageBody)
{
if (!m_client.didReceiveMessage)
return;
- m_client.didReceiveMessage(toAPI(&bundle), toAPI(messageName.impl()), toAPI(messageBody), m_client.base.clientInfo);
+ m_client.didReceiveMessage(toAPI(bundle), toAPI(messageName.impl()), toAPI(messageBody), m_client.base.clientInfo);
}
-void InjectedBundleClient::didReceiveMessageToPage(InjectedBundle& bundle, WebPage& page, const String& messageName, API::Object* messageBody)
+void InjectedBundleClient::didReceiveMessageToPage(InjectedBundle* bundle, WebPage* page, const String& messageName, API::Object* messageBody)
{
if (!m_client.didReceiveMessageToPage)
return;
- m_client.didReceiveMessageToPage(toAPI(&bundle), toAPI(&page), toAPI(messageName.impl()), toAPI(messageBody), m_client.base.clientInfo);
+ m_client.didReceiveMessageToPage(toAPI(bundle), toAPI(page), toAPI(messageName.impl()), toAPI(messageBody), m_client.base.clientInfo);
}
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleClient.h 2017-06-14 22:19:49 UTC (rev 218294)
@@ -27,7 +27,6 @@
#define InjectedBundleClient_h
#include "APIClient.h"
-#include "APIInjectedBundleBundleClient.h"
#include "WKBundle.h"
#include <wtf/Forward.h>
@@ -45,17 +44,16 @@
class WebPage;
class WebPageGroupProxy;
-class InjectedBundleClient : public API::InjectedBundle::Client, public API::Client<WKBundleClientBase> {
+class InjectedBundleClient : public API::Client<WKBundleClientBase> {
public:
- explicit InjectedBundleClient(const WKBundleClientBase*);
-
- void didCreatePage(InjectedBundle&, WebPage&) override;
- void willDestroyPage(InjectedBundle&, WebPage&) override;
- void didInitializePageGroup(InjectedBundle&, WebPageGroupProxy&) override;
- void didReceiveMessage(InjectedBundle&, const WTF::String&, API::Object*) override;
- void didReceiveMessageToPage(InjectedBundle&, WebPage&, const WTF::String&, API::Object*) override;
+ void didCreatePage(InjectedBundle*, WebPage*);
+ void willDestroyPage(InjectedBundle*, WebPage*);
+ void didInitializePageGroup(InjectedBundle*, WebPageGroupProxy*);
+ void didReceiveMessage(InjectedBundle*, const String& messageName, API::Object* messageBody);
+ void didReceiveMessageToPage(InjectedBundle*, WebPage*, const String& messageName, API::Object* messageBody);
};
} // namespace WebKit
+
#endif // InjectedBundleClient_h
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.cpp 2017-06-14 22:19:49 UTC (rev 218294)
@@ -35,25 +35,20 @@
namespace WebKit {
-InjectedBundlePageResourceLoadClient::InjectedBundlePageResourceLoadClient(const WKBundlePageResourceLoadClientBase* client)
+void InjectedBundlePageResourceLoadClient::didInitiateLoadForResource(WebPage* page, WebFrame* frame, uint64_t identifier, const WebCore::ResourceRequest& request, bool pageIsProvisionallyLoading)
{
- initialize(client);
-}
-
-void InjectedBundlePageResourceLoadClient::didInitiateLoadForResource(WebPage& page, WebFrame& frame, uint64_t identifier, const ResourceRequest& request, bool pageIsProvisionallyLoading)
-{
if (!m_client.didInitiateLoadForResource)
return;
- m_client.didInitiateLoadForResource(toAPI(&page), toAPI(&frame), identifier, toAPI(request), pageIsProvisionallyLoading, m_client.base.clientInfo);
+ m_client.didInitiateLoadForResource(toAPI(page), toAPI(frame), identifier, toAPI(request), pageIsProvisionallyLoading, m_client.base.clientInfo);
}
-void InjectedBundlePageResourceLoadClient::willSendRequestForFrame(WebPage& page, WebFrame& frame, uint64_t identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
+void InjectedBundlePageResourceLoadClient::willSendRequestForFrame(WebPage* page, WebFrame* frame, uint64_t identifier, ResourceRequest& request, const ResourceResponse& redirectResponse)
{
if (!m_client.willSendRequestForFrame)
return;
- RefPtr<API::URLRequest> returnedRequest = adoptRef(toImpl(m_client.willSendRequestForFrame(toAPI(&page), toAPI(&frame), identifier, toAPI(request), toAPI(redirectResponse), m_client.base.clientInfo)));
+ RefPtr<API::URLRequest> returnedRequest = adoptRef(toImpl(m_client.willSendRequestForFrame(toAPI(page), toAPI(frame), identifier, toAPI(request), toAPI(redirectResponse), m_client.base.clientInfo)));
if (returnedRequest) {
// If the client returned an HTTP body, we want to use that http body. This is needed to fix <rdar://problem/23763584>
auto& returnedResourceRequest = returnedRequest->resourceRequest();
@@ -65,52 +60,52 @@
request = { };
}
-void InjectedBundlePageResourceLoadClient::didReceiveResponseForResource(WebPage& page, WebFrame& frame, uint64_t identifier, const ResourceResponse& response)
+void InjectedBundlePageResourceLoadClient::didReceiveResponseForResource(WebPage* page, WebFrame* frame, uint64_t identifier, const WebCore::ResourceResponse& response)
{
if (!m_client.didReceiveResponseForResource)
return;
- m_client.didReceiveResponseForResource(toAPI(&page), toAPI(&frame), identifier, toAPI(response), m_client.base.clientInfo);
+ m_client.didReceiveResponseForResource(toAPI(page), toAPI(frame), identifier, toAPI(response), m_client.base.clientInfo);
}
-void InjectedBundlePageResourceLoadClient::didReceiveContentLengthForResource(WebPage& page, WebFrame& frame, uint64_t identifier, uint64_t contentLength)
+void InjectedBundlePageResourceLoadClient::didReceiveContentLengthForResource(WebPage* page, WebFrame* frame, uint64_t identifier, uint64_t contentLength)
{
if (!m_client.didReceiveContentLengthForResource)
return;
- m_client.didReceiveContentLengthForResource(toAPI(&page), toAPI(&frame), identifier, contentLength, m_client.base.clientInfo);
+ m_client.didReceiveContentLengthForResource(toAPI(page), toAPI(frame), identifier, contentLength, m_client.base.clientInfo);
}
-void InjectedBundlePageResourceLoadClient::didFinishLoadForResource(WebPage& page, WebFrame& frame, uint64_t identifier)
+void InjectedBundlePageResourceLoadClient::didFinishLoadForResource(WebPage* page, WebFrame* frame, uint64_t identifier)
{
if (!m_client.didFinishLoadForResource)
return;
- m_client.didFinishLoadForResource(toAPI(&page), toAPI(&frame), identifier, m_client.base.clientInfo);
+ m_client.didFinishLoadForResource(toAPI(page), toAPI(frame), identifier, m_client.base.clientInfo);
}
-void InjectedBundlePageResourceLoadClient::didFailLoadForResource(WebPage& page, WebFrame& frame, uint64_t identifier, const ResourceError& error)
+void InjectedBundlePageResourceLoadClient::didFailLoadForResource(WebPage* page, WebFrame* frame, uint64_t identifier, const WebCore::ResourceError& error)
{
if (!m_client.didFailLoadForResource)
return;
- m_client.didFailLoadForResource(toAPI(&page), toAPI(&frame), identifier, toAPI(error), m_client.base.clientInfo);
+ m_client.didFailLoadForResource(toAPI(page), toAPI(frame), identifier, toAPI(error), m_client.base.clientInfo);
}
-bool InjectedBundlePageResourceLoadClient::shouldCacheResponse(WebPage& page, WebFrame& frame, uint64_t identifier)
+bool InjectedBundlePageResourceLoadClient::shouldCacheResponse(WebPage* page, WebFrame* frame, uint64_t identifier)
{
if (!m_client.shouldCacheResponse)
return true;
- return m_client.shouldCacheResponse(toAPI(&page), toAPI(&frame), identifier, m_client.base.clientInfo);
+ return m_client.shouldCacheResponse(toAPI(page), toAPI(frame), identifier, m_client.base.clientInfo);
}
-bool InjectedBundlePageResourceLoadClient::shouldUseCredentialStorage(WebPage& page, WebFrame& frame, uint64_t identifier)
+bool InjectedBundlePageResourceLoadClient::shouldUseCredentialStorage(WebPage* page, WebFrame* frame, uint64_t identifier)
{
if (!m_client.shouldUseCredentialStorage)
return true;
- return m_client.shouldUseCredentialStorage(toAPI(&page), toAPI(&frame), identifier, m_client.base.clientInfo);
+ return m_client.shouldUseCredentialStorage(toAPI(page), toAPI(frame), identifier, m_client.base.clientInfo);
}
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageResourceLoadClient.h 2017-06-14 22:19:49 UTC (rev 218294)
@@ -27,8 +27,9 @@
#define InjectedBundlePageResourceLoadClient_h
#include "APIClient.h"
-#include "APIInjectedBundlePageResourceLoadClient.h"
+#include "SameDocumentNavigationType.h"
#include "WKBundlePageResourceLoadClient.h"
+#include <wtf/Forward.h>
namespace API {
template<> struct ClientTraits<WKBundlePageResourceLoadClientBase> {
@@ -47,18 +48,16 @@
class WebPage;
class WebFrame;
-class InjectedBundlePageResourceLoadClient : public API::InjectedBundle::ResourceLoadClient, public API::Client<WKBundlePageResourceLoadClientBase> {
+class InjectedBundlePageResourceLoadClient : public API::Client<WKBundlePageResourceLoadClientBase> {
public:
- explicit InjectedBundlePageResourceLoadClient(const WKBundlePageResourceLoadClientBase*);
-
- void didInitiateLoadForResource(WebPage&, WebFrame&, uint64_t identifier, const WebCore::ResourceRequest&, bool /*pageIsProvisionallyLoading*/) override;
- void willSendRequestForFrame(WebPage&, WebFrame&, uint64_t identifier, WebCore::ResourceRequest&, const WebCore::ResourceResponse&) override;
- void didReceiveResponseForResource(WebPage&, WebFrame&, uint64_t identifier, const WebCore::ResourceResponse&) override;
- void didReceiveContentLengthForResource(WebPage&, WebFrame&, uint64_t identifier, uint64_t contentLength) override;
- void didFinishLoadForResource(WebPage&, WebFrame&, uint64_t identifier) override;
- void didFailLoadForResource(WebPage&, WebFrame&, uint64_t identifier, const WebCore::ResourceError&) override;
- bool shouldCacheResponse(WebPage&, WebFrame&, uint64_t identifier) override;
- bool shouldUseCredentialStorage(WebPage&, WebFrame&, uint64_t identifier) override;
+ void didInitiateLoadForResource(WebPage*, WebFrame*, uint64_t identifier, const WebCore::ResourceRequest&, bool pageIsProvisionallyLoading);
+ void willSendRequestForFrame(WebPage*, WebFrame*, uint64_t identifier, WebCore::ResourceRequest&, const WebCore::ResourceResponse&);
+ void didReceiveResponseForResource(WebPage*, WebFrame*, uint64_t identifier, const WebCore::ResourceResponse&);
+ void didReceiveContentLengthForResource(WebPage*, WebFrame*, uint64_t identifier, uint64_t contentLength);
+ void didFinishLoadForResource(WebPage*, WebFrame*, uint64_t identifier);
+ void didFailLoadForResource(WebPage*, WebFrame*, uint64_t identifier, const WebCore::ResourceError&);
+ bool shouldCacheResponse(WebPage*, WebFrame*, uint64_t identifier);
+ bool shouldUseCredentialStorage(WebPage*, WebFrame*, uint64_t identifier);
};
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2017-06-14 22:19:49 UTC (rev 218294)
@@ -165,7 +165,7 @@
if (FrameLoader* frameLoader = loader->frameLoader())
pageIsProvisionallyLoading = frameLoader->provisionalDocumentLoader() == loader;
- webPage->injectedBundleResourceLoadClient().didInitiateLoadForResource(*webPage, *m_frame, identifier, request, pageIsProvisionallyLoading);
+ webPage->injectedBundleResourceLoadClient().didInitiateLoadForResource(webPage, m_frame, identifier, request, pageIsProvisionallyLoading);
webPage->addResourceRequest(identifier, request);
}
@@ -175,7 +175,7 @@
if (!webPage)
return;
- webPage->injectedBundleResourceLoadClient().willSendRequestForFrame(*webPage, *m_frame, identifier, request, redirectResponse);
+ webPage->injectedBundleResourceLoadClient().willSendRequestForFrame(webPage, m_frame, identifier, request, redirectResponse);
}
bool WebFrameLoaderClient::shouldUseCredentialStorage(DocumentLoader*, unsigned long identifier)
@@ -184,7 +184,7 @@
if (!webPage)
return true;
- return webPage->injectedBundleResourceLoadClient().shouldUseCredentialStorage(*webPage, *m_frame, identifier);
+ return webPage->injectedBundleResourceLoadClient().shouldUseCredentialStorage(webPage, m_frame, identifier);
}
void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge& challenge)
@@ -214,7 +214,7 @@
if (!webPage)
return;
- webPage->injectedBundleResourceLoadClient().didReceiveResponseForResource(*webPage, *m_frame, identifier, response);
+ webPage->injectedBundleResourceLoadClient().didReceiveResponseForResource(webPage, m_frame, identifier, response);
}
void WebFrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int dataLength)
@@ -223,7 +223,7 @@
if (!webPage)
return;
- webPage->injectedBundleResourceLoadClient().didReceiveContentLengthForResource(*webPage, *m_frame, identifier, dataLength);
+ webPage->injectedBundleResourceLoadClient().didReceiveContentLengthForResource(webPage, m_frame, identifier, dataLength);
}
#if ENABLE(DATA_DETECTION)
@@ -242,7 +242,7 @@
if (!webPage)
return;
- webPage->injectedBundleResourceLoadClient().didFinishLoadForResource(*webPage, *m_frame, identifier);
+ webPage->injectedBundleResourceLoadClient().didFinishLoadForResource(webPage, m_frame, identifier);
webPage->removeResourceRequest(identifier);
}
@@ -252,7 +252,7 @@
if (!webPage)
return;
- webPage->injectedBundleResourceLoadClient().didFailLoadForResource(*webPage, *m_frame, identifier, error);
+ webPage->injectedBundleResourceLoadClient().didFailLoadForResource(webPage, m_frame, identifier, error);
webPage->removeResourceRequest(identifier);
}
@@ -1701,7 +1701,7 @@
if (!webPage)
return response;
- return webPage->injectedBundleResourceLoadClient().shouldCacheResponse(*webPage, *m_frame, identifier) ? response : nil;
+ return webPage->injectedBundleResourceLoadClient().shouldCacheResponse(webPage, m_frame, identifier) ? response : nil;
}
NSDictionary *WebFrameLoaderClient::dataDetectionContext()
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2017-06-14 22:19:49 UTC (rev 218294)
@@ -341,7 +341,6 @@
, m_editorClient { std::make_unique<API::InjectedBundle::EditorClient>() }
, m_formClient(std::make_unique<API::InjectedBundle::FormClient>())
, m_loaderClient(std::make_unique<API::InjectedBundle::PageLoaderClient>())
- , m_resourceLoadClient(std::make_unique<API::InjectedBundle::ResourceLoadClient>())
, m_uiClient(std::make_unique<API::InjectedBundle::PageUIClient>())
, m_findController(makeUniqueRef<FindController>(this))
, m_userContentController(WebUserContentController::getOrCreate(parameters.userContentControllerID))
@@ -749,12 +748,9 @@
m_policyClient.initialize(client);
}
-void WebPage::setInjectedBundleResourceLoadClient(std::unique_ptr<API::InjectedBundle::ResourceLoadClient>&& client)
+void WebPage::initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClientBase* client)
{
- if (!m_resourceLoadClient)
- m_resourceLoadClient = std::make_unique<API::InjectedBundle::ResourceLoadClient>();
- else
- m_resourceLoadClient = WTFMove(client);
+ m_resourceLoadClient.initialize(client);
}
void WebPage::setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>&& uiClient)
@@ -1155,7 +1151,7 @@
m_formClient = std::make_unique<API::InjectedBundle::FormClient>();
m_loaderClient = std::make_unique<API::InjectedBundle::PageLoaderClient>();
m_policyClient.initialize(0);
- m_resourceLoadClient = std::make_unique<API::InjectedBundle::ResourceLoadClient>();
+ m_resourceLoadClient.initialize(0);
m_uiClient = std::make_unique<API::InjectedBundle::PageUIClient>();
#if ENABLE(FULLSCREEN_API)
m_fullScreenClient.initialize(0);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (218293 => 218294)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2017-06-14 22:17:35 UTC (rev 218293)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2017-06-14 22:19:49 UTC (rev 218294)
@@ -29,7 +29,6 @@
#include "APIInjectedBundleFormClient.h"
#include "APIInjectedBundlePageContextMenuClient.h"
#include "APIInjectedBundlePageLoaderClient.h"
-#include "APIInjectedBundlePageResourceLoadClient.h"
#include "APIInjectedBundlePageUIClient.h"
#include "APIObject.h"
#include "EditingRange.h"
@@ -36,6 +35,7 @@
#include "InjectedBundlePageContextMenuClient.h"
#include "InjectedBundlePageFullScreenClient.h"
#include "InjectedBundlePagePolicyClient.h"
+#include "InjectedBundlePageResourceLoadClient.h"
#include "LayerTreeContext.h"
#include "MessageReceiver.h"
#include "MessageSender.h"
@@ -332,7 +332,7 @@
void setInjectedBundleFormClient(std::unique_ptr<API::InjectedBundle::FormClient>&&);
void setInjectedBundlePageLoaderClient(std::unique_ptr<API::InjectedBundle::PageLoaderClient>&&);
void initializeInjectedBundlePolicyClient(WKBundlePagePolicyClientBase*);
- void setInjectedBundleResourceLoadClient(std::unique_ptr<API::InjectedBundle::ResourceLoadClient>&&);
+ void initializeInjectedBundleResourceLoadClient(WKBundlePageResourceLoadClientBase*);
void setInjectedBundleUIClient(std::unique_ptr<API::InjectedBundle::PageUIClient>&&);
#if ENABLE(FULLSCREEN_API)
void initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenClientBase*);
@@ -345,7 +345,7 @@
API::InjectedBundle::FormClient& injectedBundleFormClient() { return *m_formClient.get(); }
API::InjectedBundle::PageLoaderClient& injectedBundleLoaderClient() { return *m_loaderClient; }
InjectedBundlePagePolicyClient& injectedBundlePolicyClient() { return m_policyClient; }
- API::InjectedBundle::ResourceLoadClient& injectedBundleResourceLoadClient() { return *m_resourceLoadClient; }
+ InjectedBundlePageResourceLoadClient& injectedBundleResourceLoadClient() { return m_resourceLoadClient; }
API::InjectedBundle::PageUIClient& injectedBundleUIClient() { return *m_uiClient.get(); }
#if ENABLE(FULLSCREEN_API)
InjectedBundlePageFullScreenClient& injectedBundleFullScreenClient() { return m_fullScreenClient; }
@@ -1384,7 +1384,7 @@
std::unique_ptr<API::InjectedBundle::FormClient> m_formClient;
std::unique_ptr<API::InjectedBundle::PageLoaderClient> m_loaderClient;
InjectedBundlePagePolicyClient m_policyClient;
- std::unique_ptr<API::InjectedBundle::ResourceLoadClient> m_resourceLoadClient;
+ InjectedBundlePageResourceLoadClient m_resourceLoadClient;
std::unique_ptr<API::InjectedBundle::PageUIClient> m_uiClient;
#if ENABLE(FULLSCREEN_API)
InjectedBundlePageFullScreenClient m_fullScreenClient;