Title: [212726] trunk/Source/WebKit2
Revision
212726
Author
[email protected]
Date
2017-02-21 10:36:00 -0800 (Tue, 21 Feb 2017)

Log Message

Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
https://bugs.webkit.org/show_bug.cgi?id=168659
rdar://problem/22781730

Patch by Maureen Daum <[email protected]> on 2017-02-21
Reviewed by Brady Eidson.

Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
It is possible that another process has caused information to be added to LocalStorage
after we created this LocalStorageDatabaseTracker instance, so we should update our
internal state by checking the contents of StorageTracker.db and the other local
storage files so we know what databases actually exist. By calling importOriginIdentifiers()
at the start of deleteDatabasesModifiedSince(), m_origins will now have the up-to-date
list of origins LocalStorage contains data for.

* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (212725 => 212726)


--- trunk/Source/WebKit2/ChangeLog	2017-02-21 18:28:47 UTC (rev 212725)
+++ trunk/Source/WebKit2/ChangeLog	2017-02-21 18:36:00 UTC (rev 212726)
@@ -1,3 +1,22 @@
+2017-02-21  Maureen Daum  <[email protected]>
+
+        Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
+        https://bugs.webkit.org/show_bug.cgi?id=168659
+        rdar://problem/22781730
+
+        Reviewed by Brady Eidson.
+
+        Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
+        It is possible that another process has caused information to be added to LocalStorage
+        after we created this LocalStorageDatabaseTracker instance, so we should update our
+        internal state by checking the contents of StorageTracker.db and the other local
+        storage files so we know what databases actually exist. By calling importOriginIdentifiers()
+        at the start of deleteDatabasesModifiedSince(), m_origins will now have the up-to-date
+        list of origins LocalStorage contains data for.
+
+        * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
+        (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
+
 2017-02-21  Carlos Garcia Campos  <[email protected]>
 
         Reduce platform ifdefs in WebKit2 custom protocols implementation

Modified: trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp (212725 => 212726)


--- trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp	2017-02-21 18:28:47 UTC (rev 212725)
+++ trunk/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp	2017-02-21 18:36:00 UTC (rev 212726)
@@ -32,6 +32,7 @@
 #include <WebCore/SecurityOrigin.h>
 #include <WebCore/SecurityOriginData.h>
 #include <WebCore/TextEncoding.h>
+#include <wtf/MainThread.h>
 #include <wtf/WorkQueue.h>
 #include <wtf/text/CString.h>
 
@@ -142,6 +143,8 @@
 
 Vector<SecurityOriginData> LocalStorageDatabaseTracker::deleteDatabasesModifiedSince(std::chrono::system_clock::time_point time)
 {
+    ASSERT(!isMainThread());
+    importOriginIdentifiers();
     Vector<String> originIdentifiersToDelete;
 
     for (const String& origin : m_origins) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to