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

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

Issue 258010: Reverting 27759. (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_context.h
===================================================================
--- chrome/browser/in_process_webkit/dom_storage_context.h (revision 27849)
+++ chrome/browser/in_process_webkit/dom_storage_context.h (working copy)
@@ -7,6 +7,7 @@
#include "base/file_path.h"
#include "base/hash_tables.h"
+#include "chrome/browser/in_process_webkit/dom_storage_dispatcher_host.h"
class StorageArea;
class StorageNamespace;
@@ -15,7 +16,8 @@
// This is owned by WebKitContext and is all the dom storage information that's
// shared by all the ResourceMessageFilter/DOMStorageDispatcherHosts that share
// the same profile. The specifics of responsibilities are fairly well
-// documented here and in StorageNamespace and StorageArea.
+// documented here and in StorageNamespace and StorageArea. Everything is only
+// to be accessed on the WebKit thread unless noted otherwise.
class DOMStorageContext {
public:
explicit DOMStorageContext(WebKitContext* webkit_context);
@@ -44,6 +46,13 @@
void UnregisterStorageNamespace(StorageNamespace* storage_namespace);
StorageNamespace* GetStorageNamespace(int64 id);
+ // Sometimes an event from one DOM storage dispatcher host requires
+ // communication to all of them.
+ typedef base::hash_set<DOMStorageDispatcherHost*> DispatcherHostSet;
+ void RegisterDispatcherHost(DOMStorageDispatcherHost* dispatcher_host);
+ void UnregisterDispatcherHost(DOMStorageDispatcherHost* dispatcher_host);
+ const DispatcherHostSet* GetDispatcherHostSet() const;
+
// The special ID used for local storage.
static const int64 kLocalStorageNamespaceId = 0;
@@ -57,6 +66,10 @@
// We're owned by this WebKit context. Used while instantiating LocalStorage.
WebKitContext* webkit_context_;
+ // All the DOMStorageDispatcherHosts that are attached to us. ONLY USE ON THE
+ // IO THREAD!
+ DispatcherHostSet dispatcher_host_set_;
+
// Maps ids to StorageAreas. We do NOT own these objects. StorageNamespace
// (which does own them) will notify us when we should remove the entries.
typedef base::hash_map<int64, StorageArea*> StorageAreaMap;
« no previous file with comments | « chrome/browser/in_process_webkit/browser_webkitclient_impl.cc ('k') | chrome/browser/in_process_webkit/dom_storage_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698