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

Unified Diff: content/browser/dom_storage/dom_storage_context_wrapper.cc

Issue 22297005: Move webkit/{browser,common}/dom_storage into content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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: content/browser/dom_storage/dom_storage_context_wrapper.cc
diff --git a/content/browser/dom_storage/dom_storage_context_impl.cc b/content/browser/dom_storage/dom_storage_context_wrapper.cc
similarity index 62%
copy from content/browser/dom_storage/dom_storage_context_impl.cc
copy to content/browser/dom_storage/dom_storage_context_wrapper.cc
index f790ecd8001a750bec29f8337cd165f311fd8745..e96ae67bff66d74a15ddedb5478ce43efad929cf 100644
--- a/content/browser/dom_storage/dom_storage_context_impl.cc
+++ b/content/browser/dom_storage/dom_storage_context_wrapper.cc
@@ -2,22 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/dom_storage/dom_storage_context_impl.h"
+#include "content/browser/dom_storage/dom_storage_context_wrapper.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/files/file_path.h"
#include "base/message_loop/message_loop_proxy.h"
+#include "content/browser/dom_storage/dom_storage_area.h"
+#include "content/browser/dom_storage/dom_storage_context_impl.h"
+#include "content/browser/dom_storage/dom_storage_task_runner.h"
#include "content/browser/dom_storage/session_storage_namespace_impl.h"
#include "content/public/browser/browser_thread.h"
-#include "webkit/browser/dom_storage/dom_storage_area.h"
-#include "webkit/browser/dom_storage/dom_storage_context.h"
-#include "webkit/browser/dom_storage/dom_storage_task_runner.h"
-
-using dom_storage::DomStorageArea;
-using dom_storage::DomStorageContext;
-using dom_storage::DomStorageTaskRunner;
-using dom_storage::DomStorageWorkerPoolTaskRunner;
+#include "content/public/browser/local_storage_usage_info.h"
+#include "content/public/browser/session_storage_usage_info.h"
namespace content {
namespace {
@@ -27,16 +24,16 @@ const char kSessionStorageDirectory[] = "Session Storage";
void InvokeLocalStorageUsageCallbackHelper(
const DOMStorageContext::GetLocalStorageUsageCallback& callback,
- const std::vector<dom_storage::LocalStorageUsageInfo>* infos) {
+ const std::vector<LocalStorageUsageInfo>* infos) {
callback.Run(*infos);
}
void GetLocalStorageUsageHelper(
base::MessageLoopProxy* reply_loop,
- DomStorageContext* context,
+ DOMStorageContextImpl* context,
const DOMStorageContext::GetLocalStorageUsageCallback& callback) {
- std::vector<dom_storage::LocalStorageUsageInfo>* infos =
- new std::vector<dom_storage::LocalStorageUsageInfo>;
+ std::vector<LocalStorageUsageInfo>* infos =
+ new std::vector<LocalStorageUsageInfo>;
context->GetLocalStorageUsage(infos, true);
reply_loop->PostTask(
FROM_HERE,
@@ -46,16 +43,16 @@ void GetLocalStorageUsageHelper(
void InvokeSessionStorageUsageCallbackHelper(
const DOMStorageContext::GetSessionStorageUsageCallback& callback,
- const std::vector<dom_storage::SessionStorageUsageInfo>* infos) {
+ const std::vector<SessionStorageUsageInfo>* infos) {
callback.Run(*infos);
}
void GetSessionStorageUsageHelper(
base::MessageLoopProxy* reply_loop,
- DomStorageContext* context,
+ DOMStorageContextImpl* context,
const DOMStorageContext::GetSessionStorageUsageCallback& callback) {
- std::vector<dom_storage::SessionStorageUsageInfo>* infos =
- new std::vector<dom_storage::SessionStorageUsageInfo>;
+ std::vector<SessionStorageUsageInfo>* infos =
+ new std::vector<SessionStorageUsageInfo>;
context->GetSessionStorageUsage(infos);
reply_loop->PostTask(
FROM_HERE,
@@ -65,17 +62,17 @@ void GetSessionStorageUsageHelper(
} // namespace
-DOMStorageContextImpl::DOMStorageContextImpl(
+DOMStorageContextWrapper::DOMStorageContextWrapper(
const base::FilePath& data_path,
quota::SpecialStoragePolicy* special_storage_policy) {
base::SequencedWorkerPool* worker_pool = BrowserThread::GetBlockingPool();
- context_ = new dom_storage::DomStorageContext(
+ context_ = new DOMStorageContextImpl(
data_path.empty() ? data_path
: data_path.AppendASCII(kLocalStorageDirectory),
data_path.empty() ? data_path
: data_path.AppendASCII(kSessionStorageDirectory),
special_storage_policy,
- new DomStorageWorkerPoolTaskRunner(
+ new DOMStorageWorkerPoolTaskRunner(
worker_pool,
worker_pool->GetNamedSequenceToken("dom_storage_primary"),
worker_pool->GetNamedSequenceToken("dom_storage_commit"),
@@ -83,94 +80,94 @@ DOMStorageContextImpl::DOMStorageContextImpl(
.get()));
}
-DOMStorageContextImpl::~DOMStorageContextImpl() {
+DOMStorageContextWrapper::~DOMStorageContextWrapper() {
}
-void DOMStorageContextImpl::GetLocalStorageUsage(
+void DOMStorageContextWrapper::GetLocalStorageUsage(
const GetLocalStorageUsageCallback& callback) {
DCHECK(context_.get());
context_->task_runner()
->PostShutdownBlockingTask(FROM_HERE,
- DomStorageTaskRunner::PRIMARY_SEQUENCE,
+ DOMStorageTaskRunner::PRIMARY_SEQUENCE,
base::Bind(&GetLocalStorageUsageHelper,
base::MessageLoopProxy::current(),
context_,
callback));
}
-void DOMStorageContextImpl::GetSessionStorageUsage(
+void DOMStorageContextWrapper::GetSessionStorageUsage(
const GetSessionStorageUsageCallback& callback) {
DCHECK(context_.get());
context_->task_runner()
->PostShutdownBlockingTask(FROM_HERE,
- DomStorageTaskRunner::PRIMARY_SEQUENCE,
+ DOMStorageTaskRunner::PRIMARY_SEQUENCE,
base::Bind(&GetSessionStorageUsageHelper,
base::MessageLoopProxy::current(),
context_,
callback));
}
-void DOMStorageContextImpl::DeleteLocalStorage(const GURL& origin) {
+void DOMStorageContextWrapper::DeleteLocalStorage(const GURL& origin) {
DCHECK(context_.get());
context_->task_runner()->PostShutdownBlockingTask(
FROM_HERE,
- DomStorageTaskRunner::PRIMARY_SEQUENCE,
- base::Bind(&DomStorageContext::DeleteLocalStorage, context_, origin));
+ DOMStorageTaskRunner::PRIMARY_SEQUENCE,
+ base::Bind(&DOMStorageContextImpl::DeleteLocalStorage, context_, origin));
}
-void DOMStorageContextImpl::DeleteSessionStorage(
- const dom_storage::SessionStorageUsageInfo& usage_info) {
+void DOMStorageContextWrapper::DeleteSessionStorage(
+ const SessionStorageUsageInfo& usage_info) {
DCHECK(context_.get());
context_->task_runner()->PostShutdownBlockingTask(
FROM_HERE,
- DomStorageTaskRunner::PRIMARY_SEQUENCE,
- base::Bind(
- &DomStorageContext::DeleteSessionStorage, context_, usage_info));
+ DOMStorageTaskRunner::PRIMARY_SEQUENCE,
+ base::Bind(&DOMStorageContextImpl::DeleteSessionStorage,
+ context_, usage_info));
}
-void DOMStorageContextImpl::SetSaveSessionStorageOnDisk() {
+void DOMStorageContextWrapper::SetSaveSessionStorageOnDisk() {
DCHECK(context_.get());
context_->SetSaveSessionStorageOnDisk();
}
scoped_refptr<SessionStorageNamespace>
-DOMStorageContextImpl::RecreateSessionStorage(
+DOMStorageContextWrapper::RecreateSessionStorage(
const std::string& persistent_id) {
return scoped_refptr<SessionStorageNamespace>(
new SessionStorageNamespaceImpl(this, persistent_id));
}
-void DOMStorageContextImpl::StartScavengingUnusedSessionStorage() {
+void DOMStorageContextWrapper::StartScavengingUnusedSessionStorage() {
DCHECK(context_.get());
context_->task_runner()->PostShutdownBlockingTask(
FROM_HERE,
- DomStorageTaskRunner::PRIMARY_SEQUENCE,
- base::Bind(&DomStorageContext::StartScavengingUnusedSessionStorage,
+ DOMStorageTaskRunner::PRIMARY_SEQUENCE,
+ base::Bind(&DOMStorageContextImpl::StartScavengingUnusedSessionStorage,
context_));
}
-void DOMStorageContextImpl::PurgeMemory() {
+void DOMStorageContextWrapper::PurgeMemory() {
DCHECK(context_.get());
context_->task_runner()->PostShutdownBlockingTask(
FROM_HERE,
- DomStorageTaskRunner::PRIMARY_SEQUENCE,
- base::Bind(&DomStorageContext::PurgeMemory, context_));
+ DOMStorageTaskRunner::PRIMARY_SEQUENCE,
+ base::Bind(&DOMStorageContextImpl::PurgeMemory, context_));
}
-void DOMStorageContextImpl::SetForceKeepSessionState() {
+void DOMStorageContextWrapper::SetForceKeepSessionState() {
DCHECK(context_.get());
context_->task_runner()->PostShutdownBlockingTask(
FROM_HERE,
- DomStorageTaskRunner::PRIMARY_SEQUENCE,
- base::Bind(&DomStorageContext::SetForceKeepSessionState, context_));
+ DOMStorageTaskRunner::PRIMARY_SEQUENCE,
+ base::Bind(&DOMStorageContextImpl::SetForceKeepSessionState, context_));
}
-void DOMStorageContextImpl::Shutdown() {
+void DOMStorageContextWrapper::Shutdown() {
DCHECK(context_.get());
context_->task_runner()->PostShutdownBlockingTask(
FROM_HERE,
- DomStorageTaskRunner::PRIMARY_SEQUENCE,
- base::Bind(&DomStorageContext::Shutdown, context_));
+ DOMStorageTaskRunner::PRIMARY_SEQUENCE,
+ base::Bind(&DOMStorageContextImpl::Shutdown, context_));
}
} // namespace content
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_wrapper.h ('k') | content/browser/dom_storage/dom_storage_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698