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

Unified Diff: webkit/dom_storage/dom_storage_host.h

Issue 9146025: Framing for a DOMStorage backend that does not depend on in-process-webkit. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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: webkit/dom_storage/dom_storage_host.h
===================================================================
--- webkit/dom_storage/dom_storage_host.h (revision 0)
+++ webkit/dom_storage/dom_storage_host.h (revision 0)
@@ -0,0 +1,65 @@
+// Copyright (c) 2012 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 WEBKIT_DOM_STORAGE_DOM_STORAGE_HOST_H_
+#define WEBKIT_DOM_STORAGE_DOM_STORAGE_HOST_H_
+#pragma once
+
+#include <map>
+
+#include "base/callback.h"
+#include "base/memory/ref_counted.h"
+#include "base/nullable_string16.h"
+#include "base/string16.h"
+
+class GURL;
+
+namespace dom_storage {
+
+class DomStorageContext;
+class DomStorageHost;
+class DomStorageNamespace;
+class DomStorageArea;
+
+// One instance is allocated in the main process for each client process.
+// Used by DomStorageMessageFilter in Chrome and by SimpleDomStorage in DRT.
+// This class is single threaded, and performs blocking file reads/writes,
+// so it shouldn't be used on chrome's IO thread.
+class DomStorageHost {
+ public:
+ explicit DomStorageHost(DomStorageContext* context);
+ ~DomStorageHost();
+
+ int OpenStorageArea(int namespace_id, const GURL& origin);
+ void CloseStorageArea(int connection_id);
+
+ unsigned GetAreaLength(int connection_id);
+ NullableString16 GetAreaKey(int connection_id, unsigned index);
+ NullableString16 GetAreaItem(int connection_id, const string16& key);
+ bool SetAreaItem(int connection_id, const string16& key,
+ const string16& value, const GURL& page_url,
+ NullableString16* old_value);
+ bool RemoveAreaItem(int connection_id, const string16& key,
+ const GURL& page_url,
+ string16* old_value);
+ bool ClearArea(int connection_id, const GURL& page_url);
+
+ private:
+ // Struct to hold referernces needed.
benm (inactive) 2012/02/02 16:23:19 references
michaeln 2012/02/03 00:33:42 Done.
+ struct NamespaceAndArea {
+ scoped_refptr<DomStorageNamespace> namespace_;
+ scoped_refptr<DomStorageArea> area_;
+ };
+ typedef std::map<int, NamespaceAndArea > AreaMap;
+
+ DomStorageArea* GetOpenArea(int connection_id);
+
+ int last_connection_id_;
+ scoped_refptr<DomStorageContext> context_;
+ AreaMap connections_;
+};
+
+} // namespace dom_storage
+
+#endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_HOST_H_
Property changes on: webkit\dom_storage\dom_storage_host.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698