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

Unified Diff: webkit/dom_storage/dom_storage_area.cc

Issue 10546167: Create and store persistent unique ids for sessionStorage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 6 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_area.cc
diff --git a/webkit/dom_storage/dom_storage_area.cc b/webkit/dom_storage/dom_storage_area.cc
index ab4d5f837b282f2a1b17b4fdebf9e1ced50dfed6..3c9e8988ca1cc0fcb032d98ac6863f48e4abfff0 100644
--- a/webkit/dom_storage/dom_storage_area.cc
+++ b/webkit/dom_storage/dom_storage_area.cc
@@ -62,13 +62,30 @@ DomStorageArea::DomStorageArea(
is_initial_import_done_(true),
is_shutdown_(false),
commit_batches_in_flight_(0) {
- if (namespace_id == kLocalStorageNamespaceId && !directory.empty()) {
+ DCHECK_EQ(kLocalStorageNamespaceId, namespace_id);
+ if (!directory.empty()) {
FilePath path = directory.Append(DatabaseFileNameFromOrigin(origin_));
backing_.reset(new DomStorageDatabase(path));
is_initial_import_done_ = false;
}
}
+DomStorageArea::DomStorageArea(
+ int64 namespace_id,
+ const std::string& persistent_namespace_id,
+ const GURL& origin,
+ DomStorageTaskRunner* task_runner)
+ : namespace_id_(namespace_id),
+ persistent_namespace_id_(persistent_namespace_id),
+ origin_(origin),
+ task_runner_(task_runner),
+ map_(new DomStorageMap(kPerAreaQuota)),
michaeln 2012/06/14 22:53:48 per some more recent changes this should be (kPerA
marja 2012/06/15 09:17:42 Done.
+ is_initial_import_done_(true),
+ is_shutdown_(false),
+ commit_batches_in_flight_(0) {
+ DCHECK(namespace_id != kLocalStorageNamespaceId);
+}
+
DomStorageArea::~DomStorageArea() {
}
@@ -148,13 +165,16 @@ bool DomStorageArea::Clear() {
return true;
}
-DomStorageArea* DomStorageArea::ShallowCopy(int64 destination_namespace_id) {
+DomStorageArea* DomStorageArea::ShallowCopy(
+ int64 destination_namespace_id,
+ const std::string& destination_persistent_namespace_id) {
DCHECK_NE(kLocalStorageNamespaceId, namespace_id_);
DCHECK_NE(kLocalStorageNamespaceId, destination_namespace_id);
DCHECK(!backing_.get()); // SessionNamespaces aren't stored on disk.
- DomStorageArea* copy = new DomStorageArea(destination_namespace_id, origin_,
- FilePath(), task_runner_);
+ DomStorageArea* copy = new DomStorageArea(
+ destination_namespace_id, destination_persistent_namespace_id, origin_,
+ task_runner_);
copy->map_ = map_;
copy->is_shutdown_ = is_shutdown_;
return copy;

Powered by Google App Engine
This is Rietveld 408576698