Chromium Code Reviews| 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; |