Title: [144218] trunk/Source/WebKit2
Revision
144218
Author
[email protected]
Date
2013-02-27 12:04:58 -0800 (Wed, 27 Feb 2013)

Log Message

More storage scaffolding
https://bugs.webkit.org/show_bug.cgi?id=110997

Reviewed by Andreas Kling.

* DerivedSources.make:
Add StorageAreaProxy.

* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::setItem):
Send back a DidSetItem message.

* WebKit2.xcodeproj/project.pbxproj:
Add generated files.

* WebProcess/Storage/StorageAreaProxy.cpp:
(WebKit::StorageAreaProxy::StorageAreaProxy):
Add the message receiver.

(WebKit::StorageAreaProxy::~StorageAreaProxy):
Remove the message receiver.

(WebKit::StorageAreaProxy::didSetItem):
add stub.

* WebProcess/Storage/StorageAreaProxy.h:
(StorageAreaProxy):
* WebProcess/Storage/StorageAreaProxy.messages.in: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (144217 => 144218)


--- trunk/Source/WebKit2/ChangeLog	2013-02-27 19:40:54 UTC (rev 144217)
+++ trunk/Source/WebKit2/ChangeLog	2013-02-27 20:04:58 UTC (rev 144218)
@@ -1,3 +1,34 @@
+2013-02-27  Anders Carlsson  <[email protected]>
+
+        More storage scaffolding
+        https://bugs.webkit.org/show_bug.cgi?id=110997
+
+        Reviewed by Andreas Kling.
+
+        * DerivedSources.make:
+        Add StorageAreaProxy.
+        
+        * UIProcess/Storage/StorageManager.cpp:
+        (WebKit::StorageManager::setItem):
+        Send back a DidSetItem message.
+        
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add generated files.
+
+        * WebProcess/Storage/StorageAreaProxy.cpp:
+        (WebKit::StorageAreaProxy::StorageAreaProxy):
+        Add the message receiver.
+        
+        (WebKit::StorageAreaProxy::~StorageAreaProxy):
+        Remove the message receiver.
+        
+        (WebKit::StorageAreaProxy::didSetItem):
+        add stub.
+
+        * WebProcess/Storage/StorageAreaProxy.h:
+        (StorageAreaProxy):
+        * WebProcess/Storage/StorageAreaProxy.messages.in: Added.
+
 2013-02-27  Sam Weinig  <[email protected]>
 
         REGRESSION: Loading flash switches to discrete graphics, 100 MB on membuster

Modified: trunk/Source/WebKit2/DerivedSources.make (144217 => 144218)


--- trunk/Source/WebKit2/DerivedSources.make	2013-02-27 19:40:54 UTC (rev 144217)
+++ trunk/Source/WebKit2/DerivedSources.make	2013-02-27 20:04:58 UTC (rev 144218)
@@ -89,6 +89,7 @@
     RemoteLayerTreeHost \
     SecItemShim \
     SecItemShimProxy \
+    StorageAreaProxy \
     WebContext \
     WebDatabaseManager \
     WebDatabaseManagerProxy \

Modified: trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp (144217 => 144218)


--- trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp	2013-02-27 19:40:54 UTC (rev 144217)
+++ trunk/Source/WebKit2/UIProcess/Storage/StorageManager.cpp	2013-02-27 20:04:58 UTC (rev 144218)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "StorageManager.h"
 
+#include "StorageAreaProxyMessages.h"
 #include "StorageManagerMessages.h"
 #include "WebProcessProxy.h"
 #include "WorkQueue.h"
@@ -146,9 +147,13 @@
     // FIXME: Implement this.
 }
 
-void StorageManager::setItem(CoreIPC::Connection*, uint64_t storageAreaID, const String& key, const String& value)
+void StorageManager::setItem(CoreIPC::Connection* connection, uint64_t storageAreaID, const String& key, const String& value)
 {
     // FIXME: Find the right storage area and set the item.
+    // FIXME: Send out storage changed events.
+
+    bool quotaError = false;
+    connection->send(Messages::StorageAreaProxy::DidSetItem(key, quotaError), storageAreaID);
 }
 
 void StorageManager::createSessionStorageNamespaceInternal(uint64_t storageNamespaceID)

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (144217 => 144218)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2013-02-27 19:40:54 UTC (rev 144217)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2013-02-27 20:04:58 UTC (rev 144218)
@@ -121,6 +121,8 @@
 		1A2D957012848564001EB962 /* ChildProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2D956E12848564001EB962 /* ChildProcess.cpp */; };
 		1A30066E1110F4F70031937C /* ResponsivenessTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A30066C1110F4F70031937C /* ResponsivenessTimer.h */; };
 		1A30EAC6115D7DA30053E937 /* ConnectionMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A30EAC5115D7DA30053E937 /* ConnectionMac.cpp */; };
+		1A334DED16DE8F88006A8E38 /* StorageAreaProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A334DEB16DE8F88006A8E38 /* StorageAreaProxyMessageReceiver.cpp */; };
+		1A334DEE16DE8F88006A8E38 /* StorageAreaProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A334DEC16DE8F88006A8E38 /* StorageAreaProxyMessages.h */; };
 		1A3979F61332983A00E00300 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; };
 		1A3979F71332983F00E00300 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */; };
 		1A3D610113A7CC2A00F95D4E /* PluginModuleInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3D60FF13A7CC2A00F95D4E /* PluginModuleInfo.cpp */; };
@@ -1463,6 +1465,9 @@
 		1A2D956E12848564001EB962 /* ChildProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ChildProcess.cpp; sourceTree = "<group>"; };
 		1A30066C1110F4F70031937C /* ResponsivenessTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResponsivenessTimer.h; sourceTree = "<group>"; };
 		1A30EAC5115D7DA30053E937 /* ConnectionMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConnectionMac.cpp; sourceTree = "<group>"; };
+		1A334DEA16DE8B68006A8E38 /* StorageAreaProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = StorageAreaProxy.messages.in; sourceTree = "<group>"; };
+		1A334DEB16DE8F88006A8E38 /* StorageAreaProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StorageAreaProxyMessageReceiver.cpp; path = StorageAreaProxyMessageReceiver.cpp; sourceTree = "<group>"; };
+    		1A334DEC16DE8F88006A8E38 /* StorageAreaProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StorageAreaProxyMessages.h; path = StorageAreaProxyMessages.h; sourceTree = "<group>"; };
 		1A3D60FF13A7CC2A00F95D4E /* PluginModuleInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginModuleInfo.cpp; sourceTree = "<group>"; };
 		1A3D610013A7CC2A00F95D4E /* PluginModuleInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginModuleInfo.h; sourceTree = "<group>"; };
 		1A3D610413A7F03A00F95D4E /* ArgumentCoders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArgumentCoders.cpp; sourceTree = "<group>"; };
@@ -3046,6 +3051,7 @@
 			children = (
 				1AD3306C16B1D991004F60E7 /* StorageAreaProxy.cpp */,
 				1AD3306D16B1D991004F60E7 /* StorageAreaProxy.h */,
+				1A334DEA16DE8B68006A8E38 /* StorageAreaProxy.messages.in */,
 				1A17635416B1D5D000D88FD6 /* StorageNamespaceProxy.cpp */,
 				1A17635516B1D5D000D88FD6 /* StorageNamespaceProxy.h */,
 				1AAC4DE116B1CBF6009425E3 /* WebKeyValueStorageManager.cpp */,
@@ -4845,6 +4851,8 @@
 				E1EDFDB21628AD730039ECDA /* SharedWorkerProcessMessages.h */,
 				E1EDFDB31628AD730039ECDA /* SharedWorkerProcessProxyMessageReceiver.cpp */,
 				E1EDFDB41628AD730039ECDA /* SharedWorkerProcessProxyMessages.h */,
+				1A334DEB16DE8F88006A8E38 /* StorageAreaProxyMessageReceiver.cpp */,
+				1A334DEC16DE8F88006A8E38 /* StorageAreaProxyMessages.h */,
 				1AB31A9416BC688100F6DBC9 /* StorageManagerMessageReceiver.cpp */,
 				1AB31A9516BC688100F6DBC9 /* StorageManagerMessages.h */,
 				512E3568130B57F000ABD19A /* WebApplicationCacheManagerMessageReceiver.cpp */,
@@ -5370,6 +5378,7 @@
 				1A3E736111CC2659007BD539 /* WebPlatformStrategies.h in Headers */,
 				31D5929F166E060000E6BF02 /* WebPlugInClient.h in Headers */,
 				1AC8702D130B49A2002C1257 /* WebPluginSiteDataManager.h in Headers */,
+				1A334DEE16DE8F88006A8E38 /* StorageAreaProxyMessages.h in Headers */,
 				BCB9F8B01124E07700A137E0 /* WebPolicyClient.h in Headers */,
 				BC5744F012638FB3006F0F12 /* WebPopupItem.h in Headers */,
 				D3B9484711FF4B6500032B39 /* WebPopupMenu.h in Headers */,
@@ -6233,6 +6242,7 @@
 				BCEE966C112FAF57006BCC24 /* Attachment.cpp in Sources */,
 				E1A31735134CEA80007C9A4F /* AttributedString.mm in Sources */,
 				512F589612A8838800629530 /* AuthenticationChallengeProxy.cpp in Sources */,
+				1A334DED16DE8F88006A8E38 /* StorageAreaProxyMessageReceiver.cpp in Sources */,
 				512F589812A8838800629530 /* AuthenticationDecisionListener.cpp in Sources */,
 				518E8EF816B2091C00E91429 /* AuthenticationManager.cpp in Sources */,
 				518E8EFB16B2091C00E91429 /* AuthenticationManager.mac.mm in Sources */,

Modified: trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.cpp (144217 => 144218)


--- trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.cpp	2013-02-27 19:40:54 UTC (rev 144217)
+++ trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.cpp	2013-02-27 20:04:58 UTC (rev 144218)
@@ -27,6 +27,7 @@
 #include "StorageAreaProxy.h"
 
 #include "SecurityOriginData.h"
+#include "StorageAreaProxyMessages.h"
 #include "StorageManagerMessages.h"
 #include "StorageNamespaceProxy.h"
 #include "WebProcess.h"
@@ -58,11 +59,13 @@
     , m_storageAreaID(generateStorageAreaID())
 {
     WebProcess::shared().connection()->send(Messages::StorageManager::CreateStorageArea(m_storageAreaID, storageNamespaceProxy->storageNamespaceID(), SecurityOriginData::fromSecurityOrigin(securityOrigin.get())), 0);
+    WebProcess::shared().addMessageReceiver(Messages::StorageAreaProxy::messageReceiverName(), m_storageAreaID, this);
 }
 
 StorageAreaProxy::~StorageAreaProxy()
 {
     WebProcess::shared().connection()->send(Messages::StorageManager::DestroyStorageArea(m_storageAreaID), 0);
+    WebProcess::shared().removeMessageReceiver(Messages::StorageAreaProxy::messageReceiverName(), m_storageAreaID);
 }
 
 unsigned StorageAreaProxy::length(ExceptionCode& ec, Frame* sourceFrame)
@@ -180,6 +183,12 @@
     ASSERT_NOT_REACHED();
 }
 
+
+void StorageAreaProxy::didSetItem(const String& key, bool quotaError)
+{
+    // FIXME: Implement this.
+}
+
 bool StorageAreaProxy::disabledByPrivateBrowsingInFrame(const Frame* sourceFrame) const
 {
     if (!sourceFrame->page()->settings()->privateBrowsingEnabled())

Modified: trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.h (144217 => 144218)


--- trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.h	2013-02-27 19:40:54 UTC (rev 144217)
+++ trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.h	2013-02-27 20:04:58 UTC (rev 144218)
@@ -26,6 +26,7 @@
 #ifndef StorageAreaProxy_h
 #define StorageAreaProxy_h
 
+#include "MessageReceiver.h"
 #include <WebCore/StorageArea.h>
 #include <wtf/HashMap.h>
 
@@ -37,7 +38,7 @@
 
 class StorageNamespaceProxy;
 
-class StorageAreaProxy : public WebCore::StorageArea {
+class StorageAreaProxy : public WebCore::StorageArea, private CoreIPC::MessageReceiver {
 public:
     static PassRefPtr<StorageAreaProxy> create(StorageNamespaceProxy*, PassRefPtr<WebCore::SecurityOrigin>);
     virtual ~StorageAreaProxy();
@@ -59,6 +60,11 @@
     virtual void decrementAccessCount() OVERRIDE;
     virtual void closeDatabaseIfIdle() OVERRIDE;
 
+    // CoreIPC::MessageReceiver
+    virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE;
+
+    void didSetItem(const String& key, bool quotaError);
+
     bool disabledByPrivateBrowsingInFrame(const WebCore::Frame* sourceFrame) const;
 
     void loadValuesIfNeeded();

Added: trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.messages.in (0 => 144218)


--- trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.messages.in	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/Storage/StorageAreaProxy.messages.in	2013-02-27 20:04:58 UTC (rev 144218)
@@ -0,0 +1,25 @@
+# Copyright (C) 2013 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.
+
+messages -> StorageAreaProxy {
+    DidSetItem(WTF::String key, bool quotaException)
+}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to