Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Unified Diff: content/renderer/dom_storage/dom_storage_dispatcher.h

Issue 10383123: Switch to using the async DomStorage IPC messages and add a caching layer … (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/dom_storage_messages.h ('k') | content/renderer/dom_storage/dom_storage_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/dom_storage/dom_storage_dispatcher.h
===================================================================
--- content/renderer/dom_storage/dom_storage_dispatcher.h (revision 139572)
+++ content/renderer/dom_storage/dom_storage_dispatcher.h (working copy)
@@ -6,24 +6,43 @@
#define CONTENT_RENDERER_DOM_STORAGE_DOM_STORAGE_DISPATCHER_H_
#pragma once
-#include "ipc/ipc_channel.h"
+#include "base/memory/ref_counted.h"
+class GURL;
struct DOMStorageMsg_Event_Params;
+namespace dom_storage {
+class DomStorageCachedArea;
+}
+namespace IPC {
+class Message;
+}
// Dispatches DomStorage related messages sent to a renderer process from the
// main browser process. There is one instance per child process. Messages
// are dispatched on the main renderer thread. The RenderThreadImpl
-// creates an instance and delegates calls to it.
-class DomStorageDispatcher : public IPC::Channel::Listener {
+// creates an instance and delegates calls to it. This classes also manages
+// the collection of DomStorageCachedAreas that are active in the process.
+class DomStorageDispatcher {
public:
- DomStorageDispatcher() {}
+ DomStorageDispatcher();
+ ~DomStorageDispatcher();
- // IPC::Channel::Listener implementation
- virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
+ // Each call to open should be balanced with a call to close.
+ scoped_refptr<dom_storage::DomStorageCachedArea> OpenCachedArea(
+ int connection_id, int64 namespace_id, const GURL& origin);
+ void CloseCachedArea(
+ int connection_id, dom_storage::DomStorageCachedArea* area);
+ bool OnMessageReceived(const IPC::Message& msg);
+
private:
+ class ProxyImpl;
+
// IPC message handlers
void OnStorageEvent(const DOMStorageMsg_Event_Params& params);
+ void OnAsyncOperationComplete(bool success);
+
+ scoped_refptr<ProxyImpl> proxy_;
};
#endif // CONTENT_RENDERER_DOM_STORAGE_DOM_STORAGE_DISPATCHER_H_
« no previous file with comments | « content/common/dom_storage_messages.h ('k') | content/renderer/dom_storage/dom_storage_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698