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

Unified Diff: chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h

Issue 192003: Refactor DOM Storage to pave the way for events and locking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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
Index: chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h
===================================================================
--- chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h (revision 25608)
+++ chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h (working copy)
@@ -7,18 +7,13 @@
#include "base/hash_tables.h"
#include "base/ref_counted.h"
-#include "base/scoped_ptr.h"
+#include "chrome/browser/in_process_webkit/storage_area.h"
+#include "chrome/browser/in_process_webkit/webkit_context.h"
#include "ipc/ipc_message.h"
-class WebKitContext;
+class DOMStorageContext;
class WebKitThread;
-namespace WebKit {
-class WebStorageArea;
-class WebStorageNamespace;
-class WebString;
-}
-
// This class handles the logistics of DOM Storage within the browser process.
// It mostly ferries information between IPCs and the WebKit implementations,
// but it also handles some special cases like when renderer processes die.
@@ -58,20 +53,12 @@
void OnRemoveItem(int64 storage_area_id, const string16& key);
void OnClear(int64 storage_area_id, IPC::Message* reply_msg);
- // Get a WebStorageNamespace or WebStorageArea based from its ID. Only call
- // on the WebKit thread.
- WebKit::WebStorageArea* GetStorageArea(int64 id);
- WebKit::WebStorageNamespace* GetStorageNamespace(int64 id);
+ // A shortcut for accessing our context.
+ DOMStorageContext* Context() {
+ DCHECK(!shutdown_);
+ return webkit_context_->GetDOMStorageContext();
+ }
- // Add a WebStorageNamespace or WebStorageArea and get a new unique ID for
- // it. Only call on the WebKit thread.
- int64 AddStorageArea(WebKit::WebStorageArea* new_storage_area);
- int64 AddStorageNamespace(WebKit::WebStorageNamespace* new_namespace);
-
- // Get the path to the LocalStorage directory. Calculate it if we haven't
- // already. Only call on the WebKit thread.
- WebKit::WebString GetLocalStoragePath();
-
// Data shared between renderer processes with the same profile.
scoped_refptr<WebKitContext> webkit_context_;
@@ -81,22 +68,6 @@
// Only set on the IO thread.
IPC::Message::Sender* message_sender_;
- // The last used storage_area_id and storage_namespace_id's. Only use on the
- // WebKit thread.
- int64 last_storage_area_id_;
- int64 last_storage_namespace_id_;
-
- // Used to maintain a mapping between storage_area_id's used in IPC messages
- // and the actual WebStorageArea instances. Only use on the WebKit thread.
- typedef base::hash_map<int64, WebKit::WebStorageArea*> StorageAreaMap;
- StorageAreaMap storage_area_map_;
-
- // Mapping between storage_namespace_id's used in IPC messages and the
- // WebStorageNamespace instances. Only use on the WebKit thread.
- typedef base::hash_map<int64, WebKit::WebStorageNamespace*>
- StorageNamespaceMap;
- StorageNamespaceMap storage_namespace_map_;
-
// Has this dispatcher ever handled a message. If not, then we can skip
// the entire shutdown procedure. This is only set to true on the IO thread
// and must be true if we're reading it on the WebKit thread.

Powered by Google App Engine
This is Rietveld 408576698