Title: [177082] trunk/Source/WebKit2
Revision
177082
Author
ander...@apple.com
Date
2014-12-10 11:25:42 -0800 (Wed, 10 Dec 2014)

Log Message

Add a stubbed out WebStorageNamespaceProvider class to WebKit2
https://bugs.webkit.org/show_bug.cgi?id=139497

Reviewed by Beth Dakin.

* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/Storage/WebStorageNamespaceProvider.cpp: Added.
(WebKit::storageNamespaceProviders):
(WebKit::WebStorageNamespaceProvider::getOrCreate):
(WebKit::WebStorageNamespaceProvider::WebStorageNamespaceProvider):
(WebKit::WebStorageNamespaceProvider::~WebStorageNamespaceProvider):
(WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
(WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
* WebProcess/Storage/WebStorageNamespaceProvider.h: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (177081 => 177082)


--- trunk/Source/WebKit2/ChangeLog	2014-12-10 19:25:11 UTC (rev 177081)
+++ trunk/Source/WebKit2/ChangeLog	2014-12-10 19:25:42 UTC (rev 177082)
@@ -1,3 +1,20 @@
+2014-12-10  Anders Carlsson  <ander...@apple.com>
+
+        Add a stubbed out WebStorageNamespaceProvider class to WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=139497
+
+        Reviewed by Beth Dakin.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/Storage/WebStorageNamespaceProvider.cpp: Added.
+        (WebKit::storageNamespaceProviders):
+        (WebKit::WebStorageNamespaceProvider::getOrCreate):
+        (WebKit::WebStorageNamespaceProvider::WebStorageNamespaceProvider):
+        (WebKit::WebStorageNamespaceProvider::~WebStorageNamespaceProvider):
+        (WebKit::WebStorageNamespaceProvider::createLocalStorageNamespace):
+        (WebKit::WebStorageNamespaceProvider::createTransientLocalStorageNamespace):
+        * WebProcess/Storage/WebStorageNamespaceProvider.h: Added.
+
 2014-12-10  Enrica Casucci  <enr...@apple.com>
 
         Fix iOS builders for 8.0

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (177081 => 177082)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-12-10 19:25:11 UTC (rev 177081)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-12-10 19:25:42 UTC (rev 177082)
@@ -252,6 +252,8 @@
 		1A4D664C18A3030E00D82E21 /* WKFrameInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4D664A18A3030E00D82E21 /* WKFrameInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		1A4D664E18A3031B00D82E21 /* WKFrameInfoInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A4D664D18A3031B00D82E21 /* WKFrameInfoInternal.h */; };
 		1A50DB66110A3D57000D3FE5 /* WebProcess.app in Copy Files */ = {isa = PBXBuildFile; fileRef = 1A50DB1E110A3BDC000D3FE5 /* WebProcess.app */; };
+		1A52C0F71A38CDC70016160A /* WebStorageNamespaceProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A52C0F51A38CDC70016160A /* WebStorageNamespaceProvider.cpp */; };
+		1A52C0F81A38CDC70016160A /* WebStorageNamespaceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A52C0F61A38CDC70016160A /* WebStorageNamespaceProvider.h */; };
 		1A53C2A21A323004004E8C70 /* InjectedBundleCSSStyleDeclarationHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C4ED3261A3119D90079BD49 /* InjectedBundleCSSStyleDeclarationHandle.cpp */; };
 		1A53C2A91A32572B004E8C70 /* WebsiteDataStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A53C2A41A32569F004E8C70 /* WebsiteDataStore.cpp */; };
 		1A53C2AA1A325730004E8C70 /* WebsiteDataStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A53C2A51A32569F004E8C70 /* WebsiteDataStore.h */; };
@@ -2234,6 +2236,8 @@
 		1A4F976E100E7B6600637A18 /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; };
 		1A50DB1E110A3BDC000D3FE5 /* WebProcess.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WebProcess.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		1A50F0F819199E42001ACD12 /* WebKit2.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = WebKit2.xcconfig; sourceTree = "<group>"; };
+		1A52C0F51A38CDC70016160A /* WebStorageNamespaceProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebStorageNamespaceProvider.cpp; sourceTree = "<group>"; };
+		1A52C0F61A38CDC70016160A /* WebStorageNamespaceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebStorageNamespaceProvider.h; sourceTree = "<group>"; };
 		1A53C2A41A32569F004E8C70 /* WebsiteDataStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebsiteDataStore.cpp; sourceTree = "<group>"; };
 		1A53C2A51A32569F004E8C70 /* WebsiteDataStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsiteDataStore.h; sourceTree = "<group>"; };
 		1A5B1C4E1898606F004FCF9B /* WKNavigation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKNavigation.mm; sourceTree = "<group>"; };
@@ -4401,6 +4405,8 @@
 				1A334DEA16DE8B68006A8E38 /* StorageAreaMap.messages.in */,
 				1A17635416B1D5D000D88FD6 /* StorageNamespaceImpl.cpp */,
 				1A17635516B1D5D000D88FD6 /* StorageNamespaceImpl.h */,
+				1A52C0F51A38CDC70016160A /* WebStorageNamespaceProvider.cpp */,
+				1A52C0F61A38CDC70016160A /* WebStorageNamespaceProvider.h */,
 			);
 			path = Storage;
 			sourceTree = "<group>";
@@ -7466,6 +7472,7 @@
 				BC2D021712AC41CB00E732A3 /* SameDocumentNavigationType.h in Headers */,
 				1AAB4A8D1296F0A20023952F /* SandboxExtension.h in Headers */,
 				1AB8A1F218400B6200E9AE69 /* WKPageUIClient.h in Headers */,
+				1A52C0F81A38CDC70016160A /* WebStorageNamespaceProvider.h in Headers */,
 				2D353B1319F8305D000EEACD /* ActionMenuHitTestResult.h in Headers */,
 				E1E552C516AE065F004ED653 /* SandboxInitializationParameters.h in Headers */,
 				51D130541382EAC000351EDD /* SecItemRequestData.h in Headers */,
@@ -9079,6 +9086,7 @@
 				2D429BFD1721E2C700EC681F /* PDFPluginPasswordField.mm in Sources */,
 				2D2ADF0916362DD500197E47 /* PDFPluginTextAnnotation.mm in Sources */,
 				BCC43ABA127B95DC00317F16 /* PlatformPopupMenuData.cpp in Sources */,
+				1A52C0F71A38CDC70016160A /* WebStorageNamespaceProvider.cpp in Sources */,
 				1A6FB7D211E651E200DB1371 /* Plugin.cpp in Sources */,
 				1A3635AD1A3145E500ED6197 /* APIWebsiteDataStoreCocoa.mm in Sources */,
 				CEDBA84719FDA00A006866A5 /* WebSQLiteDatabaseTracker.cpp in Sources */,

Added: trunk/Source/WebKit2/WebProcess/Storage/WebStorageNamespaceProvider.cpp (0 => 177082)


--- trunk/Source/WebKit2/WebProcess/Storage/WebStorageNamespaceProvider.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/Storage/WebStorageNamespaceProvider.cpp	2014-12-10 19:25:42 UTC (rev 177082)
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebStorageNamespaceProvider.h"
+
+#include <WebCore/StorageNamespace.h>
+#include <wtf/HashMap.h>
+#include <wtf/NeverDestroyed.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+static HashMap<uint64_t, WebStorageNamespaceProvider*>& storageNamespaceProviders()
+{
+    static NeverDestroyed<HashMap<uint64_t, WebStorageNamespaceProvider*>> storageNamespaceProviders;
+
+    return storageNamespaceProviders;
+}
+
+RefPtr<WebStorageNamespaceProvider> WebStorageNamespaceProvider::getOrCreate(uint64_t identifier)
+{
+    auto& slot = storageNamespaceProviders().add(identifier, nullptr).iterator->value;
+    if (slot)
+        return slot;
+
+    RefPtr<WebStorageNamespaceProvider> storageNamespaceProvider = adoptRef(new WebStorageNamespaceProvider(identifier));
+    slot = storageNamespaceProvider.get();
+
+    return storageNamespaceProvider;
+}
+
+WebStorageNamespaceProvider::WebStorageNamespaceProvider(uint64_t identifier)
+    : m_identifier(identifier)
+{
+}
+
+WebStorageNamespaceProvider::~WebStorageNamespaceProvider()
+{
+    ASSERT(storageNamespaceProviders().contains(m_identifier));
+
+    storageNamespaceProviders().remove(m_identifier);
+}
+
+RefPtr<WebCore::StorageNamespace> WebStorageNamespaceProvider::createLocalStorageNamespace(unsigned quota)
+{
+    // FIXME: Implement.
+    return nullptr;
+}
+
+RefPtr<WebCore::StorageNamespace> WebStorageNamespaceProvider::createTransientLocalStorageNamespace(WebCore::SecurityOrigin&, unsigned quota)
+{
+    // FIXME: Implement.
+    return nullptr;
+}
+
+}

Added: trunk/Source/WebKit2/WebProcess/Storage/WebStorageNamespaceProvider.h (0 => 177082)


--- trunk/Source/WebKit2/WebProcess/Storage/WebStorageNamespaceProvider.h	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/Storage/WebStorageNamespaceProvider.h	2014-12-10 19:25:42 UTC (rev 177082)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebStorageNamespaceProvider_h
+#define WebStorageNamespaceProvider_h
+
+#include <WebCore/StorageNamespaceProvider.h>
+
+namespace WebKit {
+
+class WebStorageNamespaceProvider final : public WebCore::StorageNamespaceProvider {
+public:
+    static RefPtr<WebStorageNamespaceProvider> getOrCreate(uint64_t identifier);
+    virtual ~WebStorageNamespaceProvider();
+
+private:
+    explicit WebStorageNamespaceProvider(uint64_t identifier);
+
+    virtual RefPtr<WebCore::StorageNamespace> createLocalStorageNamespace(unsigned quota) override;
+    virtual RefPtr<WebCore::StorageNamespace> createTransientLocalStorageNamespace(WebCore::SecurityOrigin&, unsigned quota) override;
+
+    const uint64_t m_identifier;
+};
+
+}
+
+#endif // WebStorageNamespaceProvider_h
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to