summaryrefslogtreecommitdiffstats
path: root/chrome/browser/in_process_webkit/webkit_context.h
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 03:54:49 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-08 03:54:49 +0000
commitc7fd0cbdbd381035ecd95d164a59d874b41d9339 (patch)
tree9956e58e7eb8b9098301cca6f1330ed5a3a1a348 /chrome/browser/in_process_webkit/webkit_context.h
parentb4599a15c90a853930187cc751c951beb819c02d (diff)
downloadchromium_src-c7fd0cbdbd381035ecd95d164a59d874b41d9339.zip
chromium_src-c7fd0cbdbd381035ecd95d164a59d874b41d9339.tar.gz
chromium_src-c7fd0cbdbd381035ecd95d164a59d874b41d9339.tar.bz2
Refactor DOM storage to be more object oriented. All the DOMStorageDispatcher hosts (which are each owned by one ResourceMessageFilter) for the same profile share a WebKit context, and each one of those contexts owns a DOMStorageContext. The DOMStorageContext owns storage namespace objects which own storage area objects which wrap their WebKit counterparts.
Not only is this cleaner code wise and more efficient (we're not duplicating WebStorageNamespaces and Areas for each DOMStorageDispatcherHost) but this is necessary for events and locking. TEST=none BUG=none Review URL: http://codereview.chromium.org/192003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25609 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/in_process_webkit/webkit_context.h')
-rw-r--r--chrome/browser/in_process_webkit/webkit_context.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/chrome/browser/in_process_webkit/webkit_context.h b/chrome/browser/in_process_webkit/webkit_context.h
index 2b84224..ee4c61b 100644
--- a/chrome/browser/in_process_webkit/webkit_context.h
+++ b/chrome/browser/in_process_webkit/webkit_context.h
@@ -7,6 +7,9 @@
#include "base/file_path.h"
#include "base/ref_counted.h"
+#include "base/scoped_ptr.h"
+
+class DOMStorageContext;
// There's one WebKitContext per profile. Various DispatcherHost classes
// have a pointer to the Context to store shared state.
@@ -17,12 +20,19 @@ class WebKitContext : public base::RefCountedThreadSafe<WebKitContext> {
const FilePath& data_path() const { return data_path_; }
bool is_incognito() const { return is_incognito_; }
+ // Initialized lazily. Pointer is valid for the lifetime of this instance.
+ DOMStorageContext* GetDOMStorageContext();
+
private:
friend class base::RefCountedThreadSafe<WebKitContext>;
~WebKitContext();
- FilePath data_path_;
- bool is_incognito_;
+ // Copies of profile data that can be accessed on any thread.
+ const FilePath data_path_;
+ const bool is_incognito_;
+
+ // The state for DOM Storage.
+ scoped_ptr<DOMStorageContext> dom_storage_context_;
DISALLOW_IMPLICIT_CONSTRUCTORS(WebKitContext);
};