Title: [277264] trunk
Revision
277264
Author
[email protected]
Date
2021-05-10 09:08:29 -0700 (Mon, 10 May 2021)

Log Message

Remove WKBundlePageGroupRef
https://bugs.webkit.org/show_bug.cgi?id=225471

Reviewed by Darin Adler.

Source/WebKit:

Its last use was removed in rdar://60987265

* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h:
(API::InjectedBundle::Client::willDestroyPage):
(API::InjectedBundle::Client::didInitializePageGroup): Deleted.
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm:
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetAsynchronousSpellCheckingEnabledForTesting):
(WKBundleGetLiveDocumentURLsForTesting):
(WKBundleSetUserStyleSheetLocationForTesting):
(WKBundleAddUserScript): Deleted.
(WKBundleAddUserStyleSheet): Deleted.
(WKBundleRemoveUserScript): Deleted.
(WKBundleRemoveUserStyleSheet): Deleted.
(WKBundleRemoveUserScripts): Deleted.
(WKBundleRemoveUserStyleSheets): Deleted.
(WKBundleRemoveAllUserContent): Deleted.
(WKBundleSetAsynchronousSpellCheckingEnabled): Deleted.
(WKBundleGetLiveDocumentURLs): Deleted.
(WKBundleSetUserStyleSheetLocation): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageGetPageGroup): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp: Removed.
* WebProcess/InjectedBundle/API/c/WKBundlePageGroup.h: Removed.
* WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setAsynchronousSpellCheckingEnabled):
(WebKit::InjectedBundle::setUserStyleSheetLocation):
(WebKit::InjectedBundle::liveDocumentURLs):
(WebKit::InjectedBundle::didInitializePageGroup): Deleted.
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/InjectedBundle/InjectedBundleClient.cpp:
(WebKit::InjectedBundleClient::didInitializePageGroup): Deleted.
* WebProcess/InjectedBundle/InjectedBundleClient.h:
* WebProcess/WebPage/WebPageGroupProxy.cpp:
(WebKit::WebPageGroupProxy::create):

Tools:

Also use some smart pointers instead of raw pointers to keep things safe.

* TestWebKitAPI/InjectedBundleController.cpp:
(TestWebKitAPI::InjectedBundleController::InjectedBundleController):
(TestWebKitAPI::InjectedBundleController::initialize):
(TestWebKitAPI::InjectedBundleController::didInitializePageGroup): Deleted.
* TestWebKitAPI/InjectedBundleController.h:
(TestWebKitAPI::InjectedBundleController::bundle const):
* TestWebKitAPI/InjectedBundleTest.h:
(TestWebKitAPI::InjectedBundleTest::willDestroyPage):
(TestWebKitAPI::InjectedBundleTest::Register::create):
(TestWebKitAPI::InjectedBundleTest::didInitializePageGroup): Deleted.
* TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic_Bundle.cpp:
* TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp:
* TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash_Bundle.cpp:
* TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior_Bundle.cpp:
* TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::initialize):
(WTR::InjectedBundle::didCreatePage):
(WTR::InjectedBundle::didReceiveMessage):
(WTR::InjectedBundle::reportLiveDocuments):
(WTR::InjectedBundle::didReceiveMessageToPage):
(WTR::InjectedBundle::beginTesting):
(WTR::InjectedBundle::statisticsNotifyObserver):
(WTR::InjectedBundle::didInitializePageGroup): Deleted.
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
(WTR::InjectedBundle::bundle const):
(WTR::InjectedBundle::pageGroup const): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setUserStyleSheetEnabled):
(WTR::TestRunner::setAsynchronousSpellCheckingEnabled):

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (277263 => 277264)


--- trunk/Source/WebKit/ChangeLog	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/ChangeLog	2021-05-10 16:08:29 UTC (rev 277264)
@@ -1,3 +1,51 @@
+2021-05-10  Alex Christensen  <[email protected]>
+
+        Remove WKBundlePageGroupRef
+        https://bugs.webkit.org/show_bug.cgi?id=225471
+
+        Reviewed by Darin Adler.
+
+        Its last use was removed in rdar://60987265
+
+        * Sources.txt:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h:
+        (API::InjectedBundle::Client::willDestroyPage):
+        (API::InjectedBundle::Client::didInitializePageGroup): Deleted.
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm:
+        * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
+        (WKBundleSetAsynchronousSpellCheckingEnabledForTesting):
+        (WKBundleGetLiveDocumentURLsForTesting):
+        (WKBundleSetUserStyleSheetLocationForTesting):
+        (WKBundleAddUserScript): Deleted.
+        (WKBundleAddUserStyleSheet): Deleted.
+        (WKBundleRemoveUserScript): Deleted.
+        (WKBundleRemoveUserStyleSheet): Deleted.
+        (WKBundleRemoveUserScripts): Deleted.
+        (WKBundleRemoveUserStyleSheets): Deleted.
+        (WKBundleRemoveAllUserContent): Deleted.
+        (WKBundleSetAsynchronousSpellCheckingEnabled): Deleted.
+        (WKBundleGetLiveDocumentURLs): Deleted.
+        (WKBundleSetUserStyleSheetLocation): Deleted.
+        * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageGetPageGroup): Deleted.
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+        * WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp: Removed.
+        * WebProcess/InjectedBundle/API/c/WKBundlePageGroup.h: Removed.
+        * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::setAsynchronousSpellCheckingEnabled):
+        (WebKit::InjectedBundle::setUserStyleSheetLocation):
+        (WebKit::InjectedBundle::liveDocumentURLs):
+        (WebKit::InjectedBundle::didInitializePageGroup): Deleted.
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+        * WebProcess/InjectedBundle/InjectedBundleClient.cpp:
+        (WebKit::InjectedBundleClient::didInitializePageGroup): Deleted.
+        * WebProcess/InjectedBundle/InjectedBundleClient.h:
+        * WebProcess/WebPage/WebPageGroupProxy.cpp:
+        (WebKit::WebPageGroupProxy::create):
+
 2021-05-10  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Add picker UI for <input type=date> and <input type=datetime-local>

Modified: trunk/Source/WebKit/Headers.cmake (277263 => 277264)


--- trunk/Source/WebKit/Headers.cmake	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/Headers.cmake	2021-05-10 16:08:29 UTC (rev 277264)
@@ -139,7 +139,6 @@
     WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h
     WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h
     WebProcess/InjectedBundle/API/c/WKBundlePageFullScreenClient.h
-    WebProcess/InjectedBundle/API/c/WKBundlePageGroup.h
     WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h
     WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h
     WebProcess/InjectedBundle/API/c/WKBundlePagePolicyClient.h

Modified: trunk/Source/WebKit/Shared/API/c/wpe/WebKit.h (277263 => 277264)


--- trunk/Source/WebKit/Shared/API/c/wpe/WebKit.h	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/Shared/API/c/wpe/WebKit.h	2021-05-10 16:08:29 UTC (rev 277264)
@@ -66,7 +66,6 @@
 #include <WebKit/WKBundlePageEditorClient.h>
 #include <WebKit/WKBundlePageFormClient.h>
 #include <WebKit/WKBundlePageFullScreenClient.h>
-#include <WebKit/WKBundlePageGroup.h>
 #include <WebKit/WKBundlePageLoaderClient.h>
 #include <WebKit/WKBundlePageOverlay.h>
 #include <WebKit/WKBundlePagePolicyClient.h>

Modified: trunk/Source/WebKit/Sources.txt (277263 => 277264)


--- trunk/Source/WebKit/Sources.txt	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/Sources.txt	2021-05-10 16:08:29 UTC (rev 277264)
@@ -561,7 +561,6 @@
 WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp
 WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp
 WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
-WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp
 WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp
 WebProcess/InjectedBundle/API/c/WKBundleRangeHandle.cpp
 WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (277263 => 277264)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2021-05-10 16:08:29 UTC (rev 277264)
@@ -1759,7 +1759,6 @@
 		BC7B621512A4219A00D174A4 /* WebPageGroupProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7B621312A4219A00D174A4 /* WebPageGroupProxy.h */; };
 		BC7B625212A43C9600D174A4 /* WebPageGroupData.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7B625012A43C9600D174A4 /* WebPageGroupData.h */; };
 		BC7B633712A45ABA00D174A4 /* WKPageGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7B633512A45ABA00D174A4 /* WKPageGroup.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		BC7B633D12A45D1200D174A4 /* WKBundlePageGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = BC7B633B12A45D1200D174A4 /* WKBundlePageGroup.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BC8147A912F64CDA007B2C32 /* InjectedBundlePagePolicyClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8147A712F64CDA007B2C32 /* InjectedBundlePagePolicyClient.h */; };
 		BC8147D512F66D31007B2C32 /* InjectedBundleNavigationAction.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8147D312F66D31007B2C32 /* InjectedBundleNavigationAction.h */; };
 		BC8283DA16B4DB9300A278FE /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* WebKit.framework */; };
@@ -5384,8 +5383,6 @@
 		BC7B625112A43C9600D174A4 /* WebPageGroupData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageGroupData.cpp; sourceTree = "<group>"; };
 		BC7B633512A45ABA00D174A4 /* WKPageGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPageGroup.h; sourceTree = "<group>"; };
 		BC7B633612A45ABA00D174A4 /* WKPageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPageGroup.cpp; sourceTree = "<group>"; };
-		BC7B633B12A45D1200D174A4 /* WKBundlePageGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundlePageGroup.h; sourceTree = "<group>"; };
-		BC7B633C12A45D1200D174A4 /* WKBundlePageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundlePageGroup.cpp; sourceTree = "<group>"; };
 		BC8147A712F64CDA007B2C32 /* InjectedBundlePagePolicyClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePagePolicyClient.h; sourceTree = "<group>"; wrapsLines = 0; };
 		BC8147A812F64CDA007B2C32 /* InjectedBundlePagePolicyClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePagePolicyClient.cpp; sourceTree = "<group>"; wrapsLines = 0; };
 		BC8147D312F66D31007B2C32 /* InjectedBundleNavigationAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleNavigationAction.h; sourceTree = "<group>"; };
@@ -10564,8 +10561,6 @@
 				1AB474DF184D446A0051B622 /* WKBundlePageEditorClient.h */,
 				1AB474E1184D44800051B622 /* WKBundlePageFormClient.h */,
 				1AB474E5184D44B40051B622 /* WKBundlePageFullScreenClient.h */,
-				BC7B633C12A45D1200D174A4 /* WKBundlePageGroup.cpp */,
-				BC7B633B12A45D1200D174A4 /* WKBundlePageGroup.h */,
 				1AB474D7184D43FD0051B622 /* WKBundlePageLoaderClient.h */,
 				1A22F1001289FCD90085E74F /* WKBundlePageOverlay.cpp */,
 				1A22F0FF1289FCD90085E74F /* WKBundlePageOverlay.h */,
@@ -12669,7 +12664,6 @@
 				1AB474E0184D446A0051B622 /* WKBundlePageEditorClient.h in Headers */,
 				1AB474E2184D44800051B622 /* WKBundlePageFormClient.h in Headers */,
 				1AB474E6184D44B40051B622 /* WKBundlePageFullScreenClient.h in Headers */,
-				BC7B633D12A45D1200D174A4 /* WKBundlePageGroup.h in Headers */,
 				1AB474D8184D43FD0051B622 /* WKBundlePageLoaderClient.h in Headers */,
 				C6A4CA0B2252899800169289 /* WKBundlePageMac.h in Headers */,
 				ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */,

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/APIInjectedBundleBundleClient.h	2021-05-10 16:08:29 UTC (rev 277264)
@@ -45,7 +45,6 @@
 
     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*) { }
 };

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm	2021-05-10 16:08:29 UTC (rev 277264)
@@ -26,7 +26,6 @@
 #import "config.h"
 #import "WKWebProcessPlugInPageGroupInternal.h"
 
-#import "WKBundlePageGroup.h"
 #import "WKAPICast.h"
 #import "WKNSString.h"
 #import "WKRetainPtr.h"

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundle.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -96,34 +96,6 @@
     return WebKit::toImpl(bundleRef)->_javascript_ObjectsCount();
 }
 
-void WKBundleAddUserScript(WKBundleRef, WKBundlePageGroupRef, WKBundleScriptWorldRef, WKStringRef, WKURLRef, WKArrayRef, WKArrayRef, _WKUserScriptInjectionTime, WKUserContentInjectedFrames)
-{
-}
-
-void WKBundleAddUserStyleSheet(WKBundleRef, WKBundlePageGroupRef, WKBundleScriptWorldRef, WKStringRef, WKURLRef, WKArrayRef, WKArrayRef, WKUserContentInjectedFrames)
-{
-}
-
-void WKBundleRemoveUserScript(WKBundleRef, WKBundlePageGroupRef, WKBundleScriptWorldRef, WKURLRef)
-{
-}
-
-void WKBundleRemoveUserStyleSheet(WKBundleRef, WKBundlePageGroupRef, WKBundleScriptWorldRef, WKURLRef)
-{
-}
-
-void WKBundleRemoveUserScripts(WKBundleRef, WKBundlePageGroupRef, WKBundleScriptWorldRef)
-{
-}
-
-void WKBundleRemoveUserStyleSheets(WKBundleRef, WKBundlePageGroupRef, WKBundleScriptWorldRef)
-{
-}
-
-void WKBundleRemoveAllUserContent(WKBundleRef, WKBundlePageGroupRef)
-{
-}
-
 void WKBundleAddOriginAccessAllowListEntry(WKBundleRef bundleRef, WKStringRef sourceOrigin, WKStringRef destinationProtocol, WKStringRef destinationHost, bool allowDestinationSubdomains)
 {
     WebKit::toImpl(bundleRef)->addOriginAccessAllowListEntry(WebKit::toWTFString(sourceOrigin), WebKit::toWTFString(destinationProtocol), WebKit::toWTFString(destinationHost), allowDestinationSubdomains);
@@ -139,14 +111,14 @@
     WebKit::toImpl(bundleRef)->resetOriginAccessAllowLists();
 }
 
-void WKBundleSetAsynchronousSpellCheckingEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
+void WKBundleSetAsynchronousSpellCheckingEnabledForTesting(WKBundleRef bundleRef, bool enabled)
 {
-    WebKit::toImpl(bundleRef)->setAsynchronousSpellCheckingEnabled(WebKit::toImpl(pageGroupRef), enabled);
+    WebKit::toImpl(bundleRef)->setAsynchronousSpellCheckingEnabled(enabled);
 }
 
-WKArrayRef WKBundleGetLiveDocumentURLs(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool excludeDocumentsInPageGroupPages)
+WKArrayRef WKBundleGetLiveDocumentURLsForTesting(WKBundleRef bundleRef, bool excludeDocumentsInPageGroupPages)
 {
-    auto liveDocuments = WebKit::toImpl(bundleRef)->liveDocumentURLs(WebKit::toImpl(pageGroupRef), excludeDocumentsInPageGroupPages);
+    auto liveDocuments = WebKit::toImpl(bundleRef)->liveDocumentURLs(excludeDocumentsInPageGroupPages);
 
     auto liveURLs = adoptWK(WKMutableArrayCreate());
 
@@ -219,9 +191,9 @@
     return WebKit::InjectedBundle::isProcessingUserGesture();
 }
 
-void WKBundleSetUserStyleSheetLocation(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, WKStringRef location)
+void WKBundleSetUserStyleSheetLocationForTesting(WKBundleRef bundleRef, WKStringRef location)
 {
-    WebKit::toImpl(bundleRef)->setUserStyleSheetLocation(WebKit::toImpl(pageGroupRef), WebKit::toWTFString(location));
+    WebKit::toImpl(bundleRef)->setUserStyleSheetLocation(WebKit::toWTFString(location));
 }
 
 void WKBundleSetWebNotificationPermission(WKBundleRef bundleRef, WKBundlePageRef pageRef, WKStringRef originStringRef, bool allowed)

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h	2021-05-10 16:08:29 UTC (rev 277264)
@@ -61,7 +61,6 @@
 WK_ADD_API_MAPPING(WKBundleNavigationActionRef, InjectedBundleNavigationAction)
 WK_ADD_API_MAPPING(WKBundleNodeHandleRef, InjectedBundleNodeHandle)
 WK_ADD_API_MAPPING(WKBundlePageBannerRef, PageBanner)
-WK_ADD_API_MAPPING(WKBundlePageGroupRef, WebPageGroupProxy)
 WK_ADD_API_MAPPING(WKBundlePageOverlayRef, WebPageOverlay)
 WK_ADD_API_MAPPING(WKBundlePageRef, WebPage)
 WK_ADD_API_MAPPING(WKBundleRangeHandleRef, InjectedBundleRangeHandle)

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -163,11 +163,6 @@
 #endif
 }
 
-WKBundlePageGroupRef WKBundlePageGetPageGroup(WKBundlePageRef pageRef)
-{
-    return toAPI(WebKit::toImpl(pageRef)->pageGroup());
-}
-
 WKBundleFrameRef WKBundlePageGetMainFrame(WKBundlePageRef pageRef)
 {
     return toAPI(&WebKit::toImpl(pageRef)->mainWebFrame());

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.h (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.h	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePage.h	2021-05-10 16:08:29 UTC (rev 277264)
@@ -66,7 +66,6 @@
 WK_EXPORT void WKBundlePageSetUIClient(WKBundlePageRef page, WKBundlePageUIClientBase* client);
 WK_EXPORT void WKBundlePageSetFullScreenClient(WKBundlePageRef page, WKBundlePageFullScreenClientBase* client);
 
-WK_EXPORT WKBundlePageGroupRef WKBundlePageGetPageGroup(WKBundlePageRef page);
 WK_EXPORT WKBundleFrameRef WKBundlePageGetMainFrame(WKBundlePageRef page);
 WK_EXPORT WKFrameHandleRef WKBundleFrameCreateFrameHandle(WKBundleFrameRef);
 

Deleted: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageGroup.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2010 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 "WKBundlePageGroup.h"
-
-#include "WKAPICast.h"
-#include "WKBundleAPICast.h"
-#include "WebPageGroupProxy.h"
-
-WKTypeID WKBundlePageGroupGetTypeID()
-{
-    return WebKit::toAPI(WebKit::WebPageGroupProxy::APIType);
-}
-
-WKStringRef WKBundlePageGroupCopyIdentifier(WKBundlePageGroupRef bundlePageGroup)
-{
-    return WebKit::toCopiedAPI(WebKit::toImpl(bundlePageGroup)->identifier());
-}

Deleted: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageGroup.h (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageGroup.h	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageGroup.h	2021-05-10 16:08:29 UTC (rev 277264)
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2010 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 WKBundlePageGroup_h
-#define WKBundlePageGroup_h
-
-#include <WebKit/WKBase.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-WK_EXPORT WKTypeID WKBundlePageGroupGetTypeID();
-
-WK_EXPORT WKStringRef WKBundlePageGroupCopyIdentifier(WKBundlePageGroupRef bundlePageGroup);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* WKBundlePageGroup_h */

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h	2021-05-10 16:08:29 UTC (rev 277264)
@@ -49,24 +49,15 @@
 WK_EXPORT int WKBundlePageNumberForElementById(WKBundleRef bundle, WKBundleFrameRef frameRef, WKStringRef idRef, double pageWidthInPixels, double pageHeightInPixels);
 WK_EXPORT WKStringRef WKBundlePageSizeAndMarginsInPixels(WKBundleRef bundle, WKBundleFrameRef frameRef, int, int, int, int, int, int, int);
 WK_EXPORT bool WKBundleIsPageBoxVisible(WKBundleRef bundle, WKBundleFrameRef frameRef, int);
-WK_EXPORT void WKBundleSetUserStyleSheetLocation(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKStringRef location);
+WK_EXPORT void WKBundleSetUserStyleSheetLocationForTesting(WKBundleRef bundle, WKStringRef location);
 WK_EXPORT void WKBundleSetWebNotificationPermission(WKBundleRef bundle, WKBundlePageRef page, WKStringRef originStringRef, bool allowed);
 WK_EXPORT void WKBundleRemoveAllWebNotificationPermissions(WKBundleRef bundle, WKBundlePageRef page);
 WK_EXPORT uint64_t WKBundleGetWebNotificationID(WKBundleRef bundle, JSContextRef context, JSValueRef notification);
 WK_EXPORT WKDataRef WKBundleCreateWKDataFromUInt8Array(WKBundleRef bundle, JSContextRef context, JSValueRef data);
-WK_EXPORT void WKBundleSetAsynchronousSpellCheckingEnabled(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled);
+WK_EXPORT void WKBundleSetAsynchronousSpellCheckingEnabledForTesting(WKBundleRef bundleRef, bool enabled);
 // Returns array of dictionaries. Dictionary keys are document identifiers, values are document URLs.
-WK_EXPORT WKArrayRef WKBundleGetLiveDocumentURLs(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool excludeDocumentsInPageGroupPages);
+WK_EXPORT WKArrayRef WKBundleGetLiveDocumentURLsForTesting(WKBundleRef bundle, bool excludeDocumentsInPageGroupPages);
 
-// UserContent API
-WK_EXPORT void WKBundleAddUserScript(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKBundleScriptWorldRef scriptWorld, WKStringRef source, WKURLRef url, WKArrayRef allowlist, WKArrayRef blocklist, _WKUserScriptInjectionTime injectionTime, WKUserContentInjectedFrames injectedFrames) WK_C_API_DEPRECATED_WITH_REPLACEMENT(WKBundlePageAddUserScript);
-WK_EXPORT void WKBundleAddUserStyleSheet(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKBundleScriptWorldRef scriptWorld, WKStringRef source, WKURLRef url, WKArrayRef allowlist, WKArrayRef blocklist, WKUserContentInjectedFrames injectedFrames) WK_C_API_DEPRECATED_WITH_REPLACEMENT(WKBundlePageAddUserStyleSheet);
-WK_EXPORT void WKBundleRemoveUserScript(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKBundleScriptWorldRef scriptWorld, WKURLRef url) WK_C_API_DEPRECATED;
-WK_EXPORT void WKBundleRemoveUserStyleSheet(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKBundleScriptWorldRef scriptWorld, WKURLRef url) WK_C_API_DEPRECATED;
-WK_EXPORT void WKBundleRemoveUserScripts(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKBundleScriptWorldRef scriptWorld) WK_C_API_DEPRECATED;
-WK_EXPORT void WKBundleRemoveUserStyleSheets(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, WKBundleScriptWorldRef scriptWorld) WK_C_API_DEPRECATED;
-WK_EXPORT void WKBundleRemoveAllUserContent(WKBundleRef bundle, WKBundlePageGroupRef pageGroup) WK_C_API_DEPRECATED_WITH_REPLACEMENT(WKBundlePageRemoveAllUserContent);
-
 // Local storage API
 WK_EXPORT void WKBundleClearAllDatabases(WKBundleRef bundle);
 WK_EXPORT void WKBundleSetDatabaseQuota(WKBundleRef bundle, uint64_t);

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -171,10 +171,11 @@
     WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::ResetOriginAccessAllowLists { }, 0);
 }
 
-void InjectedBundle::setAsynchronousSpellCheckingEnabled(WebPageGroupProxy* pageGroup, bool enabled)
+void InjectedBundle::setAsynchronousSpellCheckingEnabled(bool enabled)
 {
-    for (auto& page : PageGroup::pageGroup(pageGroup->identifier())->pages())
+    Page::forEachPage([enabled](Page& page) {
         page.settings().setAsynchronousSpellCheckingEnabled(enabled);
+    });
 }
 
 int InjectedBundle::numberOfPages(WebFrame* frame, double pageWidthInPixels, double pageHeightInPixels)
@@ -272,11 +273,6 @@
     m_client->willDestroyPage(*this, *page);
 }
 
-void InjectedBundle::didInitializePageGroup(WebPageGroupProxy* pageGroup)
-{
-    m_client->didInitializePageGroup(*this, *pageGroup);
-}
-
 void InjectedBundle::didReceiveMessage(const String& messageName, API::Object* messageBody)
 {
     m_client->didReceiveMessage(*this, messageName, messageBody);
@@ -287,10 +283,11 @@
     m_client->didReceiveMessageToPage(*this, *page, messageName, messageBody);
 }
 
-void InjectedBundle::setUserStyleSheetLocation(WebPageGroupProxy* pageGroup, const String& location)
+void InjectedBundle::setUserStyleSheetLocation(const String& location)
 {
-    for (auto& page : PageGroup::pageGroup(pageGroup->identifier())->pages())
+    Page::forEachPage([location](Page& page) {
         page.settings().setUserStyleSheetLocation(URL(URL(), location));
+    });
 }
 
 void InjectedBundle::setWebNotificationPermission(WebPage* page, const String& originString, bool allowed)
@@ -336,7 +333,7 @@
     return API::Data::create(static_cast<unsigned char*>(arrayData->baseAddress()), arrayData->byteLength());
 }
 
-InjectedBundle::DocumentIDToURLMap InjectedBundle::liveDocumentURLs(WebPageGroupProxy* pageGroup, bool excludeDocumentsInPageGroupPages)
+InjectedBundle::DocumentIDToURLMap InjectedBundle::liveDocumentURLs(bool excludeDocumentsInPageGroupPages)
 {
     DocumentIDToURLMap result;
 
@@ -344,13 +341,13 @@
         result.add(document->identifier().toUInt64(), document->url().string());
 
     if (excludeDocumentsInPageGroupPages) {
-        for (auto& page : PageGroup::pageGroup(pageGroup->identifier())->pages()) {
+        Page::forEachPage([&](Page& page) {
             for (auto* frame = &page.mainFrame(); frame; frame = frame->tree().traverseNext()) {
                 if (!frame->document())
                     continue;
                 result.remove(frame->document()->identifier().toUInt64());
             }
-        }
+        });
     }
 
     return result;

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.h	2021-05-10 16:08:29 UTC (rev 277264)
@@ -98,12 +98,12 @@
     void addOriginAccessAllowListEntry(const String&, const String&, const String&, bool);
     void removeOriginAccessAllowListEntry(const String&, const String&, const String&, bool);
     void resetOriginAccessAllowLists();
-    void setAsynchronousSpellCheckingEnabled(WebPageGroupProxy*, bool);
+    void setAsynchronousSpellCheckingEnabled(bool);
     int numberOfPages(WebFrame*, double, double);
     int pageNumberForElementById(WebFrame*, const String&, double, double);
     String pageSizeAndMarginsInPixels(WebFrame*, int, int, int, int, int, int, int);
     bool isPageBoxVisible(WebFrame*, int);
-    void setUserStyleSheetLocation(WebPageGroupProxy*, const String&);
+    void setUserStyleSheetLocation(const String&);
     void setWebNotificationPermission(WebPage*, const String& originString, bool allowed);
     void removeAllWebNotificationPermissions(WebPage*);
     uint64_t webNotificationID(JSContextRef, JSValueRef);
@@ -110,7 +110,7 @@
     Ref<API::Data> createWebDataFromUint8Array(JSContextRef, JSValueRef);
     
     typedef HashMap<uint64_t, String> DocumentIDToURLMap;
-    DocumentIDToURLMap liveDocumentURLs(WebPageGroupProxy*, bool excludeDocumentsInPageGroupPages);
+    DocumentIDToURLMap liveDocumentURLs(bool excludeDocumentsInPageGroupPages);
 
     // Garbage collection API
     void garbageCollectJavaScriptObjects();
@@ -120,7 +120,6 @@
     // Callback hooks
     void didCreatePage(WebPage*);
     void willDestroyPage(WebPage*);
-    void didInitializePageGroup(WebPageGroupProxy*);
     void didReceiveMessage(const String&, API::Object*);
     void didReceiveMessageToPage(WebPage*, const String&, API::Object*);
 

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleClient.cpp (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleClient.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleClient.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -54,14 +54,6 @@
     m_client.willDestroyPage(toAPI(&bundle), toAPI(&page), m_client.base.clientInfo);
 }
 
-void InjectedBundleClient::didInitializePageGroup(InjectedBundle& bundle, WebPageGroupProxy& pageGroup)
-{
-    if (!m_client.didInitializePageGroup)
-        return;
-
-    m_client.didInitializePageGroup(toAPI(&bundle), toAPI(&pageGroup), m_client.base.clientInfo);
-}
-
 void InjectedBundleClient::didReceiveMessage(InjectedBundle& bundle, const String& messageName, API::Object* messageBody)
 {
     if (!m_client.didReceiveMessage)

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleClient.h (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleClient.h	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundleClient.h	2021-05-10 16:08:29 UTC (rev 277264)
@@ -51,7 +51,6 @@
 
     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;
 };

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPageGroupProxy.cpp (277263 => 277264)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPageGroupProxy.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPageGroupProxy.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -37,12 +37,7 @@
 
 Ref<WebPageGroupProxy> WebPageGroupProxy::create(const WebPageGroupData& data)
 {
-    auto pageGroup = adoptRef(*new WebPageGroupProxy(data));
-
-    if (WebProcess::singleton().injectedBundle())
-        WebProcess::singleton().injectedBundle()->didInitializePageGroup(pageGroup.ptr());
-
-    return pageGroup;
+    return adoptRef(*new WebPageGroupProxy(data));
 }
 
 WebPageGroupProxy::WebPageGroupProxy(const WebPageGroupData& data)

Modified: trunk/Tools/ChangeLog (277263 => 277264)


--- trunk/Tools/ChangeLog	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Tools/ChangeLog	2021-05-10 16:08:29 UTC (rev 277264)
@@ -1,3 +1,43 @@
+2021-05-10  Alex Christensen  <[email protected]>
+
+        Remove WKBundlePageGroupRef
+        https://bugs.webkit.org/show_bug.cgi?id=225471
+
+        Reviewed by Darin Adler.
+
+        Also use some smart pointers instead of raw pointers to keep things safe.
+
+        * TestWebKitAPI/InjectedBundleController.cpp:
+        (TestWebKitAPI::InjectedBundleController::InjectedBundleController):
+        (TestWebKitAPI::InjectedBundleController::initialize):
+        (TestWebKitAPI::InjectedBundleController::didInitializePageGroup): Deleted.
+        * TestWebKitAPI/InjectedBundleController.h:
+        (TestWebKitAPI::InjectedBundleController::bundle const):
+        * TestWebKitAPI/InjectedBundleTest.h:
+        (TestWebKitAPI::InjectedBundleTest::willDestroyPage):
+        (TestWebKitAPI::InjectedBundleTest::Register::create):
+        (TestWebKitAPI::InjectedBundleTest::didInitializePageGroup): Deleted.
+        * TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic_Bundle.cpp:
+        * TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp:
+        * TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash_Bundle.cpp:
+        * TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior_Bundle.cpp:
+        * TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp:
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::initialize):
+        (WTR::InjectedBundle::didCreatePage):
+        (WTR::InjectedBundle::didReceiveMessage):
+        (WTR::InjectedBundle::reportLiveDocuments):
+        (WTR::InjectedBundle::didReceiveMessageToPage):
+        (WTR::InjectedBundle::beginTesting):
+        (WTR::InjectedBundle::statisticsNotifyObserver):
+        (WTR::InjectedBundle::didInitializePageGroup): Deleted.
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+        (WTR::InjectedBundle::bundle const):
+        (WTR::InjectedBundle::pageGroup const): Deleted.
+        * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
+        (WTR::TestRunner::setUserStyleSheetEnabled):
+        (WTR::TestRunner::setAsynchronousSpellCheckingEnabled):
+
 2021-05-09  Khem Raj  <[email protected]>
 
         [Tools] Generate marshalling code without source reference

Modified: trunk/Tools/TestWebKitAPI/InjectedBundleController.cpp (277263 => 277264)


--- trunk/Tools/TestWebKitAPI/InjectedBundleController.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Tools/TestWebKitAPI/InjectedBundleController.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -43,8 +43,6 @@
 }
 
 InjectedBundleController::InjectedBundleController()
-    : m_bundle(0)
-    , m_currentTest(0)
 {
 }
 
@@ -61,11 +59,11 @@
         { 0, this },
         didCreatePage,
         willDestroyPage,
-        didInitializePageGroup,
+        nullptr,
         didReceiveMessage,
         didReceiveMessageToPage
     };
-    WKBundleSetClient(m_bundle, &client.base);
+    WKBundleSetClient(m_bundle.get(), &client.base);
 
     // Initialize the test from the "initializationUserData".
 
@@ -94,13 +92,6 @@
     self->m_currentTest->willDestroyPage(bundle, page);
 }
 
-void InjectedBundleController::didInitializePageGroup(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, const void* clientInfo)
-{
-    InjectedBundleController* self = static_cast<InjectedBundleController*>(const_cast<void*>(clientInfo));
-    assert(self->m_currentTest);
-    self->m_currentTest->didInitializePageGroup(bundle, pageGroup);
-}
-
 void InjectedBundleController::didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
 {
     InjectedBundleController* self = static_cast<InjectedBundleController*>(const_cast<void*>(clientInfo));

Modified: trunk/Tools/TestWebKitAPI/InjectedBundleController.h (277263 => 277264)


--- trunk/Tools/TestWebKitAPI/InjectedBundleController.h	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Tools/TestWebKitAPI/InjectedBundleController.h	2021-05-10 16:08:29 UTC (rev 277264)
@@ -23,10 +23,10 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef InjectedBundleController_h
-#define InjectedBundleController_h
+#pragma once
 
 #include <WebKit/WKBundle.h>
+#include <WebKit/WKRetainPtr.h>
 #include <map>
 #include <string>
 
@@ -43,10 +43,10 @@
     void dumpTestNames();
     void initializeTestNamed(WKBundleRef bundle, const std::string&, WKTypeRef userData);
 
-    typedef InjectedBundleTest* (*CreateInjectedBundleTestFunction)(const std::string&);
+    typedef std::unique_ptr<InjectedBundleTest> (*CreateInjectedBundleTestFunction)(const std::string&);
     void registerCreateInjectedBundleTestFunction(const std::string&, CreateInjectedBundleTestFunction);
 
-    WKBundleRef bundle() const { return m_bundle; }
+    WKBundleRef bundle() const { return m_bundle.get(); }
     
 private:
     InjectedBundleController();
@@ -56,15 +56,12 @@
 
     static void didCreatePage(WKBundleRef, WKBundlePageRef, const void* clientInfo);
     static void willDestroyPage(WKBundleRef, WKBundlePageRef, const void* clientInfo);
-    static void didInitializePageGroup(WKBundleRef, WKBundlePageGroupRef, const void* clientInfo);
     static void didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo);
     static void didReceiveMessageToPage(WKBundleRef, WKBundlePageRef, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo);
 
     std::map<std::string, CreateInjectedBundleTestFunction> m_createInjectedBundleTestFunctions;
-    WKBundleRef m_bundle;
-    InjectedBundleTest* m_currentTest;
+    WKRetainPtr<WKBundleRef> m_bundle;
+    std::unique_ptr<InjectedBundleTest> m_currentTest;
 };
 
 } // namespace TestWebKitAPI
-
-#endif // InjectedBundleController_h

Modified: trunk/Tools/TestWebKitAPI/InjectedBundleTest.h (277263 => 277264)


--- trunk/Tools/TestWebKitAPI/InjectedBundleTest.h	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Tools/TestWebKitAPI/InjectedBundleTest.h	2021-05-10 16:08:29 UTC (rev 277264)
@@ -38,7 +38,6 @@
 
     virtual void didCreatePage(WKBundleRef, WKBundlePageRef) { }
     virtual void willDestroyPage(WKBundleRef, WKBundlePageRef) { }
-    virtual void didInitializePageGroup(WKBundleRef, WKBundlePageGroupRef) { }
     virtual void didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef messageBody) { }
     virtual void didReceiveMessageToPage(WKBundleRef, WKBundlePageRef, WKStringRef messageName, WKTypeRef messageBody) { }
 
@@ -52,9 +51,9 @@
         }
 
     private:
-        static InjectedBundleTest* create(const std::string& identifier) 
+        static std::unique_ptr<InjectedBundleTest> create(const std::string& identifier)
         {
-            return new TestClassTy(identifier);
+            return makeUniqueWithoutFastMallocCheck<TestClassTy>(identifier);
         }
     };
 

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic_Bundle.cpp (277263 => 277264)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic_Bundle.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionBasic_Bundle.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -31,7 +31,6 @@
 #include <WebKit/WKBundleDOMWindowExtension.h>
 #include <WebKit/WKBundleFrame.h>
 #include <WebKit/WKBundlePage.h>
-#include <WebKit/WKBundlePageGroup.h>
 #include <WebKit/WKBundlePagePrivate.h>
 #include <WebKit/WKBundlePrivate.h>
 #include <WebKit/WKBundleScriptWorld.h>

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp (277263 => 277264)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/DOMWindowExtensionNoCache_Bundle.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -31,7 +31,6 @@
 #include <WebKit/WKBundleDOMWindowExtension.h>
 #include <WebKit/WKBundleFrame.h>
 #include <WebKit/WKBundlePage.h>
-#include <WebKit/WKBundlePageGroup.h>
 #include <WebKit/WKBundlePagePrivate.h>
 #include <WebKit/WKBundlePrivate.h>
 #include <WebKit/WKBundleScriptWorld.h>

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash_Bundle.cpp (277263 => 277264)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash_Bundle.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/DocumentStartUserScriptAlertCrash_Bundle.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -28,7 +28,6 @@
 #if WK_HAVE_C_SPI
 
 #include "InjectedBundleTest.h"
-#include <WebKit/WKBundlePageGroup.h>
 #include <WebKit/WKBundlePagePrivate.h>
 #include <WebKit/WKBundlePrivate.h>
 #include <WebKit/WKBundleScriptWorld.h>

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior_Bundle.cpp (277263 => 277264)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior_Bundle.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleDisableOverrideBuiltinsBehavior_Bundle.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -28,7 +28,6 @@
 #if WK_HAVE_C_SPI
 
 #include "InjectedBundleTest.h"
-#include <WebKit/WKBundlePageGroup.h>
 #include <WebKit/WKBundlePagePrivate.h>
 #include <WebKit/WKBundlePrivate.h>
 #include <WebKit/WKBundleScriptWorld.h>

Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp (277263 => 277264)


--- trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/InjectedBundleMakeAllShadowRootsOpen_Bundle.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -28,7 +28,6 @@
 #if WK_HAVE_C_SPI
 
 #include "InjectedBundleTest.h"
-#include <WebKit/WKBundlePageGroup.h>
 #include <WebKit/WKBundlePagePrivate.h>
 #include <WebKit/WKBundlePrivate.h>
 #include <WebKit/WKBundleScriptWorld.h>

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp (277263 => 277264)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -74,11 +74,6 @@
     static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->willDestroyPage(page);
 }
 
-void InjectedBundle::didInitializePageGroup(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, const void* clientInfo)
-{
-    static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didInitializePageGroup(pageGroup);
-}
-
 void InjectedBundle::didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
 {
     static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didReceiveMessage(messageName, messageBody);
@@ -97,12 +92,12 @@
         { 1, this },
         didCreatePage,
         willDestroyPage,
-        didInitializePageGroup,
+        nullptr,
         didReceiveMessage,
         didReceiveMessageToPage
     };
-    WKBundleSetClient(m_bundle, &client.base);
-    WKBundleSetServiceWorkerProxyCreationCallback(m_bundle, WebCoreTestSupport::setupNewlyCreatedServiceWorker);
+    WKBundleSetClient(m_bundle.get(), &client.base);
+    WKBundleSetServiceWorkerProxyCreationCallback(m_bundle.get(), WebCoreTestSupport::setupNewlyCreatedServiceWorker);
     platformInitialize(initializationUserData);
     WebCoreTestSupport::populateJITOperations();
 
@@ -121,7 +116,7 @@
 
     WKTypeRef result = nullptr;
     ALLOW_DEPRECATED_DECLARATIONS_BEGIN
-    WKBundlePostSynchronousMessage(m_bundle, toWK("Initialization").get(), nullptr, &result);
+    WKBundlePostSynchronousMessage(m_bundle.get(), toWK("Initialization").get(), nullptr, &result);
     ALLOW_DEPRECATED_DECLARATIONS_END
     auto initializationDictionary = adoptWK(dictionaryValue(result));
 
@@ -136,11 +131,6 @@
     });
 }
 
-void InjectedBundle::didInitializePageGroup(WKBundlePageGroupRef pageGroup)
-{
-    m_pageGroup = pageGroup;
-}
-
 void InjectedBundle::setUpInjectedBundleClients(WKBundlePageRef page)
 {
     WKBundlePageFormClientV2 formClient = {
@@ -178,7 +168,7 @@
 
 void InjectedBundle::didReceiveMessage(WKStringRef, WKTypeRef)
 {
-    WKBundlePostMessage(m_bundle, toWK("Error").get(), toWK("Unknown").get());
+    WKBundlePostMessage(m_bundle.get(), toWK("Error").get(), toWK("Unknown").get());
 }
 
 static void postGCTask(void* context)
@@ -191,10 +181,10 @@
 void InjectedBundle::reportLiveDocuments(WKBundlePageRef page)
 {
     // Release memory again, after the GC and timer fire. This is necessary to clear entries from CachedResourceLoader's m_documentResources in some scenarios.
-    WKBundleReleaseMemory(m_bundle);
+    WKBundleReleaseMemory(m_bundle.get());
 
     const bool excludeDocumentsInPageGroup = true;
-    WKBundlePagePostMessage(page, toWK("LiveDocuments").get(), adoptWK(WKBundleGetLiveDocumentURLs(m_bundle, m_pageGroup, excludeDocumentsInPageGroup)).get());
+    WKBundlePagePostMessage(page, toWK("LiveDocuments").get(), adoptWK(WKBundleGetLiveDocumentURLsForTesting(m_bundle.get(), excludeDocumentsInPageGroup)).get());
 }
 
 void InjectedBundle::didReceiveMessageToPage(WKBundlePageRef page, WKStringRef messageName, WKTypeRef messageBody)
@@ -216,7 +206,7 @@
         if (auto options = stringValue(messageBodyDictionary, "JSCOptions"))
             JSC::Options::setOptions(toWTFString(options).utf8().data());
         if (booleanValue(messageBodyDictionary, "ShouldGC"))
-            WKBundleGarbageCollectJavaScriptObjects(m_bundle);
+            WKBundleGarbageCollectJavaScriptObjects(m_bundle.get());
 
 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
         m_accessibilityIsolatedTreeMode = booleanValue(messageBodyDictionary, "AccessibilityIsolatedTree");
@@ -243,12 +233,12 @@
 
     if (WKStringIsEqualToUTF8CString(messageName, "GetLiveDocuments")) {
         const bool excludeDocumentsInPageGroup = false;
-        postPageMessage("LiveDocuments", adoptWK(WKBundleGetLiveDocumentURLs(m_bundle, m_pageGroup, excludeDocumentsInPageGroup)));
+        postPageMessage("LiveDocuments", adoptWK(WKBundleGetLiveDocumentURLsForTesting(m_bundle.get(), excludeDocumentsInPageGroup)));
         return;
     }
 
     if (WKStringIsEqualToUTF8CString(messageName, "CheckForWorldLeaks")) {
-        WKBundleReleaseMemory(m_bundle);
+        WKBundleReleaseMemory(m_bundle.get());
 
         WKRetain(page); // Balanced by the release in postGCTask.
         WKBundlePageCallAfterTasksAndTimers(page, postGCTask, (void*)page);
@@ -528,14 +518,14 @@
     if (testingMode != BegingTestingMode::New)
         return;
 
-    WKBundleClearAllDatabases(m_bundle);
+    WKBundleClearAllDatabases(m_bundle.get());
     WKBundlePageClearApplicationCache(page()->page());
-    WKBundleResetOriginAccessAllowLists(m_bundle);
-    WKBundleClearResourceLoadStatistics(m_bundle);
+    WKBundleResetOriginAccessAllowLists(m_bundle.get());
+    WKBundleClearResourceLoadStatistics(m_bundle.get());
 
     // [WK2] REGRESSION(r128623): It made layout tests extremely slow
     // https://bugs.webkit.org/show_bug.cgi?id=96862
-    // WKBundleSetDatabaseQuota(m_bundle, 5 * 1024 * 1024);
+    // WKBundleSetDatabaseQuota(m_bundle.get(), 5 * 1024 * 1024);
 }
 
 void InjectedBundle::done()
@@ -839,7 +829,7 @@
 
 bool InjectedBundle::statisticsNotifyObserver()
 {
-    return WKBundleResourceLoadStatisticsNotifyObserver(m_bundle);
+    return WKBundleResourceLoadStatisticsNotifyObserver(m_bundle.get());
 }
 
 void InjectedBundle::textDidChangeInTextField()

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h (277263 => 277264)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h	2021-05-10 16:08:29 UTC (rev 277264)
@@ -51,8 +51,7 @@
     // Initialize the InjectedBundle.
     void initialize(WKBundleRef, WKTypeRef initializationUserData);
 
-    WKBundleRef bundle() const { return m_bundle; }
-    WKBundlePageGroupRef pageGroup() const { return m_pageGroup; }
+    WKBundleRef bundle() const { return m_bundle.get(); }
 
     TestRunner* testRunner() { return m_testRunner.get(); }
     GCController* gcController() { return m_gcController.get(); }
@@ -152,13 +151,11 @@
 
     static void didCreatePage(WKBundleRef, WKBundlePageRef, const void* clientInfo);
     static void willDestroyPage(WKBundleRef, WKBundlePageRef, const void* clientInfo);
-    static void didInitializePageGroup(WKBundleRef, WKBundlePageGroupRef, const void* clientInfo);
     static void didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo);
     static void didReceiveMessageToPage(WKBundleRef, WKBundlePageRef, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo);
 
     void didCreatePage(WKBundlePageRef);
     void willDestroyPage(WKBundlePageRef);
-    void didInitializePageGroup(WKBundlePageGroupRef);
     void didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody);
     void didReceiveMessageToPage(WKBundlePageRef, WKStringRef messageName, WKTypeRef messageBody);
 
@@ -169,8 +166,7 @@
     enum class BegingTestingMode { New, Resume };
     void beginTesting(WKDictionaryRef initialSettings, BegingTestingMode);
 
-    WKBundleRef m_bundle { nullptr };
-    WKBundlePageGroupRef m_pageGroup { nullptr };
+    WKRetainPtr<WKBundleRef> m_bundle;
     Vector<std::unique_ptr<InjectedBundlePage>> m_pages;
 
 #if HAVE(ACCESSIBILITY)

Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp (277263 => 277264)


--- trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2021-05-10 15:41:25 UTC (rev 277263)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp	2021-05-10 16:08:29 UTC (rev 277264)
@@ -790,7 +790,7 @@
     auto emptyString = toWK("");
     auto location = enabled ? m_userStyleSheetLocation.get() : emptyString.get();
     auto& injectedBundle = InjectedBundle::singleton();
-    WKBundleSetUserStyleSheetLocation(injectedBundle.bundle(), injectedBundle.pageGroup(), location);
+    WKBundleSetUserStyleSheetLocationForTesting(injectedBundle.bundle(), location);
 }
 
 void TestRunner::setUserStyleSheetLocation(JSStringRef location)
@@ -824,7 +824,7 @@
 void TestRunner::setAsynchronousSpellCheckingEnabled(bool enabled)
 {
     auto& injectedBundle = InjectedBundle::singleton();
-    WKBundleSetAsynchronousSpellCheckingEnabled(injectedBundle.bundle(), injectedBundle.pageGroup(), enabled);
+    WKBundleSetAsynchronousSpellCheckingEnabledForTesting(injectedBundle.bundle(), enabled);
 }
 
 void TestRunner::grantWebNotificationPermission(JSStringRef origin)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to