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( ...@@ -278,7 +278,7 @@ void DOMStorageContextImpl::DeleteSessionNamespace(
} else { } else {
if (should_persist_data) if (should_persist_data)
it->second->set_must_persist_at_shutdown(true); it->second->set_must_persist_at_shutdown(true);
MaybeShutdownSessionNamespace(it->second); MaybeShutdownSessionNamespace(it->second.get());
} }
} }
...@@ -485,11 +485,11 @@ DOMStorageContextImpl::MergeSessionStorage( ...@@ -485,11 +485,11 @@ DOMStorageContextImpl::MergeSessionStorage(
StorageNamespaceMap::const_iterator it = namespaces_.find(namespace1_id); StorageNamespaceMap::const_iterator it = namespaces_.find(namespace1_id);
if (it == namespaces_.end()) if (it == namespaces_.end())
return SessionStorageNamespace::MERGE_RESULT_NAMESPACE_NOT_FOUND; return SessionStorageNamespace::MERGE_RESULT_NAMESPACE_NOT_FOUND;
DOMStorageNamespace* ns1 = it->second; DOMStorageNamespace* ns1 = it->second.get();
it = namespaces_.find(namespace2_id); it = namespaces_.find(namespace2_id);
if (it == namespaces_.end()) if (it == namespaces_.end())
return SessionStorageNamespace::MERGE_RESULT_NAMESPACE_NOT_FOUND; 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); return ns1->Merge(actually_merge, process_id, ns2, this);
} }
......
...@@ -63,7 +63,7 @@ DOMStorageNamespace::~DOMStorageNamespace() { ...@@ -63,7 +63,7 @@ DOMStorageNamespace::~DOMStorageNamespace() {
} }
DOMStorageArea* DOMStorageNamespace::OpenStorageArea(const GURL& origin) { DOMStorageArea* DOMStorageNamespace::OpenStorageArea(const GURL& origin) {
if (alias_master_namespace_) if (alias_master_namespace_.get())
return alias_master_namespace_->OpenStorageArea(origin); return alias_master_namespace_->OpenStorageArea(origin);
if (AreaHolder* holder = GetAreaHolder(origin)) { if (AreaHolder* holder = GetAreaHolder(origin)) {
++(holder->open_count_); ++(holder->open_count_);
...@@ -83,7 +83,7 @@ DOMStorageArea* DOMStorageNamespace::OpenStorageArea(const GURL& origin) { ...@@ -83,7 +83,7 @@ DOMStorageArea* DOMStorageNamespace::OpenStorageArea(const GURL& origin) {
void DOMStorageNamespace::CloseStorageArea(DOMStorageArea* area) { void DOMStorageNamespace::CloseStorageArea(DOMStorageArea* area) {
AreaHolder* holder = GetAreaHolder(area->origin()); AreaHolder* holder = GetAreaHolder(area->origin());
if (alias_master_namespace_) { if (alias_master_namespace_.get()) {
DCHECK(!holder); DCHECK(!holder);
if (old_master_for_close_area_) if (old_master_for_close_area_)
old_master_for_close_area_->CloseStorageArea(area); old_master_for_close_area_->CloseStorageArea(area);
...@@ -99,7 +99,7 @@ void DOMStorageNamespace::CloseStorageArea(DOMStorageArea* area) { ...@@ -99,7 +99,7 @@ void DOMStorageNamespace::CloseStorageArea(DOMStorageArea* area) {
} }
DOMStorageArea* DOMStorageNamespace::GetOpenStorageArea(const GURL& origin) { DOMStorageArea* DOMStorageNamespace::GetOpenStorageArea(const GURL& origin) {
if (alias_master_namespace_) if (alias_master_namespace_.get())
return alias_master_namespace_->GetOpenStorageArea(origin); return alias_master_namespace_->GetOpenStorageArea(origin);
AreaHolder* holder = GetAreaHolder(origin); AreaHolder* holder = GetAreaHolder(origin);
if (holder && holder->open_count_) if (holder && holder->open_count_)
...@@ -110,7 +110,7 @@ DOMStorageArea* DOMStorageNamespace::GetOpenStorageArea(const GURL& origin) { ...@@ -110,7 +110,7 @@ DOMStorageArea* DOMStorageNamespace::GetOpenStorageArea(const GURL& origin) {
DOMStorageNamespace* DOMStorageNamespace::Clone( DOMStorageNamespace* DOMStorageNamespace::Clone(
int64 clone_namespace_id, int64 clone_namespace_id,
const std::string& clone_persistent_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, return alias_master_namespace_->Clone(clone_namespace_id,
clone_persistent_namespace_id); clone_persistent_namespace_id);
} }
...@@ -153,8 +153,8 @@ DOMStorageNamespace* DOMStorageNamespace::CreateAlias( ...@@ -153,8 +153,8 @@ DOMStorageNamespace* DOMStorageNamespace::CreateAlias(
DOMStorageNamespace* alias = new DOMStorageNamespace( DOMStorageNamespace* alias = new DOMStorageNamespace(
alias_namespace_id, persistent_namespace_id_, alias_namespace_id, persistent_namespace_id_,
session_storage_database_.get(), task_runner_.get()); session_storage_database_.get(), task_runner_.get());
if (alias_master_namespace_ != NULL) { if (alias_master_namespace_.get() != NULL) {
DCHECK(alias_master_namespace_->alias_master_namespace_ == NULL); DCHECK(alias_master_namespace_->alias_master_namespace_.get() == NULL);
alias->alias_master_namespace_ = alias_master_namespace_; alias->alias_master_namespace_ = alias_master_namespace_;
} else { } else {
alias->alias_master_namespace_ = this; alias->alias_master_namespace_ = this;
...@@ -179,7 +179,7 @@ void DOMStorageNamespace::DeleteLocalStorageOrigin(const GURL& origin) { ...@@ -179,7 +179,7 @@ void DOMStorageNamespace::DeleteLocalStorageOrigin(const GURL& origin) {
} }
void DOMStorageNamespace::DeleteSessionStorageOrigin(const GURL& origin) { void DOMStorageNamespace::DeleteSessionStorageOrigin(const GURL& origin) {
if (alias_master_namespace_) { if (alias_master_namespace_.get()) {
alias_master_namespace_->DeleteSessionStorageOrigin(origin); alias_master_namespace_->DeleteSessionStorageOrigin(origin);
return; return;
} }
...@@ -189,7 +189,7 @@ void DOMStorageNamespace::DeleteSessionStorageOrigin(const GURL& origin) { ...@@ -189,7 +189,7 @@ void DOMStorageNamespace::DeleteSessionStorageOrigin(const GURL& origin) {
} }
void DOMStorageNamespace::PurgeMemory(PurgeOption option) { void DOMStorageNamespace::PurgeMemory(PurgeOption option) {
if (alias_master_namespace_) { if (alias_master_namespace_.get()) {
alias_master_namespace_->PurgeMemory(option); alias_master_namespace_->PurgeMemory(option);
return; return;
} }
...@@ -228,7 +228,7 @@ void DOMStorageNamespace::Shutdown() { ...@@ -228,7 +228,7 @@ void DOMStorageNamespace::Shutdown() {
} }
unsigned int DOMStorageNamespace::CountInMemoryAreas() const { unsigned int DOMStorageNamespace::CountInMemoryAreas() const {
if (alias_master_namespace_) if (alias_master_namespace_.get())
return alias_master_namespace_->CountInMemoryAreas(); return alias_master_namespace_->CountInMemoryAreas();
unsigned int area_count = 0; unsigned int area_count = 0;
for (AreaMap::const_iterator it = areas_.begin(); it != areas_.end(); ++it) { for (AreaMap::const_iterator it = areas_.begin(); it != areas_.end(); ++it) {
...@@ -375,7 +375,7 @@ void DOMStorageNamespace::AddTransaction( ...@@ -375,7 +375,7 @@ void DOMStorageNamespace::AddTransaction(
} }
bool DOMStorageNamespace::DecrementMasterAliasCount() { bool DOMStorageNamespace::DecrementMasterAliasCount() {
if (!alias_master_namespace_ || master_alias_count_decremented_) if (!alias_master_namespace_.get() || master_alias_count_decremented_)
return false; return false;
DCHECK_GT(alias_master_namespace_->num_aliases_, 0); DCHECK_GT(alias_master_namespace_->num_aliases_, 0);
alias_master_namespace_->num_aliases_--; alias_master_namespace_->num_aliases_--;
...@@ -391,8 +391,8 @@ void DOMStorageNamespace::SwitchToNewAliasMaster( ...@@ -391,8 +391,8 @@ void DOMStorageNamespace::SwitchToNewAliasMaster(
if (new_master->alias_master_namespace()) if (new_master->alias_master_namespace())
new_master = new_master->alias_master_namespace(); new_master = new_master->alias_master_namespace();
DCHECK(!new_master->alias_master_namespace()); DCHECK(!new_master->alias_master_namespace());
DCHECK(old_master != this); DCHECK(old_master.get() != this);
DCHECK(old_master != new_master); DCHECK(old_master.get() != new_master);
DecrementMasterAliasCount(); DecrementMasterAliasCount();
alias_master_namespace_ = new_master; alias_master_namespace_ = new_master;
alias_master_namespace_->num_aliases_++; alias_master_namespace_->num_aliases_++;
......
...@@ -28,7 +28,7 @@ SessionStorageNamespaceImpl::SessionStorageNamespaceImpl( ...@@ -28,7 +28,7 @@ SessionStorageNamespaceImpl::SessionStorageNamespaceImpl(
SessionStorageNamespaceImpl::SessionStorageNamespaceImpl( SessionStorageNamespaceImpl::SessionStorageNamespaceImpl(
SessionStorageNamespaceImpl* master_session_storage_namespace) SessionStorageNamespaceImpl* master_session_storage_namespace)
: session_(new DOMStorageSession( : session_(new DOMStorageSession(
master_session_storage_namespace->session_)) { master_session_storage_namespace->session_.get())) {
} }
...@@ -81,7 +81,8 @@ void SessionStorageNamespaceImpl::Merge( ...@@ -81,7 +81,8 @@ void SessionStorageNamespaceImpl::Merge(
const MergeResultCallback& callback) { const MergeResultCallback& callback) {
SessionStorageNamespaceImpl* other_impl = SessionStorageNamespaceImpl* other_impl =
static_cast<SessionStorageNamespaceImpl*>(other); 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) { 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