Title: [263521] trunk/Source/WebCore
- Revision
- 263521
- Author
- [email protected]
- Date
- 2020-06-25 11:16:22 -0700 (Thu, 25 Jun 2020)
Log Message
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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (263520 => 263521)
--- trunk/Source/WebCore/ChangeLog 2020-06-25 18:01:17 UTC (rev 263520)
+++ trunk/Source/WebCore/ChangeLog 2020-06-25 18:16:22 UTC (rev 263521)
@@ -1,3 +1,21 @@
+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-25 Wenson Hsieh <[email protected]>
Upstream macOS 11 additions to RenderThemeMac.mm and ThemeMac.mm
Modified: trunk/Source/WebCore/workers/service/server/SWServer.cpp (263520 => 263521)
--- trunk/Source/WebCore/workers/service/server/SWServer.cpp 2020-06-25 18:01:17 UTC (rev 263520)
+++ trunk/Source/WebCore/workers/service/server/SWServer.cpp 2020-06-25 18:16:22 UTC (rev 263521)
@@ -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