Commit c6593cdd authored by dcheng's avatar dcheng Committed by Commit bot

Remove implicit conversions from scoped_refptr to T* in content/browser/dom_storage/

This patch was generated by running the rewrite_scoped_refptr clang tool
on a Linux build.

BUG=110610

Review URL: https://codereview.chromium.org/506083002

Cr-Commit-Position: refs/heads/master@{#292013}
parent 319a2195
......@@ -278,7 +278,7 @@ void DOMStorageContextImpl::DeleteSessionNamespace(
} else {
if (should_persist_data)
it->second->set_must_persist_at_shutdown(true);
MaybeShutdownSessionNamespace(it->second);
MaybeShutdownSessionNamespace(it->second.get());
}
}
......@@ -485,11 +485,11 @@ DOMStorageContextImpl::MergeSessionStorage(
StorageNamespaceMap::const_iterator it = namespaces_.find(namespace1_id);
if (it == namespaces_.end())
return SessionStorageNamespace::MERGE_RESULT_NAMESPACE_NOT_FOUND;
DOMStorageNamespace* ns1 = it->second;
DOMStorageNamespace* ns1 = it->second.get();
it = namespaces_.find(namespace2_id);
if (it == namespaces_.end())
return SessionStorageNamespace::MERGE_RESULT_NAMESPACE_NOT_FOUND;
DOMStorageNamespace* ns2 = it->second;
DOMStorageNamespace* ns2 = it->second.get();
return ns1->Merge(actually_merge, process_id, ns2, this);
}
......
......@@ -63,7 +63,7 @@ DOMStorageNamespace::~DOMStorageNamespace() {
}
DOMStorageArea* DOMStorageNamespace::OpenStorageArea(const GURL& origin) {
if (alias_master_namespace_)
if (alias_master_namespace_.get())
return alias_master_namespace_->OpenStorageArea(origin);
if (AreaHolder* holder = GetAreaHolder(origin)) {
++(holder->open_count_);
......@@ -83,7 +83,7 @@ DOMStorageArea* DOMStorageNamespace::OpenStorageArea(const GURL& origin) {
void DOMStorageNamespace::CloseStorageArea(DOMStorageArea* area) {
AreaHolder* holder = GetAreaHolder(area->origin());
if (alias_master_namespace_) {
if (alias_master_namespace_.get()) {
DCHECK(!holder);
if (old_master_for_close_area_)
old_master_for_close_area_->CloseStorageArea(area);
......@@ -99,7 +99,7 @@ void DOMStorageNamespace::CloseStorageArea(DOMStorageArea* area) {
}
DOMStorageArea* DOMStorageNamespace::GetOpenStorageArea(const GURL& origin) {
if (alias_master_namespace_)
if (alias_master_namespace_.get())
return alias_master_namespace_->GetOpenStorageArea(origin);
AreaHolder* holder = GetAreaHolder(origin);
if (holder && holder->open_count_)
......@@ -110,7 +110,7 @@ DOMStorageArea* DOMStorageNamespace::GetOpenStorageArea(const GURL& origin) {
DOMStorageNamespace* DOMStorageNamespace::Clone(
int64 clone_namespace_id,
const std::string& clone_persistent_namespace_id) {
if (alias_master_namespace_) {
if (alias_master_namespace_.get()) {
return alias_master_namespace_->Clone(clone_namespace_id,
clone_persistent_namespace_id);
}
......@@ -153,8 +153,8 @@ DOMStorageNamespace* DOMStorageNamespace::CreateAlias(
DOMStorageNamespace* alias = new DOMStorageNamespace(
alias_namespace_id, persistent_namespace_id_,
session_storage_database_.get(), task_runner_.get());
if (alias_master_namespace_ != NULL) {
DCHECK(alias_master_namespace_->alias_master_namespace_ == NULL);
if (alias_master_namespace_.get() != NULL) {
DCHECK(alias_master_namespace_->alias_master_namespace_.get() == NULL);
alias->alias_master_namespace_ = alias_master_namespace_;
} else {
alias->alias_master_namespace_ = this;
......@@ -179,7 +179,7 @@ void DOMStorageNamespace::DeleteLocalStorageOrigin(const GURL& origin) {
}
void DOMStorageNamespace::DeleteSessionStorageOrigin(const GURL& origin) {
if (alias_master_namespace_) {
if (alias_master_namespace_.get()) {
alias_master_namespace_->DeleteSessionStorageOrigin(origin);
return;
}
......@@ -189,7 +189,7 @@ void DOMStorageNamespace::DeleteSessionStorageOrigin(const GURL& origin) {
}
void DOMStorageNamespace::PurgeMemory(PurgeOption option) {
if (alias_master_namespace_) {
if (alias_master_namespace_.get()) {
alias_master_namespace_->PurgeMemory(option);
return;
}
......@@ -228,7 +228,7 @@ void DOMStorageNamespace::Shutdown() {
}
unsigned int DOMStorageNamespace::CountInMemoryAreas() const {
if (alias_master_namespace_)
if (alias_master_namespace_.get())
return alias_master_namespace_->CountInMemoryAreas();
unsigned int area_count = 0;
for (AreaMap::const_iterator it = areas_.begin(); it != areas_.end(); ++it) {
......@@ -375,7 +375,7 @@ void DOMStorageNamespace::AddTransaction(
}
bool DOMStorageNamespace::DecrementMasterAliasCount() {
if (!alias_master_namespace_ || master_alias_count_decremented_)
if (!alias_master_namespace_.get() || master_alias_count_decremented_)
return false;
DCHECK_GT(alias_master_namespace_->num_aliases_, 0);
alias_master_namespace_->num_aliases_--;
......@@ -391,8 +391,8 @@ void DOMStorageNamespace::SwitchToNewAliasMaster(
if (new_master->alias_master_namespace())
new_master = new_master->alias_master_namespace();
DCHECK(!new_master->alias_master_namespace());
DCHECK(old_master != this);
DCHECK(old_master != new_master);
DCHECK(old_master.get() != this);
DCHECK(old_master.get() != new_master);
DecrementMasterAliasCount();
alias_master_namespace_ = new_master;
alias_master_namespace_->num_aliases_++;
......
......@@ -28,7 +28,7 @@ SessionStorageNamespaceImpl::SessionStorageNamespaceImpl(
SessionStorageNamespaceImpl::SessionStorageNamespaceImpl(
SessionStorageNamespaceImpl* master_session_storage_namespace)
: session_(new DOMStorageSession(
master_session_storage_namespace->session_)) {
master_session_storage_namespace->session_.get())) {
}
......@@ -81,7 +81,8 @@ void SessionStorageNamespaceImpl::Merge(
const MergeResultCallback& callback) {
SessionStorageNamespaceImpl* other_impl =
static_cast<SessionStorageNamespaceImpl*>(other);
session_->Merge(actually_merge, process_id, other_impl->session_, callback);
session_->Merge(
actually_merge, process_id, other_impl->session_.get(), callback);
}
bool SessionStorageNamespaceImpl::IsAliasOf(SessionStorageNamespace* other) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment