Title: [251863] tags/Safari-609.1.9/Source/WebKit
Revision
251863
Author
[email protected]
Date
2019-10-31 11:02:19 -0700 (Thu, 31 Oct 2019)

Log Message

Cherry-pick r251823. rdar://problem/56762071

    REGRESSION(r251568) If we didn't start a Service Worker, don't try talking to it
    https://bugs.webkit.org/show_bug.cgi?id=203639
    <rdar://problem/56762071>

    Reviewed by Chris Dumez.

    Similar to the fix that introduced this regression, if the UI process does
    not have the entitlement to start a service worker, we should not try
    to load with one.

    * NetworkProcess/NetworkConnectionToWebProcess.cpp:
    (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): If the
    parent process doesn't have a service worker, use the regular load path.

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

Modified Paths

Diff

Modified: tags/Safari-609.1.9/Source/WebKit/ChangeLog (251862 => 251863)


--- tags/Safari-609.1.9/Source/WebKit/ChangeLog	2019-10-31 17:54:01 UTC (rev 251862)
+++ tags/Safari-609.1.9/Source/WebKit/ChangeLog	2019-10-31 18:02:19 UTC (rev 251863)
@@ -1,3 +1,39 @@
+2019-10-31  Kocsen Chung  <[email protected]>
+
+        Cherry-pick r251823. rdar://problem/56762071
+
+    REGRESSION(r251568) If we didn't start a Service Worker, don't try talking to it
+    https://bugs.webkit.org/show_bug.cgi?id=203639
+    <rdar://problem/56762071>
+    
+    Reviewed by Chris Dumez.
+    
+    Similar to the fix that introduced this regression, if the UI process does
+    not have the entitlement to start a service worker, we should not try
+    to load with one.
+    
+    * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+    (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): If the
+    parent process doesn't have a service worker, use the regular load path.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-10-30  Dean Jackson  <[email protected]>
+
+            REGRESSION(r251568) If we didn't start a Service Worker, don't try talking to it
+            https://bugs.webkit.org/show_bug.cgi?id=203639
+            <rdar://problem/56762071>
+
+            Reviewed by Chris Dumez.
+
+            Similar to the fix that introduced this regression, if the UI process does
+            not have the entitlement to start a service worker, we should not try
+            to load with one.
+
+            * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+            (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad): If the
+            parent process doesn't have a service worker, use the regular load path.
+
 2019-10-30  Alan Coon  <[email protected]>
 
         Cherry-pick r251732. rdar://problem/56696055

Modified: tags/Safari-609.1.9/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (251862 => 251863)


--- tags/Safari-609.1.9/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-10-31 17:54:01 UTC (rev 251862)
+++ tags/Safari-609.1.9/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2019-10-31 18:02:19 UTC (rev 251863)
@@ -409,15 +409,18 @@
 void NetworkConnectionToWebProcess::scheduleResourceLoad(NetworkResourceLoadParameters&& loadParameters)
 {
 #if ENABLE(SERVICE_WORKER)
-    auto& server = m_networkProcess->swServerForSession(m_sessionID);
-    if (!server.isImportCompleted()) {
-        server.whenImportIsCompleted([this, protectedThis = makeRef(*this), loadParameters = WTFMove(loadParameters)]() mutable {
-            if (!m_networkProcess->webProcessConnection(webProcessIdentifier()))
-                return;
-            ASSERT(m_networkProcess->swServerForSession(m_sessionID).isImportCompleted());
-            scheduleResourceLoad(WTFMove(loadParameters));
-        });
-        return;
+    bool serviceWorkerAllowed = m_networkProcess->parentProcessHasServiceWorkerEntitlement();
+    if (serviceWorkerAllowed) {
+        auto& server = m_networkProcess->swServerForSession(m_sessionID);
+        if (!server.isImportCompleted()) {
+            server.whenImportIsCompleted([this, protectedThis = makeRef(*this), loadParameters = WTFMove(loadParameters)]() mutable {
+                if (!m_networkProcess->webProcessConnection(webProcessIdentifier()))
+                    return;
+                ASSERT(m_networkProcess->swServerForSession(m_sessionID).isImportCompleted());
+                scheduleResourceLoad(WTFMove(loadParameters));
+            });
+            return;
+        }
     }
 #endif
     auto identifier = loadParameters.identifier;
@@ -428,10 +431,12 @@
     auto& loader = m_networkResourceLoaders.add(identifier, NetworkResourceLoader::create(WTFMove(loadParameters), *this)).iterator->value;
 
 #if ENABLE(SERVICE_WORKER)
-    loader->startWithServiceWorker();
-#else
+    if (serviceWorkerAllowed) {
+        loader->startWithServiceWorker();
+        return;
+    } else
+#endif
     loader->start();
-#endif
 }
 
 void NetworkConnectionToWebProcess::performSynchronousLoad(NetworkResourceLoadParameters&& loadParameters, Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&& reply)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to