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

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: code review 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
« no previous file with comments | « webkit/dom_storage/dom_storage_area.h ('k') | webkit/dom_storage/dom_storage_area_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bdef8748a02a745ab8e7d147303540f90f24a2cb 100644
--- a/webkit/dom_storage/dom_storage_area.cc
+++ b/webkit/dom_storage/dom_storage_area.cc
@@ -52,23 +52,38 @@ GURL DomStorageArea::OriginFromDatabaseFileName(const FilePath& name) {
return DatabaseUtil::GetOriginFromIdentifier(origin_id);
}
-DomStorageArea::DomStorageArea(
- int64 namespace_id, const GURL& origin,
- const FilePath& directory, DomStorageTaskRunner* task_runner)
- : namespace_id_(namespace_id), origin_(origin),
+DomStorageArea::DomStorageArea(const GURL& origin, const FilePath& directory,
+ DomStorageTaskRunner* task_runner)
+ : namespace_id_(kLocalStorageNamespaceId), origin_(origin),
directory_(directory),
task_runner_(task_runner),
map_(new DomStorageMap(kPerAreaQuota + kPerAreaOverQuotaAllowance)),
is_initial_import_done_(true),
is_shutdown_(false),
commit_batches_in_flight_(0) {
- if (namespace_id == kLocalStorageNamespaceId && !directory.empty()) {
+ 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 + kPerAreaOverQuotaAllowance)),
+ is_initial_import_done_(true),
+ is_shutdown_(false),
+ commit_batches_in_flight_(0) {
+ DCHECK(namespace_id != kLocalStorageNamespaceId);
+}
+
DomStorageArea::~DomStorageArea() {
}
@@ -148,13 +163,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;
« no previous file with comments | « webkit/dom_storage/dom_storage_area.h ('k') | webkit/dom_storage/dom_storage_area_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698