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

Unified Diff: webkit/dom_storage/dom_storage_context.cc

Issue 16155009: Update webkit/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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_context.h ('k') | webkit/dom_storage/dom_storage_context_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_context.cc
diff --git a/webkit/dom_storage/dom_storage_context.cc b/webkit/dom_storage/dom_storage_context.cc
index ccad0897c3b0aa441af7c054b4d28c4b996c17f9..70e06e7689ea9e653198111b3c4d53aeb3937564 100644
--- a/webkit/dom_storage/dom_storage_context.cc
+++ b/webkit/dom_storage/dom_storage_context.cc
@@ -43,7 +43,7 @@ DomStorageContext::DomStorageContext(
}
DomStorageContext::~DomStorageContext() {
- if (session_storage_database_) {
+ if (session_storage_database_.get()) {
// SessionStorageDatabase shouldn't be deleted right away: deleting it will
// potentially involve waiting in leveldb::DBImpl::~DBImpl, and waiting
// shouldn't happen on this thread.
@@ -73,13 +73,13 @@ DomStorageNamespace* DomStorageContext::GetStorageNamespace(
}
}
DomStorageNamespace* local =
- new DomStorageNamespace(localstorage_directory_, task_runner_);
+ new DomStorageNamespace(localstorage_directory_, task_runner_.get());
namespaces_[kLocalStorageNamespaceId] = local;
return local;
}
return NULL;
}
- return found->second;
+ return found->second.get();
}
void DomStorageContext::GetLocalStorageUsage(
@@ -107,7 +107,7 @@ void DomStorageContext::GetLocalStorageUsage(
void DomStorageContext::GetSessionStorageUsage(
std::vector<SessionStorageUsageInfo>* infos) {
- if (!session_storage_database_)
+ if (!session_storage_database_.get())
return;
std::map<std::string, std::vector<GURL> > namespaces_and_origins;
session_storage_database_->ReadNamespacesAndOrigins(
@@ -176,7 +176,7 @@ void DomStorageContext::Shutdown() {
for (; it != namespaces_.end(); ++it)
it->second->Shutdown();
- if (localstorage_directory_.empty() && !session_storage_database_)
+ if (localstorage_directory_.empty() && !session_storage_database_.get())
return;
// Respect the content policy settings about what to
@@ -250,9 +250,11 @@ void DomStorageContext::CreateSessionNamespace(
return;
DCHECK(namespace_id != kLocalStorageNamespaceId);
DCHECK(namespaces_.find(namespace_id) == namespaces_.end());
- namespaces_[namespace_id] = new DomStorageNamespace(
- namespace_id, persistent_namespace_id, session_storage_database_.get(),
- task_runner_);
+ namespaces_[namespace_id] =
+ new DomStorageNamespace(namespace_id,
+ persistent_namespace_id,
+ session_storage_database_.get(),
+ task_runner_.get());
persistent_namespace_id_to_namespace_id_[persistent_namespace_id] =
namespace_id;
}
@@ -264,7 +266,7 @@ void DomStorageContext::DeleteSessionNamespace(
if (it == namespaces_.end())
return;
std::string persistent_namespace_id = it->second->persistent_namespace_id();
- if (session_storage_database_) {
+ if (session_storage_database_.get()) {
if (!should_persist_data) {
task_runner_->PostShutdownBlockingTask(
FROM_HERE,
@@ -321,7 +323,7 @@ void DomStorageContext::ClearSessionOnlyOrigins() {
kNotRecursive);
}
}
- if (session_storage_database_) {
+ if (session_storage_database_.get()) {
std::vector<SessionStorageUsageInfo> infos;
GetSessionStorageUsage(&infos);
for (size_t i = 0; i < infos.size(); ++i) {
@@ -345,9 +347,10 @@ void DomStorageContext::SetSaveSessionStorageOnDisk() {
}
void DomStorageContext::StartScavengingUnusedSessionStorage() {
- if (session_storage_database_) {
+ if (session_storage_database_.get()) {
task_runner_->PostDelayedTask(
- FROM_HERE, base::Bind(&DomStorageContext::FindUnusedNamespaces, this),
+ FROM_HERE,
+ base::Bind(&DomStorageContext::FindUnusedNamespaces, this),
base::TimeDelta::FromSeconds(kSessionStoraceScavengingSeconds));
}
}
« no previous file with comments | « webkit/dom_storage/dom_storage_context.h ('k') | webkit/dom_storage/dom_storage_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698