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

Unified Diff: chrome/browser/in_process_webkit/storage_namespace.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/storage_namespace.h
===================================================================
--- chrome/browser/in_process_webkit/storage_namespace.h (revision 0)
+++ chrome/browser/in_process_webkit/storage_namespace.h (revision 0)
@@ -0,0 +1,60 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in the
+// LICENSE file.
+
+#ifndef CHROME_BROWSER_IN_PROCESS_WEBKIT_STORAGE_NAMESPACE_H_
+#define CHROME_BROWSER_IN_PROCESS_WEBKIT_STORAGE_NAMESPACE_H_
+
+#include "base/string16.h"
+#include "base/hash_tables.h"
+
+class DOMStorageContext;
+class FilePath;
+class StorageArea;
+
+namespace WebKit {
+class WebStorageNamespace;
+}
+
+// Only to be used on the WebKit thread.
+class StorageNamespace {
+ public:
+ static StorageNamespace* CreateLocalStorageNamespace(
+ DOMStorageContext* dom_storage_context, const FilePath& data_dir_path);
+ static StorageNamespace* CreateSessionStorageNamespace(
+ DOMStorageContext* dom_storage_context);
+
+ ~StorageNamespace();
+
+ StorageArea* GetStorageArea(const string16& origin);
+ StorageNamespace* Copy();
+ void Close();
+
+ int64 id() const { return id_; }
+
+ private:
+ // Called by the static factory methods above.
+ StorageNamespace(DOMStorageContext* dom_storage_context,
+ WebKit::WebStorageNamespace* web_storage_namespace,
+ int64 id, bool is_local_storage);
+
+ // All the storage areas we own.
+ typedef base::hash_map<string16, StorageArea*> OriginToStorageAreaMap;
+ OriginToStorageAreaMap origin_to_storage_area_;
+
+ // The DOMStorageContext that owns us.
+ DOMStorageContext* dom_storage_context_;
+
+ // The WebKit storage namespace we manage.
+ WebKit::WebStorageNamespace* storage_namespace_;
+
+ // Our id. Unique to our parent WebKitContext class.
+ int64 id_;
+
+ // Is this a local storage namespace.
+ bool is_local_storage_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(StorageNamespace);
+};
+
+#endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_STORAGE_NAMESPACE_H_
Property changes on: chrome/browser/in_process_webkit/storage_namespace.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/in_process_webkit/storage_area.cc ('k') | chrome/browser/in_process_webkit/storage_namespace.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698