| 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;
|
|
|