WebStorageNamespaceProvider should know about its local storage database path
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Dec 2014 22:39:27 +0000 (22:39 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Dec 2014 22:39:27 +0000 (22:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=139413

Reviewed by Andreas Kling.

Source/WebKit:

* Storage/WebStorageNamespaceProvider.cpp:
(WebStorageNamespaceProvider::create):
(WebStorageNamespaceProvider::WebStorageNamespaceProvider):
* Storage/WebStorageNamespaceProvider.h:

Source/WebKit/mac:

* WebCoreSupport/WebViewGroup.h:
* WebCoreSupport/WebViewGroup.mm:
(WebViewGroup::getOrCreate):
(WebViewGroup::WebViewGroup):
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
(-[WebView setGroupName:]):
(-[WebView groupName]): Deleted.

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

Source/WebKit/ChangeLog
Source/WebKit/Storage/WebStorageNamespaceProvider.cpp
Source/WebKit/Storage/WebStorageNamespaceProvider.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebViewGroup.h
Source/WebKit/mac/WebCoreSupport/WebViewGroup.mm
Source/WebKit/mac/WebView/WebView.mm

index 4020114..ab0627a 100644 (file)
@@ -1,3 +1,15 @@
+2014-12-08  Anders Carlsson  <andersca@apple.com>
+
+        WebStorageNamespaceProvider should know about its local storage database path
+        https://bugs.webkit.org/show_bug.cgi?id=139413
+
+        Reviewed by Andreas Kling.
+
+        * Storage/WebStorageNamespaceProvider.cpp:
+        (WebStorageNamespaceProvider::create):
+        (WebStorageNamespaceProvider::WebStorageNamespaceProvider):
+        * Storage/WebStorageNamespaceProvider.h:
+
 2014-12-06  Anders Carlsson  <andersca@apple.com>
 
         Add a stubbed out version of WebStorageNamespaceProvider
index 3a1e66f..93cf902 100644 (file)
 
 using namespace WebCore;
 
-RefPtr<WebStorageNamespaceProvider> WebStorageNamespaceProvider::create()
+RefPtr<WebStorageNamespaceProvider> WebStorageNamespaceProvider::create(const String& localStorageDatabasePath)
 {
-    return adoptRef(new WebStorageNamespaceProvider);
+    return adoptRef(new WebStorageNamespaceProvider(localStorageDatabasePath));
 }
 
-WebStorageNamespaceProvider::WebStorageNamespaceProvider()
+WebStorageNamespaceProvider::WebStorageNamespaceProvider(const String& localStorageDatabasePath)
+    : m_localStorageDatabasePath(localStorageDatabasePath)
 {
 }
 
index 7e70eea..c7fd264 100644 (file)
 
 class WebStorageNamespaceProvider final : public WebCore::StorageNamespaceProvider {
 public:
-    static RefPtr<WebStorageNamespaceProvider> create();
+    static RefPtr<WebStorageNamespaceProvider> create(const String& localStorageDatabasePath);
     virtual ~WebStorageNamespaceProvider();
 
 private:
-    WebStorageNamespaceProvider();
+    explicit WebStorageNamespaceProvider(const String& localStorageDatabasePath);
 
     virtual RefPtr<WebCore::StorageNamespace> createSessionStorageNamespace(WebCore::Page&) override;
     virtual RefPtr<WebCore::StorageNamespace> createLocalStorageNamespace() override;
     virtual RefPtr<WebCore::StorageNamespace> createTransientLocalStorageNamespace(WebCore::SecurityOrigin&) override;
+
+    const String m_localStorageDatabasePath;
 };
 
 #endif // WebStorageNamespaceProvider_h
index bd48004..7c88f6b 100644 (file)
@@ -1,3 +1,20 @@
+2014-12-08  Anders Carlsson  <andersca@apple.com>
+
+        WebStorageNamespaceProvider should know about its local storage database path
+        https://bugs.webkit.org/show_bug.cgi?id=139413
+
+        Reviewed by Andreas Kling.
+
+        * WebCoreSupport/WebViewGroup.h:
+        * WebCoreSupport/WebViewGroup.mm:
+        (WebViewGroup::getOrCreate):
+        (WebViewGroup::WebViewGroup):
+        * WebView/WebView.mm:
+        (-[WebView _commonInitializationWithFrameName:groupName:]):
+        (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
+        (-[WebView setGroupName:]):
+        (-[WebView groupName]): Deleted.
+
 2014-12-08  Daniel Bates  <dabates@apple.com>
 
         [iOS] Fix the WebKit build with the public SDK
index 7e5f186..927ba53 100644 (file)
@@ -38,7 +38,7 @@ class WebVisitedLinkStore;
 
 class WebViewGroup : public RefCounted<WebViewGroup> {
 public:
-    static RefPtr<WebViewGroup> getOrCreate(const String& name);
+    static RefPtr<WebViewGroup> getOrCreate(const String& name, const String& localStorageDatabasePath);
     ~WebViewGroup();
 
     static WebViewGroup* get(const String& name);
@@ -51,7 +51,7 @@ public:
     WebVisitedLinkStore& visitedLinkStore() { return m_visitedLinkStore.get(); }
 
 private:
-    WebViewGroup(const String& name);
+    WebViewGroup(const String& name, const String& localStorageDatabasePath);
 
     String m_name;
     HashSet<WebView *> m_webViews;
index d6e111d..9cb7b07 100644 (file)
@@ -42,14 +42,14 @@ static HashMap<String, RefPtr<WebViewGroup>>& webViewGroups()
     return webViewGroups;
 }
 
-RefPtr<WebViewGroup> WebViewGroup::getOrCreate(const String& name)
+RefPtr<WebViewGroup> WebViewGroup::getOrCreate(const String& name, const String& localStorageDatabasePath)
 {
     if (name.isEmpty())
-        return adoptRef(new WebViewGroup(String()));
+        return adoptRef(new WebViewGroup(String(), localStorageDatabasePath));
 
     auto& webViewGroup = webViewGroups().add(name, nullptr).iterator->value;
     if (!webViewGroup)
-        webViewGroup = adoptRef(new WebViewGroup(name));
+        webViewGroup = adoptRef(new WebViewGroup(name, localStorageDatabasePath));
 
     return webViewGroup;
 }
@@ -61,9 +61,9 @@ WebViewGroup* WebViewGroup::get(const String& name)
     return webViewGroups().get(name);
 }
 
-WebViewGroup::WebViewGroup(const String& name)
+WebViewGroup::WebViewGroup(const String& name, const String& localStorageDatabasePath)
     : m_name(name)
-    , m_storageNamespaceProvider(*WebStorageNamespaceProvider::create())
+    , m_storageNamespaceProvider(*WebStorageNamespaceProvider::create(localStorageDatabasePath))
     , m_userContentController(*UserContentController::create())
     , m_visitedLinkStore(WebVisitedLinkStore::create())
 {
index b16db55..af724fa 100644 (file)
@@ -933,7 +933,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
         didOneTimeInitialization = true;
     }
 
-    _private->group = WebViewGroup::getOrCreate(groupName);
+    _private->group = WebViewGroup::getOrCreate(groupName, _private->preferences._localStorageDatabasePath);
     _private->group->addWebView(self);
 
     PageConfiguration pageConfiguration;
@@ -1175,7 +1175,7 @@ static void WebKitInitializeGamepadProviderIfNecessary()
     [self addSubview:frameView];
     [frameView release];
 
-    _private->group = WebViewGroup::getOrCreate(groupName);
+    _private->group = WebViewGroup::getOrCreate(groupName, _private->preferences._localStorageDatabasePath);
     _private->group->addWebView(self);
 
     PageConfiguration pageConfiguration;
@@ -6124,7 +6124,7 @@ static WebFrame *incrementFrame(WebFrame *frame, WebFindOptions options = 0)
     if (_private->group)
         _private->group->removeWebView(self);
 
-    _private->group = WebViewGroup::getOrCreate(groupName);
+    _private->group = WebViewGroup::getOrCreate(groupName, _private->preferences._localStorageDatabasePath);
     _private->group->addWebView(self);
 
     if (!_private->page)