Move storageType() to StorageAreaProxy
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 23:31:54 +0000 (23:31 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 23:31:54 +0000 (23:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111488

Reviewed by Andreas Kling.

* WebProcess/Storage/StorageAreaProxy.cpp:
(WebKit::StorageAreaProxy::StorageAreaProxy):
(WebKit::StorageAreaProxy::storageType):
(WebKit::StorageAreaProxy::disabledByPrivateBrowsingInFrame):
* WebProcess/Storage/StorageAreaProxy.h:
(StorageAreaProxy):
* WebProcess/Storage/StorageNamespaceProxy.cpp:
* WebProcess/Storage/StorageNamespaceProxy.h:

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/Storage/StorageAreaProxy.cpp
Source/WebKit2/WebProcess/Storage/StorageAreaProxy.h
Source/WebKit2/WebProcess/Storage/StorageNamespaceProxy.cpp
Source/WebKit2/WebProcess/Storage/StorageNamespaceProxy.h

index 46d79cc..f22f4ad 100644 (file)
@@ -1,3 +1,19 @@
+2013-03-05  Anders Carlsson  <andersca@apple.com>
+
+        Move storageType() to StorageAreaProxy
+        https://bugs.webkit.org/show_bug.cgi?id=111488
+
+        Reviewed by Andreas Kling.
+
+        * WebProcess/Storage/StorageAreaProxy.cpp:
+        (WebKit::StorageAreaProxy::StorageAreaProxy):
+        (WebKit::StorageAreaProxy::storageType):
+        (WebKit::StorageAreaProxy::disabledByPrivateBrowsingInFrame):
+        * WebProcess/Storage/StorageAreaProxy.h:
+        (StorageAreaProxy):
+        * WebProcess/Storage/StorageNamespaceProxy.cpp:
+        * WebProcess/Storage/StorageNamespaceProxy.h:
+
 2013-03-05  Jeffrey Pfau  <jpfau@apple.com>
 
         Clear associated cache partitions when deleting origins' cache
index ff80255..f625979 100644 (file)
@@ -54,7 +54,7 @@ PassRefPtr<StorageAreaProxy> StorageAreaProxy::create(StorageNamespaceProxy* sto
 }
 
 StorageAreaProxy::StorageAreaProxy(StorageNamespaceProxy* storageNamespaceProxy, PassRefPtr<SecurityOrigin> securityOrigin)
-    : m_storageType(storageNamespaceProxy->storageType())
+    : m_storageNamespaceID(storageNamespaceProxy->storageNamespaceID())
     , m_quotaInBytes(storageNamespaceProxy->quotaInBytes())
     , m_storageAreaID(generateStorageAreaID())
 {
@@ -209,12 +209,21 @@ void StorageAreaProxy::dispatchStorageEvent(const String& key, const String& old
     // FIXME: Implement this.
 }
 
+StorageType StorageAreaProxy::storageType() const
+{
+    // A zero storage namespace ID is used for local storage.
+    if (!m_storageNamespaceID)
+        return LocalStorage;
+
+    return SessionStorage;
+}
+
 bool StorageAreaProxy::disabledByPrivateBrowsingInFrame(const Frame* sourceFrame) const
 {
     if (!sourceFrame->page()->settings()->privateBrowsingEnabled())
         return false;
 
-    if (m_storageType != LocalStorage)
+    if (storageType() != LocalStorage)
         return true;
 
     return !SchemeRegistry::allowsLocalStorageAccessInPrivateBrowsing(sourceFrame->document()->securityOrigin()->protocol());
index bf51079..f83b4ac 100644 (file)
@@ -66,11 +66,12 @@ private:
     void didSetItem(const String& key, bool quotaError);
     void dispatchStorageEvent(const String& key, const String& oldValue, const String& newValue, const String& urlString);
 
+    WebCore::StorageType storageType() const;
     bool disabledByPrivateBrowsingInFrame(const WebCore::Frame* sourceFrame) const;
 
     void loadValuesIfNeeded();
 
-    WebCore::StorageType m_storageType;
+    uint64_t m_storageNamespaceID;
     unsigned m_quotaInBytes;
     uint64_t m_storageAreaID;
     RefPtr<WebCore::StorageMap> m_storageMap;
index 2a0461b..de2ca7e 100644 (file)
@@ -50,15 +50,6 @@ StorageNamespaceProxy::~StorageNamespaceProxy()
 {
 }
 
-StorageType StorageNamespaceProxy::storageType() const
-{
-    // A zero storage namespace ID is used for local storage.
-    if (!m_storageNamespaceID)
-        return LocalStorage;
-
-    return SessionStorage;
-}
-
 PassRefPtr<StorageArea> StorageNamespaceProxy::storageArea(PassRefPtr<SecurityOrigin> securityOrigin)
 {
     return StorageAreaProxy::create(this, securityOrigin);
index f1379ae..97dd486 100644 (file)
@@ -41,8 +41,6 @@ public:
     uint64_t storageNamespaceID() const { return m_storageNamespaceID; }
     unsigned quotaInBytes() const { return m_quotaInBytes; }
 
-    WebCore::StorageType storageType() const;
-
 private:
     explicit StorageNamespaceProxy(uint64_t storageNamespaceID, unsigned quotaInBytes);