SWServer::removeClientServiceWorkerRegistration should not log an error if there...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Mar 2018 23:14:45 +0000 (23:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Mar 2018 23:14:45 +0000 (23:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183248

Patch by Youenn Fablet <youenn@apple.com> on 2018-03-01
Reviewed by Chris Dumez.

No change of behavior.
Removed the error logging.
As can be seen from running api and layout tests, a web process can ask a registration to be unregistered
and by the time it goes to the StorageProcess, the registration is already cleared.

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

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

Source/WebCore/ChangeLog
Source/WebCore/workers/service/server/SWServer.cpp

index 832031c..19046c4 100644 (file)
@@ -1,3 +1,18 @@
+2018-03-01  Youenn Fablet  <youenn@apple.com>
+
+        SWServer::removeClientServiceWorkerRegistration should not log an error if there is no registration
+        https://bugs.webkit.org/show_bug.cgi?id=183248
+
+        Reviewed by Chris Dumez.
+
+        No change of behavior.
+        Removed the error logging.
+        As can be seen from running api and layout tests, a web process can ask a registration to be unregistered
+        and by the time it goes to the StorageProcess, the registration is already cleared.
+
+        * workers/service/server/SWServer.cpp:
+        (WebCore::SWServer::removeClientServiceWorkerRegistration):
+
 2018-03-01  Daniel Bates  <dabates@apple.com>
 
         CSS ::selection stroke-color and stroke-width are not applied to selected text in text fields
index 0075f03..45436aa 100644 (file)
@@ -481,13 +481,8 @@ void SWServer::addClientServiceWorkerRegistration(Connection& connection, Servic
 
 void SWServer::removeClientServiceWorkerRegistration(Connection& connection, ServiceWorkerRegistrationIdentifier identifier)
 {
-    auto* registration = m_registrationsByID.get(identifier);
-    if (!registration) {
-        LOG_ERROR("Request to remove client-side ServiceWorkerRegistration from non-existent server-side registration");
-        return;
-    }
-    
-    registration->removeClientServiceWorkerRegistration(connection.identifier());
+    if (auto* registration = m_registrationsByID.get(identifier))
+        registration->removeClientServiceWorkerRegistration(connection.identifier());
 }
 
 void SWServer::updateWorker(Connection&, const ServiceWorkerJobDataIdentifier& jobDataIdentifier, SWServerRegistration& registration, const URL& url, const String& script, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, WorkerType type)