Title: [227399] branches/safari-605-branch/Source/WebCore
Revision
227399
Author
[email protected]
Date
2018-01-22 22:42:38 -0800 (Mon, 22 Jan 2018)

Log Message

Cherry-pick r227353. rdar://problem/36763011

Modified Paths

Diff

Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (227398 => 227399)


--- branches/safari-605-branch/Source/WebCore/ChangeLog	2018-01-23 06:42:36 UTC (rev 227398)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog	2018-01-23 06:42:38 UTC (rev 227399)
@@ -1,5 +1,26 @@
 2018-01-22  Jason Marcell  <[email protected]>
 
+        Cherry-pick r227353. rdar://problem/36763011
+
+    2018-01-22  Chris Dumez  <[email protected]>
+
+            RELEASE_ASSERT(registration) hit in SWServer::installContextData(const ServiceWorkerContextData&)
+            https://bugs.webkit.org/show_bug.cgi?id=181941
+            <rdar://problem/36744892>
+
+            Reviewed by Youenn Fablet.
+
+            Make sure we clear SWServer::m_pendingContextDatas & SWServer::m_pendingJobs as needed
+            when clearing Website data. Otherwise, we will hit assertion when those gets processed
+            after the connection to the SW process has been established (not to mentioned we failed
+            to clear some in-memory data even though the user asked us to).
+
+            * workers/service/server/SWServer.cpp:
+            (WebCore::SWServer::clearAll):
+            (WebCore::SWServer::clear):
+
+2018-01-22  Jason Marcell  <[email protected]>
+
         Cherry-pick r227277. rdar://problem/36763214
 
     2018-01-21  Andy Estes  <[email protected]>

Modified: branches/safari-605-branch/Source/WebCore/workers/service/server/SWServer.cpp (227398 => 227399)


--- branches/safari-605-branch/Source/WebCore/workers/service/server/SWServer.cpp	2018-01-23 06:42:36 UTC (rev 227398)
+++ branches/safari-605-branch/Source/WebCore/workers/service/server/SWServer.cpp	2018-01-23 06:42:38 UTC (rev 227399)
@@ -186,6 +186,8 @@
     while (!m_registrations.isEmpty())
         m_registrations.begin()->value->clear();
     ASSERT(m_registrationsByID.isEmpty());
+    m_pendingContextDatas.clear();
+    m_pendingJobs.clear();
     m_originStore->clearAll();
     m_registrationStore.clearAll(WTFMove(completionHandler));
 }
@@ -202,6 +204,14 @@
             registrationsToRemove.append(keyAndValue.value.get());
     }
 
+    m_pendingContextDatas.removeAllMatching([&](auto& contextData) {
+        return contextData.registration.key.relatesToOrigin(origin);
+    });
+
+    m_pendingJobs.removeAllMatching([&](auto& job) {
+        return job.registrationKey().relatesToOrigin(origin);
+    });
+
     // Calling SWServerRegistration::clear() takes care of updating m_registrations, m_originStore and m_registrationStore.
     for (auto* registration : registrationsToRemove)
         registration->clear();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to