Title: [177118] trunk/Source/WebKit2
Revision
177118
Author
ander...@apple.com
Date
2014-12-10 17:18:14 -0800 (Wed, 10 Dec 2014)

Log Message

Switch WebKit2 over to using the storage namespace provider
https://bugs.webkit.org/show_bug.cgi?id=139509

Reviewed by Tim Horton.

* WebProcess/Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
(WebKit::StorageNamespaceImpl::~StorageNamespaceImpl):
(WebKit::localStorageNamespaceMap): Deleted.
Get rid of the storage namespace map - we have a map inside WebStorageNamespaceProvider now.

* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::createStorageStrategy):
(WebKit::WebPlatformStrategies::populatePluginCache): Deleted.
(WebKit::WebPlatformStrategies::localStorageNamespace): Deleted.
(WebKit::WebPlatformStrategies::transientLocalStorageNamespace): Deleted.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
Get rid of the storage strategy.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
Set a storage namespace provider.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (177117 => 177118)


--- trunk/Source/WebKit2/ChangeLog	2014-12-11 01:14:08 UTC (rev 177117)
+++ trunk/Source/WebKit2/ChangeLog	2014-12-11 01:18:14 UTC (rev 177118)
@@ -1,3 +1,28 @@
+2014-12-10  Anders Carlsson  <ander...@apple.com>
+
+        Switch WebKit2 over to using the storage namespace provider
+        https://bugs.webkit.org/show_bug.cgi?id=139509
+
+        Reviewed by Tim Horton.
+
+        * WebProcess/Storage/StorageNamespaceImpl.cpp:
+        (WebKit::StorageNamespaceImpl::createLocalStorageNamespace):
+        (WebKit::StorageNamespaceImpl::~StorageNamespaceImpl):
+        (WebKit::localStorageNamespaceMap): Deleted.
+        Get rid of the storage namespace map - we have a map inside WebStorageNamespaceProvider now.
+
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+        (WebKit::WebPlatformStrategies::createStorageStrategy):
+        (WebKit::WebPlatformStrategies::populatePluginCache): Deleted.
+        (WebKit::WebPlatformStrategies::localStorageNamespace): Deleted.
+        (WebKit::WebPlatformStrategies::transientLocalStorageNamespace): Deleted.
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
+        Get rid of the storage strategy.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        Set a storage namespace provider.
+
 2014-12-10  Beth Dakin  <bda...@apple.com>
 
          Follow-up build fix.

Modified: trunk/Source/WebKit2/WebProcess/Storage/StorageNamespaceImpl.cpp (177117 => 177118)


--- trunk/Source/WebKit2/WebProcess/Storage/StorageNamespaceImpl.cpp	2014-12-11 01:14:08 UTC (rev 177117)
+++ trunk/Source/WebKit2/WebProcess/Storage/StorageNamespaceImpl.cpp	2014-12-11 01:18:14 UTC (rev 177118)
@@ -41,14 +41,6 @@
 
 namespace WebKit {
 
-typedef HashMap<uint64_t, StorageNamespaceImpl*> LocalStorageNamespaceMap;
-
-static LocalStorageNamespaceMap& localStorageNamespaceMap()
-{
-    static NeverDestroyed<LocalStorageNamespaceMap> localStorageNamespaceMap;
-    return localStorageNamespaceMap;
-}
-
 RefPtr<StorageNamespaceImpl> StorageNamespaceImpl::createSessionStorageNamespace(uint64_t identifier, unsigned quotaInBytes)
 {
     return adoptRef(new StorageNamespaceImpl(SessionStorage, identifier, nullptr, quotaInBytes));
@@ -56,14 +48,7 @@
 
 RefPtr<StorageNamespaceImpl> StorageNamespaceImpl::createLocalStorageNamespace(uint64_t identifier, unsigned quotaInBytes)
 {
-    LocalStorageNamespaceMap::AddResult result = localStorageNamespaceMap().add(identifier, nullptr);
-    if (!result.isNewEntry)
-        return result.iterator->value;
-
-    RefPtr<StorageNamespaceImpl> localStorageNamespace = adoptRef(new StorageNamespaceImpl(LocalStorage, identifier, nullptr, quotaInBytes));
-
-    result.iterator->value = localStorageNamespace.get();
-    return localStorageNamespace.release();
+    return adoptRef(new StorageNamespaceImpl(LocalStorage, identifier, nullptr, quotaInBytes));
 }
 
 RefPtr<StorageNamespaceImpl> StorageNamespaceImpl::createTransientLocalStorageNamespace(uint64_t identifier, WebCore::SecurityOrigin& topLevelOrigin, uint64_t quotaInBytes)
@@ -94,10 +79,6 @@
 
 StorageNamespaceImpl::~StorageNamespaceImpl()
 {
-    if (m_storageType == LocalStorage) {
-        ASSERT(localStorageNamespaceMap().contains(m_storageNamespaceID));
-        localStorageNamespaceMap().remove(m_storageNamespaceID);
-    }
 }
 
 PassRefPtr<StorageArea> StorageNamespaceImpl::storageArea(PassRefPtr<SecurityOrigin> securityOrigin)

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp (177117 => 177118)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp	2014-12-11 01:14:08 UTC (rev 177117)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp	2014-12-11 01:18:14 UTC (rev 177118)
@@ -31,7 +31,6 @@
 #include "NetworkResourceLoadParameters.h"
 #include "PluginInfoStore.h"
 #include "SessionTracker.h"
-#include "StorageNamespaceImpl.h"
 #include "WebContextMessages.h"
 #include "WebCookieManager.h"
 #include "WebCoreArgumentCoders.h"
@@ -118,7 +117,8 @@
 
 StorageStrategy* WebPlatformStrategies::createStorageStrategy()
 {
-    return this;
+    ASSERT_NOT_REACHED();
+    return nullptr;
 }
 
 // CookiesStrategy
@@ -333,25 +333,6 @@
 }
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
 
-// StorageStrategy
-
-PassRefPtr<StorageNamespace> WebPlatformStrategies::localStorageNamespace(PageGroup* pageGroup)
-{
-    return StorageNamespaceImpl::createLocalStorageNamespace(pageGroup);
-}
-
-PassRefPtr<StorageNamespace> WebPlatformStrategies::transientLocalStorageNamespace(PageGroup* pageGroup, SecurityOrigin*securityOrigin)
-{
-    UNUSED_PARAM(securityOrigin);
-    // FIXME: This could be more clever and made to work across processes.
-    return StorageStrategy::sessionStorageNamespace(*pageGroup->pages().begin());
-}
-
-PassRefPtr<StorageNamespace> WebPlatformStrategies::sessionStorageNamespace(Page* page)
-{
-    return StorageNamespaceImpl::createSessionStorageNamespace(WebPage::fromCorePage(page));
-}
-
 #if PLATFORM(COCOA)
 // PasteboardStrategy
 

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h (177117 => 177118)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h	2014-12-11 01:14:08 UTC (rev 177117)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h	2014-12-11 01:18:14 UTC (rev 177118)
@@ -38,7 +38,7 @@
 
 namespace WebKit {
 
-class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PasteboardStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy, private WebCore::StorageStrategy {
+class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::DatabaseStrategy, private WebCore::LoaderStrategy, private WebCore::PasteboardStrategy, private WebCore::PluginStrategy, private WebCore::SharedWorkerStrategy {
     friend class NeverDestroyed<WebPlatformStrategies>;
 public:
     static void initialize();
@@ -85,11 +85,6 @@
     // WebCore::SharedWorkerStrategy
     virtual bool isAvailable() const override;
 
-    // WebCore::StorageStrategy.
-    virtual PassRefPtr<WebCore::StorageNamespace> localStorageNamespace(WebCore::PageGroup*) override;
-    virtual PassRefPtr<WebCore::StorageNamespace> transientLocalStorageNamespace(WebCore::PageGroup*, WebCore::SecurityOrigin*) override;
-    virtual PassRefPtr<WebCore::StorageNamespace> sessionStorageNamespace(WebCore::Page*) override;
-
     // WebCore::PasteboardStrategy
 #if PLATFORM(IOS)
     virtual void writeToPasteboard(const WebCore::PasteboardWebContent&) override;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (177117 => 177118)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-12-11 01:14:08 UTC (rev 177117)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-12-11 01:18:14 UTC (rev 177118)
@@ -98,6 +98,7 @@
 #include "WebProcess.h"
 #include "WebProcessProxyMessages.h"
 #include "WebProgressTrackerClient.h"
+#include "WebStorageNamespaceProvider.h"
 #include "WebUndoStep.h"
 #include "WebUserContentController.h"
 #include "WebUserMediaClient.h"
@@ -369,6 +370,7 @@
     pageConfiguration.progressTrackerClient = new WebProgressTrackerClient(*this);
     pageConfiguration.diagnosticLoggingClient = new WebDiagnosticLoggingClient(*this);
 
+    pageConfiguration.storageNamespaceProvider = WebStorageNamespaceProvider::getOrCreate(m_pageGroup->pageGroupID());
     pageConfiguration.userContentController = m_userContentController ? &m_userContentController->userContentController() : &m_pageGroup->userContentController();
     pageConfiguration.visitedLinkStore = VisitedLinkTableController::getOrCreate(parameters.visitedLinkTableID);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to