Title: [263541] branches/safari-610.1.18-branch/Source/WebCore
Revision
263541
Author
[email protected]
Date
2020-06-25 16:27:21 -0700 (Thu, 25 Jun 2020)

Log Message

Cherry-pick r263521. rdar://problem/64778782

    App-bound domain service worker registrations should be limited
    https://bugs.webkit.org/show_bug.cgi?id=213601
    <rdar://problem/64717589>

    Reviewed by Brent Fulgham.

    Limit number of service worker registrations for app-bound domains.
    The current proposal is 3, but this could be changed in the future.

    No new tests, currently TestWebKitAPI is unable to test failed
    service worker registration (test will timeout). Confirmed behavior
    manually.

    * workers/service/server/SWServer.cpp:
    (WebCore::SWServer::validateRegistrationDomain):

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

Modified Paths

Diff

Modified: branches/safari-610.1.18-branch/Source/WebCore/ChangeLog (263540 => 263541)


--- branches/safari-610.1.18-branch/Source/WebCore/ChangeLog	2020-06-25 23:22:42 UTC (rev 263540)
+++ branches/safari-610.1.18-branch/Source/WebCore/ChangeLog	2020-06-25 23:27:21 UTC (rev 263541)
@@ -1,3 +1,44 @@
+2020-06-25  Alan Coon  <[email protected]>
+
+        Cherry-pick r263521. rdar://problem/64778782
+
+    App-bound domain service worker registrations should be limited
+    https://bugs.webkit.org/show_bug.cgi?id=213601
+    <rdar://problem/64717589>
+    
+    Reviewed by Brent Fulgham.
+    
+    Limit number of service worker registrations for app-bound domains.
+    The current proposal is 3, but this could be changed in the future.
+    
+    No new tests, currently TestWebKitAPI is unable to test failed
+    service worker registration (test will timeout). Confirmed behavior
+    manually.
+    
+    * workers/service/server/SWServer.cpp:
+    (WebCore::SWServer::validateRegistrationDomain):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-06-25  Kate Cheney  <[email protected]>
+
+            App-bound domain service worker registrations should be limited
+            https://bugs.webkit.org/show_bug.cgi?id=213601
+            <rdar://problem/64717589>
+
+            Reviewed by Brent Fulgham.
+
+            Limit number of service worker registrations for app-bound domains.
+            The current proposal is 3, but this could be changed in the future.
+
+            No new tests, currently TestWebKitAPI is unable to test failed
+            service worker registration (test will timeout). Confirmed behavior
+            manually.
+
+            * workers/service/server/SWServer.cpp:
+            (WebCore::SWServer::validateRegistrationDomain):
+
 2020-06-10  Sergio Villar Senin  <[email protected]>
 
         [WebXR] Add a preliminary implementation of XRWebGLLayer

Modified: branches/safari-610.1.18-branch/Source/WebCore/workers/service/server/SWServer.cpp (263540 => 263541)


--- branches/safari-610.1.18-branch/Source/WebCore/workers/service/server/SWServer.cpp	2020-06-25 23:22:42 UTC (rev 263540)
+++ branches/safari-610.1.18-branch/Source/WebCore/workers/service/server/SWServer.cpp	2020-06-25 23:27:21 UTC (rev 263541)
@@ -49,6 +49,8 @@
 
 namespace WebCore {
 
+static const unsigned maxRegistrationCount = 3;
+
 SWServer::Connection::Connection(SWServer& server, Identifier identifier)
     : m_server(server)
     , m_identifier(identifier)
@@ -333,7 +335,7 @@
 void SWServer::validateRegistrationDomain(WebCore::RegistrableDomain domain, CompletionHandler<void(bool)>&& completionHandler)
 {
     if (m_hasServiceWorkerEntitlement || m_hasReceivedAppBoundDomains) {
-        completionHandler(m_appBoundDomains.contains(domain));
+        completionHandler(m_appBoundDomains.contains(domain) && m_scopeToRegistrationMap.keys().size() < maxRegistrationCount);
         return;
     }
     
@@ -342,7 +344,7 @@
             return;
         m_hasReceivedAppBoundDomains = true;
         m_appBoundDomains = WTFMove(appBoundDomains);
-        completionHandler(m_appBoundDomains.contains(domain));
+        completionHandler(m_appBoundDomains.contains(domain) && m_scopeToRegistrationMap.keys().size() < maxRegistrationCount);
     });
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to