Title: [272954] branches/safari-611-branch/Source
Revision
272954
Author
repst...@apple.com
Date
2021-02-16 17:17:44 -0800 (Tue, 16 Feb 2021)

Log Message

Cherry-pick r272550. rdar://problem/74409264

    Make the UserContentController for ServiceWorker pages be non-optional.
    <rdar://problem/71434565> and https://bugs.webkit.org/show_bug.cgi?id=221503

    Reviewed by Alex Christensen.
    Source/WebCore:

    * loader/EmptyClients.cpp:
    (WebCore::pageConfigurationWithEmptyClients):

    * page/Page.cpp:
    (WebCore::Page::Page):

    * page/PageConfiguration.cpp:
    (WebCore::PageConfiguration::PageConfiguration):
    * page/PageConfiguration.h:

    Source/WebKit:

    Normal Pages always have a UserContentProvider, even if they just create an empty default one.

    Same should be true for ServiceWorkers.

    * Shared/ServiceWorkerInitializationData.cpp:
    (WebKit::ServiceWorkerInitializationData::decode):
    * Shared/ServiceWorkerInitializationData.h:

    * UIProcess/WebProcessPool.cpp:
    (WebKit::WebProcessPool::userContentControllerIdentifierForServiceWorkers):
    (WebKit::WebProcessPool::createWebPage):
    * UIProcess/WebProcessPool.h:

    * UIProcess/WebProcessProxy.cpp:
    (WebKit::WebProcessProxy::enableServiceWorkers):
    * UIProcess/WebProcessProxy.h:

    * WebProcess/Storage/WebSWContextManagerConnection.cpp:
    (WebKit::m_userContentController):
    (WebKit::m_userAgent): Deleted.
    * WebProcess/Storage/WebSWContextManagerConnection.h:

    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::m_limitsNavigationsToAppBoundDomains):

    Source/WebKitLegacy/mac:

    * WebView/WebView.mm:
    (-[WebView _commonInitializationWithFrameName:groupName:]):

    Source/WebKitLegacy/win:

    * WebView.cpp:
    (WebView::initWithFrame):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272550 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (272953 => 272954)


--- branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-17 01:17:44 UTC (rev 272954)
@@ -1,5 +1,82 @@
 2021-02-16  Ruben Turcios  <rubent...@apple.com>
 
+        Cherry-pick r272550. rdar://problem/74409264
+
+    Make the UserContentController for ServiceWorker pages be non-optional.
+    <rdar://problem/71434565> and https://bugs.webkit.org/show_bug.cgi?id=221503
+    
+    Reviewed by Alex Christensen.
+    Source/WebCore:
+    
+    * loader/EmptyClients.cpp:
+    (WebCore::pageConfigurationWithEmptyClients):
+    
+    * page/Page.cpp:
+    (WebCore::Page::Page):
+    
+    * page/PageConfiguration.cpp:
+    (WebCore::PageConfiguration::PageConfiguration):
+    * page/PageConfiguration.h:
+    
+    Source/WebKit:
+    
+    Normal Pages always have a UserContentProvider, even if they just create an empty default one.
+    
+    Same should be true for ServiceWorkers.
+    
+    * Shared/ServiceWorkerInitializationData.cpp:
+    (WebKit::ServiceWorkerInitializationData::decode):
+    * Shared/ServiceWorkerInitializationData.h:
+    
+    * UIProcess/WebProcessPool.cpp:
+    (WebKit::WebProcessPool::userContentControllerIdentifierForServiceWorkers):
+    (WebKit::WebProcessPool::createWebPage):
+    * UIProcess/WebProcessPool.h:
+    
+    * UIProcess/WebProcessProxy.cpp:
+    (WebKit::WebProcessProxy::enableServiceWorkers):
+    * UIProcess/WebProcessProxy.h:
+    
+    * WebProcess/Storage/WebSWContextManagerConnection.cpp:
+    (WebKit::m_userContentController):
+    (WebKit::m_userAgent): Deleted.
+    * WebProcess/Storage/WebSWContextManagerConnection.h:
+    
+    * WebProcess/WebPage/WebPage.cpp:
+    (WebKit::m_limitsNavigationsToAppBoundDomains):
+    
+    Source/WebKitLegacy/mac:
+    
+    * WebView/WebView.mm:
+    (-[WebView _commonInitializationWithFrameName:groupName:]):
+    
+    Source/WebKitLegacy/win:
+    
+    * WebView.cpp:
+    (WebView::initWithFrame):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272550 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-08  Brady Eidson  <beid...@apple.com>
+
+            Make the UserContentController for ServiceWorker pages be non-optional.
+            <rdar://problem/71434565> and https://bugs.webkit.org/show_bug.cgi?id=221503
+
+            Reviewed by Alex Christensen.
+
+            * loader/EmptyClients.cpp:
+            (WebCore::pageConfigurationWithEmptyClients):
+
+            * page/Page.cpp:
+            (WebCore::Page::Page):
+
+            * page/PageConfiguration.cpp:
+            (WebCore::PageConfiguration::PageConfiguration):
+            * page/PageConfiguration.h:
+
+2021-02-16  Ruben Turcios  <rubent...@apple.com>
+
         Cherry-pick r272495. rdar://problem/74409320
 
     [macOS] Return key binding for date inputs conflicts with return to submit form

Modified: branches/safari-611-branch/Source/WebCore/loader/EmptyClients.cpp (272953 => 272954)


--- branches/safari-611-branch/Source/WebCore/loader/EmptyClients.cpp	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebCore/loader/EmptyClients.cpp	2021-02-17 01:17:44 UTC (rev 272954)
@@ -605,6 +605,7 @@
         SocketProvider::create(),
         LibWebRTCProvider::create(),
         CacheStorageProvider::create(),
+        adoptRef(*new EmptyUserContentProvider),
         adoptRef(*new EmptyBackForwardClient),
         CookieJar::create(adoptRef(*new EmptyStorageSessionProvider)),
         makeUniqueRef<EmptyProgressTrackerClient>(),
@@ -639,7 +640,6 @@
     pageConfiguration.databaseProvider = adoptRef(*new EmptyDatabaseProvider);
     pageConfiguration.pluginInfoProvider = adoptRef(*new EmptyPluginInfoProvider);
     pageConfiguration.storageNamespaceProvider = adoptRef(*new EmptyStorageNamespaceProvider);
-    pageConfiguration.userContentProvider = adoptRef(*new EmptyUserContentProvider);
     pageConfiguration.visitedLinkStore = adoptRef(*new EmptyVisitedLinkStore);
     
     return pageConfiguration;

Modified: branches/safari-611-branch/Source/WebCore/page/Page.cpp (272953 => 272954)


--- branches/safari-611-branch/Source/WebCore/page/Page.cpp	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebCore/page/Page.cpp	2021-02-17 01:17:44 UTC (rev 272954)
@@ -272,7 +272,7 @@
     , m_databaseProvider(*WTFMove(pageConfiguration.databaseProvider))
     , m_pluginInfoProvider(*WTFMove(pageConfiguration.pluginInfoProvider))
     , m_storageNamespaceProvider(*WTFMove(pageConfiguration.storageNamespaceProvider))
-    , m_userContentProvider(*WTFMove(pageConfiguration.userContentProvider))
+    , m_userContentProvider(WTFMove(pageConfiguration.userContentProvider))
     , m_visitedLinkStore(*WTFMove(pageConfiguration.visitedLinkStore))
     , m_sessionID(pageConfiguration.sessionID)
 #if ENABLE(VIDEO)

Modified: branches/safari-611-branch/Source/WebCore/page/PageConfiguration.cpp (272953 => 272954)


--- branches/safari-611-branch/Source/WebCore/page/PageConfiguration.cpp	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebCore/page/PageConfiguration.cpp	2021-02-17 01:17:44 UTC (rev 272954)
@@ -58,7 +58,7 @@
 
 namespace WebCore {
 
-PageConfiguration::PageConfiguration(PAL::SessionID sessionID, UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider, UniqueRef<LibWebRTCProvider>&& libWebRTCProvider, Ref<CacheStorageProvider>&& cacheStorageProvider, Ref<BackForwardClient>&& backForwardClient, Ref<CookieJar>&& cookieJar, UniqueRef<ProgressTrackerClient>&& progressTrackerClient, UniqueRef<FrameLoaderClient>&& loaderClientForMainFrame, UniqueRef<SpeechRecognitionProvider>&& speechRecognitionProvider, UniqueRef<MediaRecorderProvider>&& mediaRecorderProvider)
+PageConfiguration::PageConfiguration(PAL::SessionID sessionID, UniqueRef<EditorClient>&& editorClient, Ref<SocketProvider>&& socketProvider, UniqueRef<LibWebRTCProvider>&& libWebRTCProvider, Ref<CacheStorageProvider>&& cacheStorageProvider, Ref<UserContentProvider>&& userContentProvider, Ref<BackForwardClient>&& backForwardClient, Ref<CookieJar>&& cookieJar, UniqueRef<ProgressTrackerClient>&& progressTrackerClient, UniqueRef<FrameLoaderClient>&& loaderClientForMainFrame, UniqueRef<SpeechRecognitionProvider>&& speechRecognitionProvider, UniqueRef<MediaRecorderProvider>&& mediaRecorderProvider)
     : sessionID(sessionID)
     , editorClient(WTFMove(editorClient))
     , socketProvider(WTFMove(socketProvider))
@@ -68,6 +68,7 @@
     , cookieJar(WTFMove(cookieJar))
     , loaderClientForMainFrame(WTFMove(loaderClientForMainFrame))
     , cacheStorageProvider(WTFMove(cacheStorageProvider))
+    , userContentProvider(WTFMove(userContentProvider))
     , speechRecognitionProvider(WTFMove(speechRecognitionProvider))
     , mediaRecorderProvider(WTFMove(mediaRecorderProvider))
 {

Modified: branches/safari-611-branch/Source/WebCore/page/PageConfiguration.h (272953 => 272954)


--- branches/safari-611-branch/Source/WebCore/page/PageConfiguration.h	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebCore/page/PageConfiguration.h	2021-02-17 01:17:44 UTC (rev 272954)
@@ -73,7 +73,7 @@
 class PageConfiguration {
     WTF_MAKE_NONCOPYABLE(PageConfiguration); WTF_MAKE_FAST_ALLOCATED;
 public:
-    WEBCORE_EXPORT PageConfiguration(PAL::SessionID, UniqueRef<EditorClient>&&, Ref<SocketProvider>&&, UniqueRef<LibWebRTCProvider>&&, Ref<CacheStorageProvider>&&, Ref<BackForwardClient>&&, Ref<CookieJar>&&, UniqueRef<ProgressTrackerClient>&&, UniqueRef<FrameLoaderClient>&&, UniqueRef<SpeechRecognitionProvider>&&, UniqueRef<MediaRecorderProvider>&&);
+    WEBCORE_EXPORT PageConfiguration(PAL::SessionID, UniqueRef<EditorClient>&&, Ref<SocketProvider>&&, UniqueRef<LibWebRTCProvider>&&, Ref<CacheStorageProvider>&&, Ref<UserContentProvider>&&, Ref<BackForwardClient>&&, Ref<CookieJar>&&, UniqueRef<ProgressTrackerClient>&&, UniqueRef<FrameLoaderClient>&&, UniqueRef<SpeechRecognitionProvider>&&, UniqueRef<MediaRecorderProvider>&&);
     WEBCORE_EXPORT ~PageConfiguration();
     PageConfiguration(PageConfiguration&&);
 
@@ -120,7 +120,7 @@
     Ref<CacheStorageProvider> cacheStorageProvider;
     RefPtr<PluginInfoProvider> pluginInfoProvider;
     RefPtr<StorageNamespaceProvider> storageNamespaceProvider;
-    RefPtr<UserContentProvider> userContentProvider;
+    Ref<UserContentProvider> userContentProvider;
     RefPtr<VisitedLinkStore> visitedLinkStore;
     
 #if ENABLE(DEVICE_ORIENTATION) && PLATFORM(IOS_FAMILY)

Modified: branches/safari-611-branch/Source/WebKit/ChangeLog (272953 => 272954)


--- branches/safari-611-branch/Source/WebKit/ChangeLog	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKit/ChangeLog	2021-02-17 01:17:44 UTC (rev 272954)
@@ -1,5 +1,97 @@
 2021-02-16  Ruben Turcios  <rubent...@apple.com>
 
+        Cherry-pick r272550. rdar://problem/74409264
+
+    Make the UserContentController for ServiceWorker pages be non-optional.
+    <rdar://problem/71434565> and https://bugs.webkit.org/show_bug.cgi?id=221503
+    
+    Reviewed by Alex Christensen.
+    Source/WebCore:
+    
+    * loader/EmptyClients.cpp:
+    (WebCore::pageConfigurationWithEmptyClients):
+    
+    * page/Page.cpp:
+    (WebCore::Page::Page):
+    
+    * page/PageConfiguration.cpp:
+    (WebCore::PageConfiguration::PageConfiguration):
+    * page/PageConfiguration.h:
+    
+    Source/WebKit:
+    
+    Normal Pages always have a UserContentProvider, even if they just create an empty default one.
+    
+    Same should be true for ServiceWorkers.
+    
+    * Shared/ServiceWorkerInitializationData.cpp:
+    (WebKit::ServiceWorkerInitializationData::decode):
+    * Shared/ServiceWorkerInitializationData.h:
+    
+    * UIProcess/WebProcessPool.cpp:
+    (WebKit::WebProcessPool::userContentControllerIdentifierForServiceWorkers):
+    (WebKit::WebProcessPool::createWebPage):
+    * UIProcess/WebProcessPool.h:
+    
+    * UIProcess/WebProcessProxy.cpp:
+    (WebKit::WebProcessProxy::enableServiceWorkers):
+    * UIProcess/WebProcessProxy.h:
+    
+    * WebProcess/Storage/WebSWContextManagerConnection.cpp:
+    (WebKit::m_userContentController):
+    (WebKit::m_userAgent): Deleted.
+    * WebProcess/Storage/WebSWContextManagerConnection.h:
+    
+    * WebProcess/WebPage/WebPage.cpp:
+    (WebKit::m_limitsNavigationsToAppBoundDomains):
+    
+    Source/WebKitLegacy/mac:
+    
+    * WebView/WebView.mm:
+    (-[WebView _commonInitializationWithFrameName:groupName:]):
+    
+    Source/WebKitLegacy/win:
+    
+    * WebView.cpp:
+    (WebView::initWithFrame):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272550 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-08  Brady Eidson  <beid...@apple.com>
+
+            Make the UserContentController for ServiceWorker pages be non-optional.
+            <rdar://problem/71434565> and https://bugs.webkit.org/show_bug.cgi?id=221503
+
+            Reviewed by Alex Christensen.
+
+            Normal Pages always have a UserContentProvider, even if they just create an empty default one.
+
+            Same should be true for ServiceWorkers.
+
+            * Shared/ServiceWorkerInitializationData.cpp:
+            (WebKit::ServiceWorkerInitializationData::decode):
+            * Shared/ServiceWorkerInitializationData.h:
+
+            * UIProcess/WebProcessPool.cpp:
+            (WebKit::WebProcessPool::userContentControllerIdentifierForServiceWorkers):
+            (WebKit::WebProcessPool::createWebPage):
+            * UIProcess/WebProcessPool.h:
+
+            * UIProcess/WebProcessProxy.cpp:
+            (WebKit::WebProcessProxy::enableServiceWorkers):
+            * UIProcess/WebProcessProxy.h:
+
+            * WebProcess/Storage/WebSWContextManagerConnection.cpp:
+            (WebKit::m_userContentController):
+            (WebKit::m_userAgent): Deleted.
+            * WebProcess/Storage/WebSWContextManagerConnection.h:
+
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::m_limitsNavigationsToAppBoundDomains):
+
+2021-02-16  Ruben Turcios  <rubent...@apple.com>
+
         Cherry-pick r272506. rdar://problem/74409747
 
     Check that CGPDFDocumentRef is consistently unlocked and printable

Modified: branches/safari-611-branch/Source/WebKit/Shared/ServiceWorkerInitializationData.cpp (272953 => 272954)


--- branches/safari-611-branch/Source/WebKit/Shared/ServiceWorkerInitializationData.cpp	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKit/Shared/ServiceWorkerInitializationData.cpp	2021-02-17 01:17:44 UTC (rev 272954)
@@ -43,7 +43,7 @@
 
 Optional<ServiceWorkerInitializationData> ServiceWorkerInitializationData::decode(IPC::Decoder& decoder)
 {
-    Optional<Optional<UserContentControllerIdentifier>> userContentControllerIdentifier;
+    Optional<UserContentControllerIdentifier> userContentControllerIdentifier;
     decoder >> userContentControllerIdentifier;
     if (!userContentControllerIdentifier)
         return WTF::nullopt;

Modified: branches/safari-611-branch/Source/WebKit/Shared/ServiceWorkerInitializationData.h (272953 => 272954)


--- branches/safari-611-branch/Source/WebKit/Shared/ServiceWorkerInitializationData.h	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKit/Shared/ServiceWorkerInitializationData.h	2021-02-17 01:17:44 UTC (rev 272954)
@@ -42,7 +42,7 @@
     void encode(IPC::Encoder&) const;
     static Optional<ServiceWorkerInitializationData> decode(IPC::Decoder&);
 
-    Optional<UserContentControllerIdentifier> userContentControllerIdentifier;
+    UserContentControllerIdentifier userContentControllerIdentifier;
 #if ENABLE(CONTENT_EXTENSIONS)
     Vector<std::pair<String, WebCompiledContentRuleListData>> contentRuleLists;
 #endif

Modified: branches/safari-611-branch/Source/WebKit/UIProcess/WebProcessPool.cpp (272953 => 272954)


--- branches/safari-611-branch/Source/WebKit/UIProcess/WebProcessPool.cpp	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKit/UIProcess/WebProcessPool.cpp	2021-02-17 01:17:44 UTC (rev 272954)
@@ -1013,6 +1013,14 @@
     return createNewWebProcess(&websiteDataStore);
 }
 
+UserContentControllerIdentifier WebProcessPool::userContentControllerIdentifierForServiceWorkers()
+{
+    if (!m_userContentControllerForServiceWorker)
+        m_userContentControllerForServiceWorker = WebUserContentControllerProxy::create();
+
+    return m_userContentControllerForServiceWorker->identifier();
+}
+
 Ref<WebPageProxy> WebProcessPool::createWebPage(PageClient& pageClient, Ref<API::PageConfiguration>&& pageConfiguration)
 {
     if (!pageConfiguration->pageGroup())
@@ -1062,7 +1070,7 @@
             serviceWorkerProcess.updateServiceWorkerPreferencesStore(*m_serviceWorkerPreferences);
     }
     if (userContentController)
-        m_userContentControllerIDForServiceWorker = userContentController->identifier();
+        m_userContentControllerForServiceWorker = userContentController;
 #endif
 
     bool enableProcessSwapOnCrossSiteNavigation = page->preferences().processSwapOnCrossSiteNavigationEnabled();

Modified: branches/safari-611-branch/Source/WebKit/UIProcess/WebProcessPool.h (272953 => 272954)


--- branches/safari-611-branch/Source/WebKit/UIProcess/WebProcessPool.h	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKit/UIProcess/WebProcessPool.h	2021-02-17 01:17:44 UTC (rev 272954)
@@ -366,7 +366,7 @@
     void removeFromServiceWorkerProcesses(WebProcessProxy&);
     size_t serviceWorkerProxiesCount() const { return serviceWorkerProcesses().computeSize(); }
     void updateServiceWorkerUserAgent(const String& userAgent);
-    const Optional<UserContentControllerIdentifier>& userContentControllerIdentifierForServiceWorkers() const { return m_userContentControllerIDForServiceWorker; }
+    UserContentControllerIdentifier userContentControllerIdentifierForServiceWorkers();
     bool hasServiceWorkerForegroundActivityForTesting() const;
     bool hasServiceWorkerBackgroundActivityForTesting() const;
 #endif
@@ -585,7 +585,7 @@
     bool m_waitingForWorkerContextProcessConnection { false };
     String m_serviceWorkerUserAgent;
     Optional<WebPreferencesStore> m_serviceWorkerPreferences;
-    Optional<UserContentControllerIdentifier> m_userContentControllerIDForServiceWorker;
+    RefPtr<WebUserContentControllerProxy> m_userContentControllerForServiceWorker;
 #endif
 
 #if ENABLE(GPU_PROCESS)

Modified: branches/safari-611-branch/Source/WebKit/UIProcess/WebProcessProxy.cpp (272953 => 272954)


--- branches/safari-611-branch/Source/WebKit/UIProcess/WebProcessProxy.cpp	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKit/UIProcess/WebProcessProxy.cpp	2021-02-17 01:17:44 UTC (rev 272954)
@@ -1925,7 +1925,7 @@
 }
 #endif
 
-void WebProcessProxy::enableServiceWorkers(const Optional<UserContentControllerIdentifier>& userContentControllerIdentifier)
+void WebProcessProxy::enableServiceWorkers(const UserContentControllerIdentifier& userContentControllerIdentifier)
 {
     ASSERT(m_registrableDomain && !m_registrableDomain->isEmpty());
     ASSERT(!m_serviceWorkerInformation);

Modified: branches/safari-611-branch/Source/WebKit/UIProcess/WebProcessProxy.h (272953 => 272954)


--- branches/safari-611-branch/Source/WebKit/UIProcess/WebProcessProxy.h	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKit/UIProcess/WebProcessProxy.h	2021-02-17 01:17:44 UTC (rev 272954)
@@ -153,7 +153,7 @@
     void setIsInProcessCache(bool);
     bool isInProcessCache() const { return m_isInProcessCache; }
 
-    void enableServiceWorkers(const Optional<UserContentControllerIdentifier>&);
+    void enableServiceWorkers(const UserContentControllerIdentifier&);
     void disableServiceWorkers();
 
     WebsiteDataStore& websiteDataStore() const { ASSERT(m_websiteDataStore); return *m_websiteDataStore; }

Modified: branches/safari-611-branch/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp (272953 => 272954)


--- branches/safari-611-branch/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp	2021-02-17 01:17:44 UTC (rev 272954)
@@ -99,13 +99,11 @@
 #else
     , m_userAgent(standardUserAgent())
 #endif
+    , m_userContentController(WebUserContentController::getOrCreate(initializationData.userContentControllerIdentifier))
 {
-    if (initializationData.userContentControllerIdentifier) {
-        m_userContentController = WebUserContentController::getOrCreate(*initializationData.userContentControllerIdentifier);
 #if ENABLE(CONTENT_EXTENSIONS)
-        m_userContentController->addContentRuleLists(WTFMove(initializationData.contentRuleLists));
+    m_userContentController->addContentRuleLists(WTFMove(initializationData.contentRuleLists));
 #endif
-    }
 
     updatePreferencesStore(store);
     WebProcess::singleton().disableTermination();

Modified: branches/safari-611-branch/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h (272953 => 272954)


--- branches/safari-611-branch/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h	2021-02-17 01:17:44 UTC (rev 272954)
@@ -110,7 +110,7 @@
     uint64_t m_previousRequestIdentifier { 0 };
     String m_userAgent;
     bool m_isThrottleable { true };
-    RefPtr<WebUserContentController> m_userContentController;
+    Ref<WebUserContentController> m_userContentController;
 };
 
 class ServiceWorkerFrameLoaderClient final : public WebCore::EmptyFrameLoaderClient {

Modified: branches/safari-611-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp (272953 => 272954)


--- branches/safari-611-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2021-02-17 01:17:44 UTC (rev 272954)
@@ -507,6 +507,7 @@
         WebSocketProvider::create(),
         makeUniqueRef<WebKit::LibWebRTCProvider>(),
         WebProcess::singleton().cacheStorageProvider(),
+        m_userContentController,
         WebBackForwardListProxy::create(*this),
         WebProcess::singleton().cookieJar(),
         makeUniqueRef<WebProgressTrackerClient>(*this),
@@ -547,7 +548,6 @@
     pageConfiguration.databaseProvider = WebDatabaseProvider::getOrCreate(m_pageGroup->pageGroupID());
     pageConfiguration.pluginInfoProvider = &WebPluginInfoProvider::singleton();
     pageConfiguration.storageNamespaceProvider = WebStorageNamespaceProvider::getOrCreate(*m_pageGroup);
-    pageConfiguration.userContentProvider = m_userContentController.ptr();
     pageConfiguration.visitedLinkStore = VisitedLinkTableController::getOrCreate(parameters.visitedLinkTableID);
 
 #if ENABLE(APPLE_PAY)

Modified: branches/safari-611-branch/Source/WebKitLegacy/mac/ChangeLog (272953 => 272954)


--- branches/safari-611-branch/Source/WebKitLegacy/mac/ChangeLog	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKitLegacy/mac/ChangeLog	2021-02-17 01:17:44 UTC (rev 272954)
@@ -1,3 +1,73 @@
+2021-02-16  Ruben Turcios  <rubent...@apple.com>
+
+        Cherry-pick r272550. rdar://problem/74409264
+
+    Make the UserContentController for ServiceWorker pages be non-optional.
+    <rdar://problem/71434565> and https://bugs.webkit.org/show_bug.cgi?id=221503
+    
+    Reviewed by Alex Christensen.
+    Source/WebCore:
+    
+    * loader/EmptyClients.cpp:
+    (WebCore::pageConfigurationWithEmptyClients):
+    
+    * page/Page.cpp:
+    (WebCore::Page::Page):
+    
+    * page/PageConfiguration.cpp:
+    (WebCore::PageConfiguration::PageConfiguration):
+    * page/PageConfiguration.h:
+    
+    Source/WebKit:
+    
+    Normal Pages always have a UserContentProvider, even if they just create an empty default one.
+    
+    Same should be true for ServiceWorkers.
+    
+    * Shared/ServiceWorkerInitializationData.cpp:
+    (WebKit::ServiceWorkerInitializationData::decode):
+    * Shared/ServiceWorkerInitializationData.h:
+    
+    * UIProcess/WebProcessPool.cpp:
+    (WebKit::WebProcessPool::userContentControllerIdentifierForServiceWorkers):
+    (WebKit::WebProcessPool::createWebPage):
+    * UIProcess/WebProcessPool.h:
+    
+    * UIProcess/WebProcessProxy.cpp:
+    (WebKit::WebProcessProxy::enableServiceWorkers):
+    * UIProcess/WebProcessProxy.h:
+    
+    * WebProcess/Storage/WebSWContextManagerConnection.cpp:
+    (WebKit::m_userContentController):
+    (WebKit::m_userAgent): Deleted.
+    * WebProcess/Storage/WebSWContextManagerConnection.h:
+    
+    * WebProcess/WebPage/WebPage.cpp:
+    (WebKit::m_limitsNavigationsToAppBoundDomains):
+    
+    Source/WebKitLegacy/mac:
+    
+    * WebView/WebView.mm:
+    (-[WebView _commonInitializationWithFrameName:groupName:]):
+    
+    Source/WebKitLegacy/win:
+    
+    * WebView.cpp:
+    (WebView::initWithFrame):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272550 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-08  Brady Eidson  <beid...@apple.com>
+
+            Make the UserContentController for ServiceWorker pages be non-optional.
+            <rdar://problem/71434565> and https://bugs.webkit.org/show_bug.cgi?id=221503
+
+            Reviewed by Alex Christensen.
+
+            * WebView/WebView.mm:
+            (-[WebView _commonInitializationWithFrameName:groupName:]):
+
 2021-02-02  Alan Coon  <alanc...@apple.com>
 
         Cherry-pick r271926. rdar://problem/73889676

Modified: branches/safari-611-branch/Source/WebKitLegacy/mac/WebView/WebView.mm (272953 => 272954)


--- branches/safari-611-branch/Source/WebKitLegacy/mac/WebView/WebView.mm	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKitLegacy/mac/WebView/WebView.mm	2021-02-17 01:17:44 UTC (rev 272954)
@@ -1520,6 +1520,7 @@
         WebCore::SocketProvider::create(),
         WebCore::LibWebRTCProvider::create(),
         WebCore::CacheStorageProvider::create(),
+        _private->group->userContentController(),
         BackForwardList::create(self),
         WebCore::CookieJar::create(storageProvider.copyRef()),
         makeUniqueRef<WebProgressTrackerClient>(self),
@@ -1551,7 +1552,6 @@
     pageConfiguration.databaseProvider = &WebDatabaseProvider::singleton();
     pageConfiguration.pluginInfoProvider = &WebPluginInfoProvider::singleton();
     pageConfiguration.storageNamespaceProvider = &_private->group->storageNamespaceProvider();
-    pageConfiguration.userContentProvider = &_private->group->userContentController();
     pageConfiguration.visitedLinkStore = &_private->group->visitedLinkStore();
     _private->page = new WebCore::Page(WTFMove(pageConfiguration));
     storageProvider->setPage(*_private->page);
@@ -1796,6 +1796,7 @@
         WebCore::SocketProvider::create(),
         WebCore::LibWebRTCProvider::create(),
         WebCore::CacheStorageProvider::create(),
+        _private->group->userContentController(),
         BackForwardList::create(self),
         WebCore::CookieJar::create(storageProvider.copyRef()),
         makeUniqueRef<WebProgressTrackerClient>(self),
@@ -1816,7 +1817,6 @@
     pageConfiguration.applicationCacheStorage = &webApplicationCacheStorage();
     pageConfiguration.databaseProvider = &WebDatabaseProvider::singleton();
     pageConfiguration.storageNamespaceProvider = &_private->group->storageNamespaceProvider();
-    pageConfiguration.userContentProvider = &_private->group->userContentController();
     pageConfiguration.visitedLinkStore = &_private->group->visitedLinkStore();
     pageConfiguration.pluginInfoProvider = &WebPluginInfoProvider::singleton();
 

Modified: branches/safari-611-branch/Source/WebKitLegacy/win/ChangeLog (272953 => 272954)


--- branches/safari-611-branch/Source/WebKitLegacy/win/ChangeLog	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKitLegacy/win/ChangeLog	2021-02-17 01:17:44 UTC (rev 272954)
@@ -1,3 +1,73 @@
+2021-02-16  Ruben Turcios  <rubent...@apple.com>
+
+        Cherry-pick r272550. rdar://problem/74409264
+
+    Make the UserContentController for ServiceWorker pages be non-optional.
+    <rdar://problem/71434565> and https://bugs.webkit.org/show_bug.cgi?id=221503
+    
+    Reviewed by Alex Christensen.
+    Source/WebCore:
+    
+    * loader/EmptyClients.cpp:
+    (WebCore::pageConfigurationWithEmptyClients):
+    
+    * page/Page.cpp:
+    (WebCore::Page::Page):
+    
+    * page/PageConfiguration.cpp:
+    (WebCore::PageConfiguration::PageConfiguration):
+    * page/PageConfiguration.h:
+    
+    Source/WebKit:
+    
+    Normal Pages always have a UserContentProvider, even if they just create an empty default one.
+    
+    Same should be true for ServiceWorkers.
+    
+    * Shared/ServiceWorkerInitializationData.cpp:
+    (WebKit::ServiceWorkerInitializationData::decode):
+    * Shared/ServiceWorkerInitializationData.h:
+    
+    * UIProcess/WebProcessPool.cpp:
+    (WebKit::WebProcessPool::userContentControllerIdentifierForServiceWorkers):
+    (WebKit::WebProcessPool::createWebPage):
+    * UIProcess/WebProcessPool.h:
+    
+    * UIProcess/WebProcessProxy.cpp:
+    (WebKit::WebProcessProxy::enableServiceWorkers):
+    * UIProcess/WebProcessProxy.h:
+    
+    * WebProcess/Storage/WebSWContextManagerConnection.cpp:
+    (WebKit::m_userContentController):
+    (WebKit::m_userAgent): Deleted.
+    * WebProcess/Storage/WebSWContextManagerConnection.h:
+    
+    * WebProcess/WebPage/WebPage.cpp:
+    (WebKit::m_limitsNavigationsToAppBoundDomains):
+    
+    Source/WebKitLegacy/mac:
+    
+    * WebView/WebView.mm:
+    (-[WebView _commonInitializationWithFrameName:groupName:]):
+    
+    Source/WebKitLegacy/win:
+    
+    * WebView.cpp:
+    (WebView::initWithFrame):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272550 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-08  Brady Eidson  <beid...@apple.com>
+
+            Make the UserContentController for ServiceWorker pages be non-optional.
+            <rdar://problem/71434565> and https://bugs.webkit.org/show_bug.cgi?id=221503
+
+            Reviewed by Alex Christensen.
+
+            * WebView.cpp:
+            (WebView::initWithFrame):
+
 2021-01-02  Rob Buis  <rb...@igalia.com>
 
         Remove some FrameLoader::changeLocation parameters

Modified: branches/safari-611-branch/Source/WebKitLegacy/win/WebView.cpp (272953 => 272954)


--- branches/safari-611-branch/Source/WebKitLegacy/win/WebView.cpp	2021-02-17 01:17:18 UTC (rev 272953)
+++ branches/safari-611-branch/Source/WebKitLegacy/win/WebView.cpp	2021-02-17 01:17:44 UTC (rev 272954)
@@ -3128,6 +3128,7 @@
         SocketProvider::create(),
         makeUniqueRef<LibWebRTCProvider>(),
         CacheStorageProvider::create(),
+        m_webViewGroup->userContentController(),
         BackForwardList::create(),
         CookieJar::create(storageProvider.copyRef()),
         makeUniqueRef<WebProgressTrackerClient>(),
@@ -3142,7 +3143,6 @@
     configuration.applicationCacheStorage = &WebApplicationCache::storage();
     configuration.databaseProvider = &WebDatabaseProvider::singleton();
     configuration.storageNamespaceProvider = &m_webViewGroup->storageNamespaceProvider();
-    configuration.userContentProvider = &m_webViewGroup->userContentController();
     configuration.visitedLinkStore = &m_webViewGroup->visitedLinkStore();
     configuration.pluginInfoProvider = &WebPluginInfoProvider::singleton();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to