Get rid of some PageGroup storage functions
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Dec 2014 21:26:14 +0000 (21:26 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 29 Dec 2014 21:26:14 +0000 (21:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=139996

Reviewed by Sam Weinig.

Source/WebCore:

* WebCore.exp.in:
* page/PageGroup.cpp:
(WebCore::PageGroup::closeLocalStorage): Deleted.
(WebCore::PageGroup::clearLocalStorageForAllOrigins): Deleted.
(WebCore::PageGroup::clearLocalStorageForOrigin): Deleted.
(WebCore::PageGroup::closeIdleLocalStorageDatabases): Deleted.
(WebCore::PageGroup::syncLocalStorage): Deleted.
* page/PageGroup.h:

Source/WebKit:

Call WebStorageNamespaceProvider directly instead.

* Storage/StorageTracker.cpp:
(WebCore::StorageTracker::deleteAllOrigins):
(WebCore::StorageTracker::deleteOrigin):

Source/WebKit/mac:

Call WebStorageNamespaceProvider directly instead.

* Storage/WebStorageManager.mm:
(-[WebStorageManager syncLocalStorage]):
(+[WebStorageManager closeIdleLocalStorageDatabases]):
* WebView/WebView.mm:
(+[WebView _applicationWillTerminate]):

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

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/PageGroup.cpp
Source/WebCore/page/PageGroup.h
Source/WebKit/ChangeLog
Source/WebKit/Storage/StorageTracker.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Storage/WebStorageManager.mm
Source/WebKit/mac/WebView/WebView.mm

index 74b6b538377acd605df6af07a532277e65e76ef8..0664ec90d50ae5adaf3cf4847e21327469de4ebc 100644 (file)
@@ -1,3 +1,19 @@
+2014-12-29  Anders Carlsson  <andersca@apple.com>
+
+        Get rid of some PageGroup storage functions
+        https://bugs.webkit.org/show_bug.cgi?id=139996
+
+        Reviewed by Sam Weinig.
+
+        * WebCore.exp.in:
+        * page/PageGroup.cpp:
+        (WebCore::PageGroup::closeLocalStorage): Deleted.
+        (WebCore::PageGroup::clearLocalStorageForAllOrigins): Deleted.
+        (WebCore::PageGroup::clearLocalStorageForOrigin): Deleted.
+        (WebCore::PageGroup::closeIdleLocalStorageDatabases): Deleted.
+        (WebCore::PageGroup::syncLocalStorage): Deleted.
+        * page/PageGroup.h:
+
 2014-12-29  Anders Carlsson  <andersca@apple.com>
 
         Move storage code from WebCore to WebKit
index 88ee1255940f932de681ce8b505bbc39af0af6e2..a79d1b947e8a00a6668ca49cc1f5c953e0dad18b 100644 (file)
@@ -1558,11 +1558,6 @@ __ZN7WebCore9PageCache11setCapacityEi
 __ZN7WebCore9PageCache18pruneToCapacityNowEiNS_13PruningReasonE
 __ZN7WebCore9PageCache33markPagesForVistedLinkStyleRecalcEv
 __ZN7WebCore9PageCache6removeEPNS_11HistoryItemE
-__ZN7WebCore9PageGroup16syncLocalStorageEv
-__ZN7WebCore9PageGroup17closeLocalStorageEv
-__ZN7WebCore9PageGroup26clearLocalStorageForOriginEPNS_14SecurityOriginE
-__ZN7WebCore9PageGroup30clearLocalStorageForAllOriginsEv
-__ZN7WebCore9PageGroup30closeIdleLocalStorageDatabasesEv
 __ZN7WebCore9PageGroup9pageGroupERKN3WTF6StringE
 __ZN7WebCore9Scrollbar11mouseExitedEv
 __ZN7WebCore9Scrollbar12mouseEnteredEv
index 086b40e652d02a230a0b1f95ea21d3e3f161a721..fc919eda44121b440dddecb9ef1f7d50fe161dd8 100644 (file)
@@ -97,61 +97,6 @@ PageGroup* PageGroup::pageGroup(const String& groupName)
     return result.iterator->value;
 }
 
-void PageGroup::closeLocalStorage()
-{
-    if (!pageGroups)
-        return;
-
-    for (auto it = pageGroups->begin(), end = pageGroups->end(); it != end; ++it) {
-        if (it->value->hasLocalStorage())
-            it->value->localStorage()->close();
-    }
-}
-
-void PageGroup::clearLocalStorageForAllOrigins()
-{
-    if (!pageGroups)
-        return;
-
-    for (auto it = pageGroups->begin(), end = pageGroups->end(); it != end; ++it) {
-        if (it->value->hasLocalStorage())
-            it->value->localStorage()->clearAllOriginsForDeletion();
-    }
-}
-
-void PageGroup::clearLocalStorageForOrigin(SecurityOrigin* origin)
-{
-    if (!pageGroups)
-        return;
-
-    for (auto it = pageGroups->begin(), end = pageGroups->end(); it != end; ++it) {
-        if (it->value->hasLocalStorage())
-            it->value->localStorage()->clearOriginForDeletion(origin);
-    }
-}
-
-void PageGroup::closeIdleLocalStorageDatabases()
-{
-    if (!pageGroups)
-        return;
-
-    for (auto it = pageGroups->begin(), end = pageGroups->end(); it != end; ++it) {
-        if (it->value->hasLocalStorage())
-            it->value->localStorage()->closeIdleLocalStorageDatabases();
-    }
-}
-
-void PageGroup::syncLocalStorage()
-{
-    if (!pageGroups)
-        return;
-
-    for (auto it = pageGroups->begin(), end = pageGroups->end(); it != end; ++it) {
-        if (it->value->hasLocalStorage())
-            it->value->localStorage()->sync();
-    }
-}
-
 void PageGroup::addPage(Page& page)
 {
     ASSERT(!m_pages.contains(&page));
index 3f6223b8d35a493ef791852abe5c1a3c877afbc0..cde93b6f05cb5731ed0991c0f029b01eeb7040df 100644 (file)
@@ -56,14 +56,6 @@ namespace WebCore {
 
         WEBCORE_EXPORT static PageGroup* pageGroup(const String& groupName);
 
-        WEBCORE_EXPORT static void closeLocalStorage();
-
-        static void clearLocalStorageForAllOrigins();
-        static void clearLocalStorageForOrigin(SecurityOrigin*);
-        WEBCORE_EXPORT static void closeIdleLocalStorageDatabases();
-        // DumpRenderTree helper that triggers a StorageArea sync.
-        WEBCORE_EXPORT static void syncLocalStorage();
-
         const HashSet<Page*>& pages() const { return m_pages; }
 
         void addPage(Page&);
index 60e466c31c51c0257dc8305409b12659c8920fc0..399f3741507fc6e84560fd565eb50c0c2d1058a7 100644 (file)
@@ -1,3 +1,16 @@
+2014-12-29  Anders Carlsson  <andersca@apple.com>
+
+        Get rid of some PageGroup storage functions
+        https://bugs.webkit.org/show_bug.cgi?id=139996
+
+        Reviewed by Sam Weinig.
+
+        Call WebStorageNamespaceProvider directly instead.
+
+        * Storage/StorageTracker.cpp:
+        (WebCore::StorageTracker::deleteAllOrigins):
+        (WebCore::StorageTracker::deleteOrigin):
+
 2014-12-29  Anders Carlsson  <andersca@apple.com>
 
         Move storage code from WebCore to WebKit
index 2583d174b73b0a73d39dd3ee4180c9976df41a5d..3c4e613a41d1ede3277d6e9ddc7907a2dc21e0ff 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "StorageThread.h"
 #include "StorageTrackerClient.h"
+#include "WebStorageNamespaceProvider.h"
 #include <WebCore/FileSystem.h>
 #include <WebCore/PageGroup.h>
 #include <WebCore/SQLiteDatabaseTracker.h>
@@ -396,7 +397,7 @@ void StorageTracker::deleteAllOrigins()
         m_originSet.clear();
     }
 
-    PageGroup::clearLocalStorageForAllOrigins();
+    WebStorageNamespaceProvider::clearLocalStorageForAllOrigins();
 
     m_thread->dispatch([this] {
         syncDeleteAllOrigins();
@@ -493,7 +494,7 @@ void StorageTracker::deleteOrigin(SecurityOrigin* origin)
     // to reopen the db before the db is deleted by a StorageTracker thread.
     // In this case, reopening the db in StorageAreaSync will cancel a pending
     // StorageTracker db deletion.
-    PageGroup::clearLocalStorageForOrigin(origin);
+    WebStorageNamespaceProvider::clearLocalStorageForOrigin(origin);
 
     String originId = origin->databaseIdentifier();
     
index 207753e5f356f202c044d3ea7c75a42b70d45d9a..8015c3dc1c8079f05189e5c1233fca363dc2becc 100644 (file)
@@ -1,3 +1,18 @@
+2014-12-29  Anders Carlsson  <andersca@apple.com>
+
+        Get rid of some PageGroup storage functions
+        https://bugs.webkit.org/show_bug.cgi?id=139996
+
+        Reviewed by Sam Weinig.
+
+        Call WebStorageNamespaceProvider directly instead.
+
+        * Storage/WebStorageManager.mm:
+        (-[WebStorageManager syncLocalStorage]):
+        (+[WebStorageManager closeIdleLocalStorageDatabases]):
+        * WebView/WebView.mm:
+        (+[WebView _applicationWillTerminate]):
+
 2014-12-29  Anders Carlsson  <andersca@apple.com>
 
         Move storage code from WebCore to WebKit
index af92d76b87498bf465281d4b6a05a77cb488f5ab..fb40e549b957aa48d08155b7d43850815ee7e8ba 100644 (file)
@@ -27,6 +27,7 @@
 
 #import "StorageTracker.h"
 #import "WebSecurityOriginInternal.h"
+#import "WebStorageNamespaceProvider.h"
 #import "WebStorageTrackerClient.h"
 #import <WebCore/PageGroup.h>
 #import <WebCore/SecurityOrigin.h>
@@ -100,7 +101,7 @@ static pthread_once_t registerLocalStoragePath = PTHREAD_ONCE_INIT;
 
 - (void)syncLocalStorage
 {
-    PageGroup::syncLocalStorage();
+    WebStorageNamespaceProvider::syncLocalStorage();
 }
 
 - (void)syncFileSystemAndTrackerDatabase
@@ -121,7 +122,7 @@ static pthread_once_t registerLocalStoragePath = PTHREAD_ONCE_INIT;
 
 + (void)closeIdleLocalStorageDatabases
 {
-    PageGroup::closeIdleLocalStorageDatabases();
+    WebStorageNamespaceProvider::closeIdleLocalStorageDatabases();
 }
 
 static void initializeLocalStoragePath()
index ca829f09c92a992865fefaff222e79633e4a4b91..2c42bedbbc7b47c3b0a02edf7b6ec8c92a632cd0 100644 (file)
@@ -4803,7 +4803,6 @@ static Vector<String> toStringVector(NSArray* patterns)
         [WebPluginDatabase closeSharedDatabase];
 
     WebStorageNamespaceProvider::closeLocalStorage();
-    PageGroup::closeLocalStorage();
 }
 #endif // !PLATFORM(IOS)