Title: [248393] trunk/Source/WebKit
Revision
248393
Author
[email protected]
Date
2019-08-07 15:29:18 -0700 (Wed, 07 Aug 2019)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (248392 => 248393)


--- trunk/Source/WebKit/ChangeLog	2019-08-07 21:51:16 UTC (rev 248392)
+++ trunk/Source/WebKit/ChangeLog	2019-08-07 22:29:18 UTC (rev 248393)
@@ -1,3 +1,21 @@
+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-06  Dean Jackson  <[email protected]>
 
         Context menu on a universal link produces a blank preview

Modified: trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp (248392 => 248393)


--- trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp	2019-08-07 21:51:16 UTC (rev 248392)
+++ trunk/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp	2019-08-07 22:29:18 UTC (rev 248393)
@@ -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