Title: [144351] trunk/Source
Revision
144351
Author
[email protected]
Date
2013-02-28 12:51:44 -0800 (Thu, 28 Feb 2013)

Log Message

Implement more StorageAreaProxy member functions
https://bugs.webkit.org/show_bug.cgi?id=111103

Reviewed by Sam Weinig.

Source/WebCore:

Export two more StorageMap symbols required by WebKit2.

* WebCore.exp.in:

Source/WebKit2:

* Shared/SecurityOriginData.cpp:
(WebKit::SecurityOriginData::securityOrigin):
* Shared/SecurityOriginData.h:
Add helper to create a WebCore::SecurityOrigin from a SecurityOriginData object.

* WebProcess/Storage/StorageAreaProxy.cpp:
(WebKit::StorageAreaProxy::key):
Fill the storage map and call through to StorageMap::key.

(WebKit::StorageAreaProxy::contains):
Fill the storage map and call through to StorageMap::contains.

(WebKit::StorageAreaProxy::memoryBytesUsedByCache):
Return 0; this matches StorageAreaImpl.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (144350 => 144351)


--- trunk/Source/WebCore/ChangeLog	2013-02-28 20:38:23 UTC (rev 144350)
+++ trunk/Source/WebCore/ChangeLog	2013-02-28 20:51:44 UTC (rev 144351)
@@ -1,3 +1,14 @@
+2013-02-28  Anders Carlsson  <[email protected]>
+
+        Implement more StorageAreaProxy member functions
+        https://bugs.webkit.org/show_bug.cgi?id=111103
+
+        Reviewed by Sam Weinig.
+
+        Export two more StorageMap symbols required by WebKit2.
+
+        * WebCore.exp.in:
+
 2013-02-28  Xianzhu Wang  <[email protected]>
 
         Focus ring for a child layer is incorrectly offset by ancestor composited layer's position

Modified: trunk/Source/WebCore/WebCore.exp.in (144350 => 144351)


--- trunk/Source/WebCore/WebCore.exp.in	2013-02-28 20:38:23 UTC (rev 144350)
+++ trunk/Source/WebCore/WebCore.exp.in	2013-02-28 20:51:44 UTC (rev 144351)
@@ -83,6 +83,7 @@
 __ZN7WebCore10ScrollView24windowResizerRectChangedEv
 __ZN7WebCore10ScrollView8addChildEN3WTF10PassRefPtrINS_6WidgetEEE
 __ZN7WebCore10StorageMap11importItemsERKN3WTF7HashMapINS1_6StringES3_NS1_10StringHashENS1_10HashTraitsIS3_EES6_EE
+__ZN7WebCore10StorageMap3keyEj
 __ZN7WebCore10StorageMap6createEj
 __ZN7WebCore10StorageMap7setItemERKN3WTF6StringES4_RS2_Rb
 __ZN7WebCore10deleteFileERKN3WTF6StringE
@@ -1188,6 +1189,7 @@
 __ZNK7WebCore10ScrollView18contentsToRootViewERKNS_8IntPointE
 __ZNK7WebCore10StorageMap6lengthEv
 __ZNK7WebCore10StorageMap7getItemERKN3WTF6StringE
+__ZNK7WebCore10StorageMap8containsERKN3WTF6StringE
 __ZNK7WebCore11FrameLoader10isCompleteEv
 __ZNK7WebCore11FrameLoader14cancelledErrorERKNS_15ResourceRequestE
 __ZNK7WebCore11FrameLoader14frameHasLoadedEv

Modified: trunk/Source/WebKit2/ChangeLog (144350 => 144351)


--- trunk/Source/WebKit2/ChangeLog	2013-02-28 20:38:23 UTC (rev 144350)
+++ trunk/Source/WebKit2/ChangeLog	2013-02-28 20:51:44 UTC (rev 144351)
@@ -1,3 +1,25 @@
+2013-02-28  Anders Carlsson  <[email protected]>
+
+        Implement more StorageAreaProxy member functions
+        https://bugs.webkit.org/show_bug.cgi?id=111103
+
+        Reviewed by Sam Weinig.
+
+        * Shared/SecurityOriginData.cpp:
+        (WebKit::SecurityOriginData::securityOrigin):
+        * Shared/SecurityOriginData.h:
+        Add helper to create a WebCore::SecurityOrigin from a SecurityOriginData object.
+
+        * WebProcess/Storage/StorageAreaProxy.cpp:
+        (WebKit::StorageAreaProxy::key):
+        Fill the storage map and call through to StorageMap::key.
+
+        (WebKit::StorageAreaProxy::contains):
+        Fill the storage map and call through to StorageMap::contains.
+
+        (WebKit::StorageAreaProxy::memoryBytesUsedByCache):
+        Return 0; this matches StorageAreaImpl.
+
 2013-02-28  Tim Horton  <[email protected]>
 
         PDFPlugin: PDF orientation isn't respected when printing or print-previewing

Modified: trunk/Source/WebKit2/Shared/SecurityOriginData.cpp (144350 => 144351)


--- trunk/Source/WebKit2/Shared/SecurityOriginData.cpp	2013-02-28 20:38:23 UTC (rev 144350)
+++ trunk/Source/WebKit2/Shared/SecurityOriginData.cpp	2013-02-28 20:51:44 UTC (rev 144351)
@@ -46,6 +46,11 @@
     return securityOriginData;
 }
 
+PassRefPtr<SecurityOrigin> SecurityOriginData::securityOrigin() const
+{
+    return SecurityOrigin::create(protocol, host, port);
+}
+
 void SecurityOriginData::encode(CoreIPC::ArgumentEncoder& encoder) const
 {
     encoder << protocol;

Modified: trunk/Source/WebKit2/Shared/SecurityOriginData.h (144350 => 144351)


--- trunk/Source/WebKit2/Shared/SecurityOriginData.h	2013-02-28 20:38:23 UTC (rev 144350)
+++ trunk/Source/WebKit2/Shared/SecurityOriginData.h	2013-02-28 20:51:44 UTC (rev 144351)
@@ -41,6 +41,7 @@
 
 struct SecurityOriginData {
     static SecurityOriginData fromSecurityOrigin(WebCore::SecurityOrigin*);
+    PassRefPtr<WebCore::SecurityOrigin> securityOrigin() const;
 
     void encode(CoreIPC::ArgumentEncoder&) const;
     static bool decode(CoreIPC::ArgumentDecoder&, SecurityOriginData&);

Modified: trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp (144350 => 144351)


--- trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp	2013-02-28 20:38:23 UTC (rev 144350)
+++ trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp	2013-02-28 20:51:44 UTC (rev 144351)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "StorageManager.h"
 
+#include "SecurityOriginData.h"
 #include "StorageAreaProxyMessages.h"
 #include "StorageManagerMessages.h"
 #include "WebProcessProxy.h"

Modified: trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.cpp (144350 => 144351)


--- trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.cpp	2013-02-28 20:38:23 UTC (rev 144350)
+++ trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.cpp	2013-02-28 20:51:44 UTC (rev 144351)
@@ -83,11 +83,19 @@
     return m_storageMap->length();
 }
 
-String StorageAreaProxy::key(unsigned index, ExceptionCode&, Frame* sourceFrame)
+String StorageAreaProxy::key(unsigned index, ExceptionCode& ec, Frame* sourceFrame)
 {
-    // FIXME: Implement this.
-    ASSERT_NOT_REACHED();
-    return String();
+    ec = 0;
+    if (!canAccessStorage(sourceFrame)) {
+        ec = SECURITY_ERR;
+        return String();
+    }
+    if (disabledByPrivateBrowsingInFrame(sourceFrame))
+        return String();
+
+    loadValuesIfNeeded();
+
+    return m_storageMap->key(index);
 }
 
 String StorageAreaProxy::getItem(const String& key, ExceptionCode& ec, Frame* sourceFrame)
@@ -149,10 +157,19 @@
     ASSERT_NOT_REACHED();
 }
 
-bool StorageAreaProxy::contains(const String& key, ExceptionCode&, Frame* sourceFrame)
+bool StorageAreaProxy::contains(const String& key, ExceptionCode& ec, Frame* sourceFrame)
 {
-    // FIXME: Implement this.
-    return false;
+    ec = 0;
+    if (!canAccessStorage(sourceFrame)) {
+        ec = SECURITY_ERR;
+        return false;
+    }
+    if (disabledByPrivateBrowsingInFrame(sourceFrame))
+        return false;
+
+    loadValuesIfNeeded();
+
+    return m_storageMap->contains(key);
 }
 
 bool StorageAreaProxy::canAccessStorage(Frame* frame)
@@ -162,8 +179,6 @@
 
 size_t StorageAreaProxy::memoryBytesUsedByCache()
 {
-    // FIXME: Implement this.
-    ASSERT_NOT_REACHED();
     return 0;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to