| Index: webkit/browser/dom_storage/dom_storage_namespace.cc
|
| ===================================================================
|
| --- webkit/browser/dom_storage/dom_storage_namespace.cc (revision 0)
|
| +++ webkit/browser/dom_storage/dom_storage_namespace.cc (working copy)
|
| @@ -2,16 +2,16 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "webkit/dom_storage/dom_storage_namespace.h"
|
| +#include "webkit/browser/dom_storage/dom_storage_namespace.h"
|
|
|
| #include "base/basictypes.h"
|
| #include "base/bind.h"
|
| #include "base/location.h"
|
| #include "base/logging.h"
|
| -#include "webkit/dom_storage/dom_storage_area.h"
|
| -#include "webkit/dom_storage/dom_storage_task_runner.h"
|
| -#include "webkit/dom_storage/dom_storage_types.h"
|
| -#include "webkit/dom_storage/session_storage_database.h"
|
| +#include "webkit/browser/dom_storage/dom_storage_area.h"
|
| +#include "webkit/browser/dom_storage/dom_storage_task_runner.h"
|
| +#include "webkit/browser/dom_storage/session_storage_database.h"
|
| +#include "webkit/common/dom_storage/dom_storage_types.h"
|
|
|
| namespace dom_storage {
|
|
|
| @@ -41,14 +41,15 @@
|
| DomStorageArea* DomStorageNamespace::OpenStorageArea(const GURL& origin) {
|
| if (AreaHolder* holder = GetAreaHolder(origin)) {
|
| ++(holder->open_count_);
|
| - return holder->area_;
|
| + return holder->area_.get();
|
| }
|
| DomStorageArea* area;
|
| if (namespace_id_ == kLocalStorageNamespaceId) {
|
| - area = new DomStorageArea(origin, directory_, task_runner_);
|
| + area = new DomStorageArea(origin, directory_, task_runner_.get());
|
| } else {
|
| - area = new DomStorageArea(namespace_id_, persistent_namespace_id_, origin,
|
| - session_storage_database_, task_runner_);
|
| + area = new DomStorageArea(
|
| + namespace_id_, persistent_namespace_id_, origin,
|
| + session_storage_database_.get(), task_runner_.get());
|
| }
|
| areas_[origin] = AreaHolder(area, 1);
|
| return area;
|
| @@ -66,7 +67,7 @@
|
| DomStorageArea* DomStorageNamespace::GetOpenStorageArea(const GURL& origin) {
|
| AreaHolder* holder = GetAreaHolder(origin);
|
| if (holder && holder->open_count_)
|
| - return holder->area_;
|
| + return holder->area_.get();
|
| return NULL;
|
| }
|
|
|
| @@ -77,7 +78,7 @@
|
| DCHECK_NE(kLocalStorageNamespaceId, clone_namespace_id);
|
| DomStorageNamespace* clone = new DomStorageNamespace(
|
| clone_namespace_id, clone_persistent_namespace_id,
|
| - session_storage_database_, task_runner_);
|
| + session_storage_database_.get(), task_runner_.get());
|
| AreaMap::const_iterator it = areas_.begin();
|
| // Clone the in-memory structures.
|
| for (; it != areas_.end(); ++it) {
|
| @@ -86,7 +87,7 @@
|
| clone->areas_[it->first] = AreaHolder(area, 0);
|
| }
|
| // And clone the on-disk structures, too.
|
| - if (session_storage_database_) {
|
| + if (session_storage_database_.get()) {
|
| task_runner_->PostShutdownBlockingTask(
|
| FROM_HERE,
|
| DomStorageTaskRunner::COMMIT_SEQUENCE,
|
| @@ -106,7 +107,7 @@
|
| }
|
| if (!directory_.empty()) {
|
| scoped_refptr<DomStorageArea> area =
|
| - new DomStorageArea(origin, directory_, task_runner_);
|
| + new DomStorageArea(origin, directory_, task_runner_.get());
|
| area->DeleteOrigin();
|
| }
|
| }
|
|
|