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

Unified Diff: chrome/browser/in_process_webkit/storage_area.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_area.h
===================================================================
--- chrome/browser/in_process_webkit/storage_area.h (revision 0)
+++ chrome/browser/in_process_webkit/storage_area.h (revision 0)
@@ -0,0 +1,59 @@
+// 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_AREA_H_
+#define CHROME_BROWSER_IN_PROCESS_WEBKIT_STORAGE_AREA_H_
+
+#include "base/hash_tables.h"
+#include "base/nullable_string16.h"
+
+namespace WebKit {
+class WebStorageArea;
+}
+
+// Only use on the WebKit thread. StorageNamespace manages our registration
+// with DOMStorageContext.
+class StorageArea {
+ public:
+ StorageArea(const string16& origin, WebKit::WebStorageArea* storage_area,
+ int64 id);
+ ~StorageArea();
+
+ unsigned Length();
+ NullableString16 Key(unsigned index);
+ NullableString16 GetItem(const string16& key);
+ void SetItem(const string16& key, const string16& value,
+ bool* quota_xception);
+ void RemoveItem(const string16& key);
+ void Clear();
+
+ int64 id() const { return id_; }
+
+ private:
+ // The origin this storage area represents.
+ string16 origin_;
+
+ // The storage area we wrap.
+ WebKit::WebStorageArea* storage_area_;
+
+ // Our storage area id. Unique to our parent WebKitContext.
+ int64 id_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(StorageArea);
+};
+
+#if defined(COMPILER_GCC)
+namespace __gnu_cxx {
+
+template<>
+struct hash<StorageArea*> {
+ std::size_t operator()(StorageArea* const& p) const {
+ return reinterpret_cast<std::size_t>(p);
+ }
+};
+
+} // namespace __gnu_cxx
+#endif
+
+#endif // CHROME_BROWSER_IN_PROCESS_WEBKIT_STORAGE_AREA_H_
Property changes on: chrome/browser/in_process_webkit/storage_area.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc ('k') | chrome/browser/in_process_webkit/storage_area.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698