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

Unified Diff: webkit/dom_storage/session_storage_database.h

Issue 9963107: Persist sessionStorage on disk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review (pkasting) Created 8 years, 4 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
« no previous file with comments | « webkit/dom_storage/dom_storage_namespace.cc ('k') | webkit/dom_storage/session_storage_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/dom_storage/session_storage_database.h
diff --git a/webkit/dom_storage/session_storage_database.h b/webkit/dom_storage/session_storage_database.h
index 51f88d7d16686fc2193372b926c0d21438aad114..8eab8e7a88cc756211231fe5bd75f68d0a1b7cfb 100644
--- a/webkit/dom_storage/session_storage_database.h
+++ b/webkit/dom_storage/session_storage_database.h
@@ -19,6 +19,7 @@ class GURL;
namespace leveldb {
class DB;
+struct ReadOptions;
class WriteBatch;
} // namespace leveldb
@@ -27,6 +28,9 @@ namespace dom_storage {
// SessionStorageDatabase holds the data from multiple namespaces and multiple
// origins. All DomStorageAreas for session storage share the same
// SessionStorageDatabase.
+
+// Only one thread is allowed to call the public functions other than
+// ReadAreaValues. Other threads area allowed to call ReadAreaValues.
class SessionStorageDatabase :
public base::RefCountedThreadSafe<SessionStorageDatabase> {
public:
@@ -65,6 +69,10 @@ class SessionStorageDatabase :
// Reads all namespace IDs from the database.
bool ReadNamespaceIds(std::vector<std::string>* namespace_ids);
+ // Reads all origins which have data stored in |namespace_id|.
+ bool ReadOriginsInNamespace(const std::string& namespace_id,
+ std::vector<GURL>* origins);
+
private:
friend class base::RefCountedThreadSafe<SessionStorageDatabase>;
friend class SessionStorageDatabaseTest;
@@ -125,6 +133,7 @@ class SessionStorageDatabase :
// the map doesn't exist.
bool GetMapForArea(const std::string& namespace_id,
const std::string& origin,
+ const leveldb::ReadOptions& options,
bool* exists,
std::string* map_id);
@@ -140,6 +149,7 @@ class SessionStorageDatabase :
// true, only keys are aread from the database and the values in |result| will
// be empty.
bool ReadMap(const std::string& map_id,
+ const leveldb::ReadOptions& options,
ValuesMap* result,
bool only_keys);
// Writes |values| into the map |map_id|.
« no previous file with comments | « webkit/dom_storage/dom_storage_namespace.cc ('k') | webkit/dom_storage/session_storage_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698