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

Unified Diff: webkit/dom_storage/session_storage_database.h

Issue 10378066: SessionStorageDatabase: Allow writing data into a shallow copy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | « no previous file | 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 5230f370c4a3805c370bd130918f87cd265184a7..02446bbc68f82820bcebb352a2b2d3a9fd6e2344 100644
--- a/webkit/dom_storage/session_storage_database.h
+++ b/webkit/dom_storage/session_storage_database.h
@@ -44,7 +44,9 @@ class SessionStorageDatabase :
// Updates the data for |namespace_id| and |origin|. Will remove all keys
// before updating the database if |clear_all_first| is set. Then all entries
// in |changes| will be examined - keys mapped to a null NullableString16 will
- // be removed and all others will be inserted/updated as appropriate.
+ // be removed and all others will be inserted/updated as appropriate. It is
+ // allowed to write data into a shallow copy created by CloneNamespace, and in
+ // that case the copy will be made deep before writing the values.
bool CommitAreaChanges(int64 namespace_id,
const GURL& origin,
bool clear_all_first,
@@ -158,6 +160,15 @@ class SessionStorageDatabase :
// Deletes all values in |map_id|.
bool ClearMap(const std::string& map_id, leveldb::WriteBatch* batch);
+ // Breaks the association between (|namespace_id|, |origin|) and |map_id| and
+ // creates a new map for (|namespace_id|, |origin|). Copies the data from the
+ // old map if |copy_data| is true.
+ bool DeepCopyArea(int64 namespace_id,
+ const GURL& origin,
+ bool copy_data,
+ std::string* map_id,
+ leveldb::WriteBatch* batch);
+
// Helper functions for creating the keys needed for the schema.
static std::string NamespaceStartKey(const std::string& namespace_id_str);
static std::string NamespaceStartKey(int64 namespace_id,
« no previous file with comments | « no previous file | webkit/dom_storage/session_storage_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698