Title: [248566] branches/safari-608-branch/Source/WebKit
Revision
248566
Author
[email protected]
Date
2019-08-12 16:42:10 -0700 (Mon, 12 Aug 2019)

Log Message

Cherry-pick r248393. rdar://problem/54066682

    Regression(r247784) ResourceLoadStatisticsMemoryStore / ResourceLoadStatisticsPersistentStorage may get destroyed on the wrong thread
    https://bugs.webkit.org/show_bug.cgi?id=200517

    Reviewed by Geoffrey Garen.

    The issue is that WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore() is null checking
    m_persistentStorage and m_statisticsStore on the main thread, even though those members are initialized
    and destroyed on the background thread. As a result, if flushAndDestroyPersistentStore() is called *before*
    the background task to initialize those members has had a chance to run, then we'd return early without
    destroying those members. Later on, the background task would then initialize those data members and we
    would then destroy them on the main thread when the WebResourceLoadStatisticsStore is destroyed on the
    main thread.

    * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
    (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):

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

Modified Paths

Diff

Modified: branches/safari-608-branch/Source/WebKit/ChangeLog (248565 => 248566)


--- branches/safari-608-branch/Source/WebKit/ChangeLog	2019-08-12 23:42:07 UTC (rev 248565)
+++ branches/safari-608-branch/Source/WebKit/ChangeLog	2019-08-12 23:42:10 UTC (rev 248566)
@@ -1,5 +1,45 @@
 2019-08-12  Alan Coon  <[email protected]>
 
+        Cherry-pick r248393. rdar://problem/54066682
+
+    Regression(r247784) ResourceLoadStatisticsMemoryStore / ResourceLoadStatisticsPersistentStorage may get destroyed on the wrong thread
+    https://bugs.webkit.org/show_bug.cgi?id=200517
+    
+    Reviewed by Geoffrey Garen.
+    
+    The issue is that WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore() is null checking
+    m_persistentStorage and m_statisticsStore on the main thread, even though those members are initialized
+    and destroyed on the background thread. As a result, if flushAndDestroyPersistentStore() is called *before*
+    the background task to initialize those members has had a chance to run, then we'd return early without
+    destroying those members. Later on, the background task would then initialize those data members and we
+    would then destroy them on the main thread when the WebResourceLoadStatisticsStore is destroyed on the
+    main thread.
+    
+    * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
+    (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-08-07  Chris Dumez  <[email protected]>
+
+            Regression(r247784) ResourceLoadStatisticsMemoryStore / ResourceLoadStatisticsPersistentStorage may get destroyed on the wrong thread
+            https://bugs.webkit.org/show_bug.cgi?id=200517
+
+            Reviewed by Geoffrey Garen.
+
+            The issue is that WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore() is null checking
+            m_persistentStorage and m_statisticsStore on the main thread, even though those members are initialized
+            and destroyed on the background thread. As a result, if flushAndDestroyPersistentStore() is called *before*
+            the background task to initialize those members has had a chance to run, then we'd return early without
+            destroying those members. Later on, the background task would then initialize those data members and we
+            would then destroy them on the main thread when the WebResourceLoadStatisticsStore is destroyed on the
+            main thread.
+
+            * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
+            (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
+
+2019-08-12  Alan Coon  <[email protected]>
+
         Cherry-pick r248380. rdar://problem/54018115
 
     Context menu on a universal link produces a blank preview

Modified: branches/safari-608-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp (248565 => 248566)


--- branches/safari-608-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp	2019-08-12 23:42:07 UTC (rev 248565)
+++ branches/safari-608-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp	2019-08-12 23:42:10 UTC (rev 248566)
@@ -210,9 +210,6 @@
 {
     ASSERT(RunLoop::isMain());
 
-    if (!m_persistentStorage && !m_statisticsStore)
-        return;
-
     // Make sure we destroy the persistent store on the background queue and wait for it to die
     // synchronously since it has a C++ reference to us. Blocking nature of this task allows us
     // to not maintain a WebResourceLoadStatisticsStore reference for the duration of dispatch,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to