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

Unified Diff: content/browser/indexed_db/indexed_db_context_impl.cc

Issue 18147009: IndexedDB: Remove unnecessary scoped_refptr<T>::get() calls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang-format Created 7 years, 6 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/indexed_db/indexed_db_context_impl.cc
diff --git a/content/browser/indexed_db/indexed_db_context_impl.cc b/content/browser/indexed_db/indexed_db_context_impl.cc
index f2706a58ff6507582860c94d66e42ac9de6ac99e..7fa0636f13ed6aabd7b41ddd38b77318ff34a16d 100644
--- a/content/browser/indexed_db/indexed_db_context_impl.cc
+++ b/content/browser/indexed_db/indexed_db_context_impl.cc
@@ -108,13 +108,13 @@ IndexedDBContextImpl::IndexedDBContextImpl(
IndexedDBFactory* IndexedDBContextImpl::GetIDBFactory() {
DCHECK(TaskRunner()->RunsTasksOnCurrentThread());
- if (!idb_factory_.get()) {
+ if (!idb_factory_) {
// Prime our cache of origins with existing databases so we can
// detect when dbs are newly created.
GetOriginSet();
idb_factory_ = IndexedDBFactory::Create();
}
- return idb_factory_.get();
+ return idb_factory_;
}
std::vector<GURL> IndexedDBContextImpl::GetAllOrigins() {
@@ -205,8 +205,7 @@ void IndexedDBContextImpl::ForceClose(const GURL& origin_url) {
}
base::FilePath IndexedDBContextImpl::GetFilePath(const GURL& origin_url) {
- std::string origin_id =
- webkit_database::GetIdentifierFromOrigin(origin_url);
+ std::string origin_id = webkit_database::GetIdentifierFromOrigin(origin_url);
return GetIndexedDBFilePath(origin_id);
}
@@ -284,12 +283,12 @@ bool IndexedDBContextImpl::IsOverQuota(const GURL& origin_url) {
}
quota::QuotaManagerProxy* IndexedDBContextImpl::quota_manager_proxy() {
- return quota_manager_proxy_.get();
+ return quota_manager_proxy_;
}
IndexedDBContextImpl::~IndexedDBContextImpl() {
- if (idb_factory_.get()) {
- IndexedDBFactory* factory = idb_factory_.get();
+ if (idb_factory_) {
+ IndexedDBFactory* factory = idb_factory_;
factory->AddRef();
idb_factory_ = NULL;
if (!task_runner_->ReleaseSoon(FROM_HERE, factory)) {
@@ -304,7 +303,7 @@ IndexedDBContextImpl::~IndexedDBContextImpl() {
return;
bool has_session_only_databases =
- special_storage_policy_.get() &&
+ special_storage_policy_ &&
special_storage_policy_->HasSessionOnlyOrigins();
// Clearning only session-only databases, and there are none.
@@ -320,16 +319,14 @@ IndexedDBContextImpl::~IndexedDBContextImpl() {
base::FilePath IndexedDBContextImpl::GetIndexedDBFilePath(
const std::string& origin_id) const {
DCHECK(!data_path_.empty());
- return data_path_.AppendASCII(origin_id).
- AddExtension(kIndexedDBExtension).
- AddExtension(kLevelDBExtension);
+ return data_path_.AppendASCII(origin_id).AddExtension(kIndexedDBExtension)
+ .AddExtension(kLevelDBExtension);
}
int64 IndexedDBContextImpl::ReadUsageFromDisk(const GURL& origin_url) const {
if (data_path_.empty())
return 0;
- std::string origin_id =
- webkit_database::GetIdentifierFromOrigin(origin_url);
+ std::string origin_id = webkit_database::GetIdentifierFromOrigin(origin_url);
base::FilePath file_path = GetIndexedDBFilePath(origin_id);
return base::ComputeDirectorySize(file_path);
}
@@ -369,13 +366,12 @@ void IndexedDBContextImpl::GotUsageAndQuota(const GURL& origin_url,
// We seem to no longer care to wait around for the answer.
return;
}
- TaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&IndexedDBContextImpl::GotUpdatedQuota,
- this,
- origin_url,
- usage,
- quota));
+ TaskRunner()->PostTask(FROM_HERE,
+ base::Bind(&IndexedDBContextImpl::GotUpdatedQuota,
+ this,
+ origin_url,
+ usage,
+ quota));
}
void IndexedDBContextImpl::GotUpdatedQuota(const GURL& origin_url,
« no previous file with comments | « content/browser/indexed_db/indexed_db_browsertest.cc ('k') | content/browser/indexed_db/indexed_db_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698