summaryrefslogtreecommitdiffstats
path: root/content/browser
diff options
context:
space:
mode:
authorjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-03 09:49:02 +0000
committerjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-03 09:49:02 +0000
commit21827884637cbc9bee867181fdc7140436f7d92e (patch)
tree8e4265506553116226ba1a93c809663b7715f47a /content/browser
parent40e63cfc9c6fbeb3cad14a3cdba9f1ce6c9179a2 (diff)
downloadchromium_src-21827884637cbc9bee867181fdc7140436f7d92e.zip
chromium_src-21827884637cbc9bee867181fdc7140436f7d92e.tar.gz
chromium_src-21827884637cbc9bee867181fdc7140436f7d92e.tar.bz2
IndexedDB: Remove unnecessary scoped_refptr<T>::get() calls
scoped_refptr<T> with implicitly cast to T* so most explicit .get() calls can be removed. Most of these are from the Blink migration. Review URL: https://chromiumcodereview.appspot.com/18147009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209939 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r--content/browser/indexed_db/indexed_db_backing_store.h8
-rw-r--r--content/browser/indexed_db/indexed_db_backing_store_unittest.cc19
-rw-r--r--content/browser/indexed_db/indexed_db_browsertest.cc12
-rw-r--r--content/browser/indexed_db/indexed_db_context_impl.cc36
-rw-r--r--content/browser/indexed_db/indexed_db_database.cc18
-rw-r--r--content/browser/indexed_db/indexed_db_database_unittest.cc23
-rw-r--r--content/browser/indexed_db/indexed_db_dispatcher_host.cc2
-rw-r--r--content/browser/indexed_db/indexed_db_dispatcher_host.h2
-rw-r--r--content/browser/indexed_db/indexed_db_factory.cc22
-rw-r--r--content/browser/indexed_db/indexed_db_internals_ui.cc5
-rw-r--r--content/browser/indexed_db/indexed_db_quota_client.cc16
-rw-r--r--content/browser/indexed_db/indexed_db_quota_client_unittest.cc12
-rw-r--r--content/browser/indexed_db/indexed_db_transaction.h17
-rw-r--r--content/browser/indexed_db/indexed_db_unittest.cc26
14 files changed, 94 insertions, 124 deletions
diff --git a/content/browser/indexed_db/indexed_db_backing_store.h b/content/browser/indexed_db/indexed_db_backing_store.h
index ef10006..65f210c 100644
--- a/content/browser/indexed_db/indexed_db_backing_store.h
+++ b/content/browser/indexed_db/indexed_db_backing_store.h
@@ -109,9 +109,9 @@ class CONTENT_EXPORT IndexedDBBackingStore
}
private:
- std::vector<char>
- primary_key_; // TODO(jsbell): Make it more clear that this is
- // the *encoded* version of the key.
+ // TODO(jsbell): Make it more clear that this is the *encoded* version of
+ // the key.
+ std::vector<char> primary_key_;
int64 version_;
DISALLOW_COPY_AND_ASSIGN(RecordIdentifier);
};
@@ -280,7 +280,7 @@ class CONTENT_EXPORT IndexedDBBackingStore
static LevelDBTransaction* LevelDBTransactionFrom(
Transaction* transaction) {
- return transaction->transaction_.get();
+ return transaction->transaction_;
}
private:
diff --git a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
index ebeb6e0..edd8729 100644
--- a/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_backing_store_unittest.cc
@@ -58,7 +58,7 @@ class IndexedDBBackingStoreTest : public testing::Test {
TEST_F(IndexedDBBackingStoreTest, PutGetConsistency) {
{
- IndexedDBBackingStore::Transaction transaction1(backing_store_.get());
+ IndexedDBBackingStore::Transaction transaction1(backing_store_);
transaction1.Begin();
IndexedDBBackingStore::RecordIdentifier record;
bool ok = backing_store_->PutRecord(
@@ -68,7 +68,7 @@ TEST_F(IndexedDBBackingStoreTest, PutGetConsistency) {
}
{
- IndexedDBBackingStore::Transaction transaction2(backing_store_.get());
+ IndexedDBBackingStore::Transaction transaction2(backing_store_);
transaction2.Begin();
std::vector<char> result_value;
bool ok =
@@ -93,7 +93,7 @@ TEST_F(IndexedDBBackingStoreTest, HighIds) {
std::vector<char> index_key_raw;
EncodeIDBKey(index_key, &index_key_raw);
{
- IndexedDBBackingStore::Transaction transaction1(backing_store_.get());
+ IndexedDBBackingStore::Transaction transaction1(backing_store_);
transaction1.Begin();
IndexedDBBackingStore::RecordIdentifier record;
bool ok = backing_store_->PutRecord(&transaction1,
@@ -125,7 +125,7 @@ TEST_F(IndexedDBBackingStoreTest, HighIds) {
}
{
- IndexedDBBackingStore::Transaction transaction2(backing_store_.get());
+ IndexedDBBackingStore::Transaction transaction2(backing_store_);
transaction2.Begin();
std::vector<char> result_value;
bool ok = backing_store_->GetRecord(&transaction2,
@@ -169,7 +169,7 @@ TEST_F(IndexedDBBackingStoreTest, InvalidIds) {
std::vector<char> result_value;
- IndexedDBBackingStore::Transaction transaction1(backing_store_.get());
+ IndexedDBBackingStore::Transaction transaction1(backing_store_);
transaction1.Begin();
IndexedDBBackingStore::RecordIdentifier record;
@@ -269,7 +269,7 @@ TEST_F(IndexedDBBackingStoreTest, CreateDatabase) {
EXPECT_TRUE(ok);
EXPECT_GT(database_id, 0);
- IndexedDBBackingStore::Transaction transaction(backing_store_.get());
+ IndexedDBBackingStore::Transaction transaction(backing_store_);
transaction.Begin();
ok = backing_store_->CreateObjectStore(&transaction,
@@ -406,8 +406,7 @@ TEST(IndexedDBFactoryTest, MemoryBackingStoreLifetime) {
EXPECT_TRUE(mem_store1->HasOneRef());
}
-TEST(IndexedDBFactoryTest, RejectLongOrigins)
-{
+TEST(IndexedDBFactoryTest, RejectLongOrigins) {
base::ScopedTempDir temp_directory;
ASSERT_TRUE(temp_directory.CreateUniqueTempDir());
const base::FilePath base_path = temp_directory.path();
@@ -422,13 +421,13 @@ TEST(IndexedDBFactoryTest, RejectLongOrigins)
std::string("http://" + origin + ":81/").c_str()));
scoped_refptr<IndexedDBBackingStore> diskStore1 =
factory->TestOpenBackingStore(too_long_origin, base_path);
- EXPECT_FALSE(diskStore1.get());
+ EXPECT_FALSE(diskStore1);
WebSecurityOrigin ok_origin =
WebSecurityOrigin::createFromString("http://someorigin.com:82/");
scoped_refptr<IndexedDBBackingStore> diskStore2 =
factory->TestOpenBackingStore(ok_origin, base_path);
- EXPECT_TRUE(diskStore2.get());
+ EXPECT_TRUE(diskStore2);
}
} // namespace
diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc
index d4f5ec1..d24cf37 100644
--- a/content/browser/indexed_db/indexed_db_browsertest.cc
+++ b/content/browser/indexed_db/indexed_db_browsertest.cc
@@ -77,7 +77,7 @@ class IndexedDBBrowserTest : public ContentBrowserTest {
BrowserContext::GetDefaultStoragePartition(
shell()->web_contents()->GetBrowserContext());
return static_cast<IndexedDBContextImpl*>(partition->GetIndexedDBContext());
- };
+ }
void SetQuota(int quotaKilobytes) {
const int kTemporaryStorageQuotaSize = quotaKilobytes
@@ -98,7 +98,7 @@ class IndexedDBBrowserTest : public ContentBrowserTest {
qm->SetTemporaryGlobalOverrideQuota(bytes, quota::QuotaCallback());
// Don't return until the quota has been set.
scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper(
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB).get()));
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB)));
ASSERT_TRUE(helper->Run());
}
@@ -111,8 +111,8 @@ class IndexedDBBrowserTest : public ContentBrowserTest {
GURL("file:///")),
base::Bind(&IndexedDBBrowserTest::DidGetDiskUsage, this));
scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper(
- BrowserMainLoop::GetInstance()->indexed_db_thread()
- ->message_loop_proxy().get()));
+ BrowserMainLoop::GetInstance()->indexed_db_thread()->
+ message_loop_proxy()));
EXPECT_TRUE(helper->Run());
// Wait for DidGetDiskUsage to be called.
base::MessageLoop::current()->RunUntilIdle();
@@ -257,8 +257,8 @@ class IndexedDBBrowserTestWithPreexistingLevelDB : public IndexedDBBrowserTest {
base::Bind(
&CopyLevelDBToProfile, shell(), context, EnclosingLevelDBDir()));
scoped_refptr<base::ThreadTestHelper> helper(new base::ThreadTestHelper(
- BrowserMainLoop::GetInstance()->indexed_db_thread()
- ->message_loop_proxy().get()));
+ BrowserMainLoop::GetInstance()->indexed_db_thread()->
+ message_loop_proxy()));
ASSERT_TRUE(helper->Run());
}
diff --git a/content/browser/indexed_db/indexed_db_context_impl.cc b/content/browser/indexed_db/indexed_db_context_impl.cc
index f2706a5..7fa0636 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,
diff --git a/content/browser/indexed_db/indexed_db_database.cc b/content/browser/indexed_db/indexed_db_database.cc
index 0f2742c..9be8ea8 100644
--- a/content/browser/indexed_db/indexed_db_database.cc
+++ b/content/browser/indexed_db/indexed_db_database.cc
@@ -1032,7 +1032,7 @@ void PutOperation::Perform(IndexedDBTransaction* transaction) {
string16 error_message;
bool obeys_constraints = false;
bool backing_store_success = MakeIndexWriters(transaction,
- backing_store_.get(),
+ backing_store_,
database_id_,
object_store_,
*key,
@@ -1073,7 +1073,7 @@ void PutOperation::Perform(IndexedDBTransaction* transaction) {
for (size_t i = 0; i < index_writers.size(); ++i) {
IndexWriter* index_writer = index_writers[i];
index_writer->WriteIndexKeys(record_identifier,
- backing_store_.get(),
+ backing_store_,
transaction->BackingStoreTransaction(),
database_id_,
object_store_.id);
@@ -1145,7 +1145,7 @@ void IndexedDBDatabase::SetIndexKeys(int64 transaction_id,
const IndexedDBObjectStoreMetadata& object_store_metadata =
metadata_.object_stores[object_store_id];
bool backing_store_success = MakeIndexWriters(transaction,
- store.get(),
+ store,
id(),
object_store_metadata,
*primary_key,
@@ -1170,7 +1170,7 @@ void IndexedDBDatabase::SetIndexKeys(int64 transaction_id,
for (size_t i = 0; i < index_writers.size(); ++i) {
IndexWriter* index_writer = index_writers[i];
index_writer->WriteIndexKeys(record_identifier,
- store.get(),
+ store,
transaction->BackingStoreTransaction(),
id(),
object_store_id);
@@ -1569,7 +1569,7 @@ void IndexedDBDatabase::CreateTransaction(
static_cast<indexed_db::TransactionMode>(mode),
this);
DCHECK(transactions_.find(transaction_id) == transactions_.end());
- transactions_[transaction_id] = transaction.get();
+ transactions_[transaction_id] = transaction;
}
bool IndexedDBDatabase::IsOpenConnectionBlocked() const {
@@ -1595,7 +1595,7 @@ void IndexedDBDatabase::OpenConnection(
int64 transaction_id,
int64 version,
WebKit::WebIDBCallbacks::DataLoss data_loss) {
- DCHECK(backing_store_.get());
+ DCHECK(backing_store_);
// TODO(jsbell): Should have a priority queue so that higher version
// requests are processed first. http://crbug.com/225850
@@ -1686,7 +1686,7 @@ void IndexedDBDatabase::RunVersionChangeTransaction(
int64 requested_version,
WebKit::WebIDBCallbacks::DataLoss data_loss) {
- DCHECK(callbacks.get());
+ DCHECK(callbacks);
DCHECK(connections_.has(connection.get()));
if (ConnectionCount() > 1) {
DCHECK_NE(WebKit::WebIDBCallbacks::DataLossTotal, data_loss);
@@ -1788,7 +1788,7 @@ bool IndexedDBDatabase::IsDeleteDatabaseBlocked() const {
void IndexedDBDatabase::DeleteDatabaseFinal(
scoped_refptr<IndexedDBCallbacks> callbacks) {
DCHECK(!IsDeleteDatabaseBlocked());
- DCHECK(backing_store_.get());
+ DCHECK(backing_store_);
if (!backing_store_->DeleteDatabase(metadata_.name)) {
callbacks->OnError(
IndexedDBDatabaseError(WebKit::WebIDBDatabaseExceptionUnknownError,
@@ -1851,7 +1851,7 @@ void IndexedDBDatabase::Close(IndexedDBConnection* connection) {
// factory_ should only be null in unit tests.
// TODO(jsbell): DCHECK(factory_ || !in_unit_tests) - somehow.
- if (factory_.get())
+ if (factory_)
factory_->RemoveIDBDatabaseBackend(identifier_);
}
}
diff --git a/content/browser/indexed_db/indexed_db_database_unittest.cc b/content/browser/indexed_db/indexed_db_database_unittest.cc
index ac98ce3..39bb955 100644
--- a/content/browser/indexed_db/indexed_db_database_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_database_unittest.cc
@@ -29,11 +29,8 @@ TEST(IndexedDBDatabaseTest, BackingStoreRetention) {
EXPECT_TRUE(backing_store->HasOneRef());
IndexedDBFactory* factory = 0;
- scoped_refptr<IndexedDBDatabase> db =
- IndexedDBDatabase::Create(ASCIIToUTF16("db"),
- backing_store.get(),
- factory,
- ASCIIToUTF16("uniqueid"));
+ scoped_refptr<IndexedDBDatabase> db = IndexedDBDatabase::Create(
+ ASCIIToUTF16("db"), backing_store, factory, ASCIIToUTF16("uniqueid"));
EXPECT_FALSE(backing_store->HasOneRef()); // local and db
db = NULL;
EXPECT_TRUE(backing_store->HasOneRef()); // local
@@ -100,11 +97,8 @@ TEST(IndexedDBDatabaseTest, ConnectionLifecycle) {
EXPECT_TRUE(backing_store->HasOneRef()); // local
IndexedDBFactory* factory = 0;
- scoped_refptr<IndexedDBDatabase> db =
- IndexedDBDatabase::Create(ASCIIToUTF16("db"),
- backing_store.get(),
- factory,
- ASCIIToUTF16("uniqueid"));
+ scoped_refptr<IndexedDBDatabase> db = IndexedDBDatabase::Create(
+ ASCIIToUTF16("db"), backing_store, factory, ASCIIToUTF16("uniqueid"));
EXPECT_FALSE(backing_store->HasOneRef()); // local and db
@@ -136,7 +130,7 @@ TEST(IndexedDBDatabaseTest, ConnectionLifecycle) {
db->Close(request2->connection());
EXPECT_TRUE(backing_store->HasOneRef());
- EXPECT_FALSE(db->BackingStore().get());
+ EXPECT_FALSE(db->BackingStore());
db = NULL;
}
@@ -167,11 +161,8 @@ TEST(IndexedDBDatabaseTest, ForcedClose) {
EXPECT_TRUE(backing_store->HasOneRef());
IndexedDBFactory* factory = 0;
- scoped_refptr<IndexedDBDatabase> backend =
- IndexedDBDatabase::Create(ASCIIToUTF16("db"),
- backing_store.get(),
- factory,
- ASCIIToUTF16("uniqueid"));
+ scoped_refptr<IndexedDBDatabase> backend = IndexedDBDatabase::Create(
+ ASCIIToUTF16("db"), backing_store, factory, ASCIIToUTF16("uniqueid"));
EXPECT_FALSE(backing_store->HasOneRef()); // local and db
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host.cc b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
index 6e859d0..bc25dc3 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host.cc
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host.cc
@@ -41,7 +41,7 @@ IndexedDBDispatcherHost::IndexedDBDispatcherHost(
database_dispatcher_host_(new DatabaseDispatcherHost(this)),
cursor_dispatcher_host_(new CursorDispatcherHost(this)),
ipc_process_id_(ipc_process_id) {
- DCHECK(indexed_db_context_.get());
+ DCHECK(indexed_db_context_);
}
IndexedDBDispatcherHost::~IndexedDBDispatcherHost() {}
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host.h b/content/browser/indexed_db/indexed_db_dispatcher_host.h
index a45ff66..0731113 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host.h
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host.h
@@ -58,7 +58,7 @@ class IndexedDBDispatcherHost : public BrowserMessageFilter {
void FinishTransaction(int64 host_transaction_id, bool committed);
// A shortcut for accessing our context.
- IndexedDBContextImpl* Context() { return indexed_db_context_.get(); }
+ IndexedDBContextImpl* Context() { return indexed_db_context_; }
// IndexedDBCallbacks call these methods to add the results into the
// applicable map. See below for more details.
diff --git a/content/browser/indexed_db/indexed_db_factory.cc b/content/browser/indexed_db/indexed_db_factory.cc
index 24240e6..315fb36 100644
--- a/content/browser/indexed_db/indexed_db_factory.cc
+++ b/content/browser/indexed_db/indexed_db_factory.cc
@@ -59,7 +59,7 @@ void IndexedDBFactory::GetDatabaseNames(
WebKit::WebIDBCallbacks::DataLoss data_loss;
scoped_refptr<IndexedDBBackingStore> backing_store =
OpenBackingStore(database_identifier, data_directory, &data_loss);
- if (!backing_store.get()) {
+ if (!backing_store) {
callbacks->OnError(
IndexedDBDatabaseError(WebKit::WebIDBDatabaseExceptionUnknownError,
"Internal error opening backing store for "
@@ -92,7 +92,7 @@ void IndexedDBFactory::DeleteDatabase(
WebKit::WebIDBCallbacks::DataLoss data_loss;
scoped_refptr<IndexedDBBackingStore> backing_store =
OpenBackingStore(database_identifier, data_directory, &data_loss);
- if (!backing_store.get()) {
+ if (!backing_store) {
callbacks->OnError(IndexedDBDatabaseError(
WebKit::WebIDBDatabaseExceptionUnknownError,
ASCIIToUTF16("Internal error opening backing store "
@@ -100,9 +100,9 @@ void IndexedDBFactory::DeleteDatabase(
return;
}
- scoped_refptr<IndexedDBDatabase> database_backend = IndexedDBDatabase::Create(
- name, backing_store.get(), this, unique_identifier);
- if (!database_backend.get()) {
+ scoped_refptr<IndexedDBDatabase> database_backend =
+ IndexedDBDatabase::Create(name, backing_store, this, unique_identifier);
+ if (!database_backend) {
callbacks->OnError(IndexedDBDatabaseError(
WebKit::WebIDBDatabaseExceptionUnknownError,
ASCIIToUTF16("Internal error creating database backend for "
@@ -110,7 +110,7 @@ void IndexedDBFactory::DeleteDatabase(
return;
}
- database_backend_map_[unique_identifier] = database_backend.get();
+ database_backend_map_[unique_identifier] = database_backend;
database_backend->DeleteDatabase(callbacks);
database_backend_map_.erase(unique_identifier);
}
@@ -172,7 +172,7 @@ void IndexedDBFactory::Open(
if (it == database_backend_map_.end()) {
scoped_refptr<IndexedDBBackingStore> backing_store =
OpenBackingStore(database_identifier, data_directory, &data_loss);
- if (!backing_store.get()) {
+ if (!backing_store) {
callbacks->OnError(IndexedDBDatabaseError(
WebKit::WebIDBDatabaseExceptionUnknownError,
ASCIIToUTF16(
@@ -180,9 +180,9 @@ void IndexedDBFactory::Open(
return;
}
- database_backend = IndexedDBDatabase::Create(
- name, backing_store.get(), this, unique_identifier);
- if (!database_backend.get()) {
+ database_backend =
+ IndexedDBDatabase::Create(name, backing_store, this, unique_identifier);
+ if (!database_backend) {
callbacks->OnError(IndexedDBDatabaseError(
WebKit::WebIDBDatabaseExceptionUnknownError,
ASCIIToUTF16(
@@ -190,7 +190,7 @@ void IndexedDBFactory::Open(
return;
}
- database_backend_map_[unique_identifier] = database_backend.get();
+ database_backend_map_[unique_identifier] = database_backend;
} else {
database_backend = it->second;
}
diff --git a/content/browser/indexed_db/indexed_db_internals_ui.cc b/content/browser/indexed_db/indexed_db_internals_ui.cc
index 109b7da..744198d 100644
--- a/content/browser/indexed_db/indexed_db_internals_ui.cc
+++ b/content/browser/indexed_db/indexed_db_internals_ui.cc
@@ -153,7 +153,7 @@ void IndexedDBInternalsUI::DownloadOriginData(const base::ListValue* args) {
&FindContext, partition_path, &result_partition, &result_context);
BrowserContext::ForEachStoragePartition(browser_context, cb);
DCHECK(result_partition);
- DCHECK(result_context.get());
+ DCHECK(result_context);
result_context->TaskRunner()->PostTask(
FROM_HERE,
@@ -183,8 +183,7 @@ void IndexedDBInternalsUI::DownloadOriginDataOnIndexedDBThread(
// has completed.
base::FilePath temp_path = temp_dir.Take();
- std::string origin_id =
- webkit_database::GetIdentifierFromOrigin(origin_url);
+ std::string origin_id = webkit_database::GetIdentifierFromOrigin(origin_url);
base::FilePath zip_path =
temp_path.AppendASCII(origin_id).AddExtension(FILE_PATH_LITERAL("zip"));
diff --git a/content/browser/indexed_db/indexed_db_quota_client.cc b/content/browser/indexed_db/indexed_db_quota_client.cc
index 8905334..1b187c5 100644
--- a/content/browser/indexed_db/indexed_db_quota_client.cc
+++ b/content/browser/indexed_db/indexed_db_quota_client.cc
@@ -26,13 +26,13 @@ quota::QuotaStatusCode DeleteOriginDataOnIndexedDBThread(
}
int64 GetOriginUsageOnIndexedDBThread(IndexedDBContextImpl* context,
- const GURL& origin) {
+ const GURL& origin) {
DCHECK(context->TaskRunner()->RunsTasksOnCurrentThread());
return context->GetOriginDiskUsage(origin);
}
void GetAllOriginsOnIndexedDBThread(IndexedDBContextImpl* context,
- std::set<GURL>* origins_to_return) {
+ std::set<GURL>* origins_to_return) {
DCHECK(context->TaskRunner()->RunsTasksOnCurrentThread());
std::vector<GURL> all_origins = context->GetAllOrigins();
origins_to_return->insert(all_origins.begin(), all_origins.end());
@@ -45,8 +45,8 @@ void DidGetOrigins(const IndexedDBQuotaClient::GetOriginsCallback& callback,
}
void GetOriginsForHostOnIndexedDBThread(IndexedDBContextImpl* context,
- const std::string& host,
- std::set<GURL>* origins_to_return) {
+ const std::string& host,
+ std::set<GURL>* origins_to_return) {
DCHECK(context->TaskRunner()->RunsTasksOnCurrentThread());
std::vector<GURL> all_origins = context->GetAllOrigins();
for (std::vector<GURL>::const_iterator iter = all_origins.begin();
@@ -75,7 +75,7 @@ void IndexedDBQuotaClient::GetOriginUsage(const GURL& origin_url,
quota::StorageType type,
const GetUsageCallback& callback) {
DCHECK(!callback.is_null());
- DCHECK(indexed_db_context_.get());
+ DCHECK(indexed_db_context_);
// IndexedDB is in the temp namespace for now.
if (type != quota::kStorageTypeTemporary) {
@@ -89,7 +89,7 @@ void IndexedDBQuotaClient::GetOriginUsage(const GURL& origin_url,
return;
}
- base::PostTaskAndReplyWithResult(
+ base::PostTaskAndReplyWithResult(
indexed_db_context_->TaskRunner(),
FROM_HERE,
base::Bind(
@@ -101,7 +101,7 @@ void IndexedDBQuotaClient::GetOriginsForType(
quota::StorageType type,
const GetOriginsCallback& callback) {
DCHECK(!callback.is_null());
- DCHECK(indexed_db_context_.get());
+ DCHECK(indexed_db_context_);
// All databases are in the temp namespace for now.
if (type != quota::kStorageTypeTemporary) {
@@ -129,7 +129,7 @@ void IndexedDBQuotaClient::GetOriginsForHost(
const std::string& host,
const GetOriginsCallback& callback) {
DCHECK(!callback.is_null());
- DCHECK(indexed_db_context_.get());
+ DCHECK(indexed_db_context_);
// All databases are in the temp namespace for now.
if (type != quota::kStorageTypeTemporary) {
diff --git a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc
index 9ec3951..9126438 100644
--- a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc
@@ -47,22 +47,20 @@ class IndexedDBQuotaClientTest : public testing::Test {
new quota::MockQuotaManager(
false /*in_memory*/,
browser_context_->GetPath(),
- base::MessageLoop::current()->message_loop_proxy().get(),
- base::MessageLoop::current()->message_loop_proxy().get(),
+ base::MessageLoop::current()->message_loop_proxy(),
+ base::MessageLoop::current()->message_loop_proxy(),
browser_context_->GetSpecialStoragePolicy());
idb_context_ =
new IndexedDBContextImpl(browser_context_->GetPath(),
browser_context_->GetSpecialStoragePolicy(),
quota_manager->proxy(),
- task_runner_.get());
+ task_runner_);
base::MessageLoop::current()->RunUntilIdle();
setup_temp_dir();
}
- void FlushIndexedDBTaskRunner() {
- task_runner_->RunUntilIdle();
- }
+ void FlushIndexedDBTaskRunner() { task_runner_->RunUntilIdle(); }
void setup_temp_dir() {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
@@ -133,7 +131,7 @@ class IndexedDBQuotaClientTest : public testing::Test {
return delete_status_;
}
- IndexedDBContextImpl* idb_context() { return idb_context_.get(); }
+ IndexedDBContextImpl* idb_context() { return idb_context_; }
void SetFileSizeTo(const base::FilePath& path, int size) {
std::string junk(size, 'a');
diff --git a/content/browser/indexed_db/indexed_db_transaction.h b/content/browser/indexed_db/indexed_db_transaction.h
index 6c78022..c1a20d5 100644
--- a/content/browser/indexed_db/indexed_db_transaction.h
+++ b/content/browser/indexed_db/indexed_db_transaction.h
@@ -70,22 +70,19 @@ class IndexedDBTransaction : public base::RefCounted<IndexedDBTransaction> {
}
int64 id() const { return id_; }
- IndexedDBDatabase* database() const { return database_.get(); }
- IndexedDBDatabaseCallbacks* connection() const {
- return callbacks_.get();
- }
+ IndexedDBDatabase* database() const { return database_; }
+ IndexedDBDatabaseCallbacks* connection() const { return callbacks_; }
protected:
virtual ~IndexedDBTransaction();
friend class base::RefCounted<IndexedDBTransaction>;
private:
- IndexedDBTransaction(
- int64 id,
- scoped_refptr<IndexedDBDatabaseCallbacks> callbacks,
- const std::set<int64>& object_store_ids,
- indexed_db::TransactionMode,
- IndexedDBDatabase* db);
+ IndexedDBTransaction(int64 id,
+ scoped_refptr<IndexedDBDatabaseCallbacks> callbacks,
+ const std::set<int64>& object_store_ids,
+ indexed_db::TransactionMode,
+ IndexedDBDatabase* db);
enum State {
UNUSED, // Created, but no tasks yet.
diff --git a/content/browser/indexed_db/indexed_db_unittest.cc b/content/browser/indexed_db/indexed_db_unittest.cc
index 863be90..a45f544 100644
--- a/content/browser/indexed_db/indexed_db_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_unittest.cc
@@ -58,11 +58,8 @@ TEST_F(IndexedDBTest, ClearSessionOnlyDatabases) {
// Create the scope which will ensure we run the destructor of the context
// which should trigger the clean up.
{
- scoped_refptr<IndexedDBContextImpl> idb_context =
- new IndexedDBContextImpl(temp_dir.path(),
- special_storage_policy_.get(),
- NULL,
- task_runner_.get());
+ scoped_refptr<IndexedDBContextImpl> idb_context = new IndexedDBContextImpl(
+ temp_dir.path(), special_storage_policy_, NULL, task_runner_);
normal_path = idb_context->GetFilePathForTesting(
webkit_database::GetIdentifierFromOrigin(kNormalOrigin));
@@ -92,11 +89,8 @@ TEST_F(IndexedDBTest, SetForceKeepSessionState) {
{
// Create some indexedDB paths.
// With the levelDB backend, these are directories.
- scoped_refptr<IndexedDBContextImpl> idb_context =
- new IndexedDBContextImpl(temp_dir.path(),
- special_storage_policy_.get(),
- NULL,
- task_runner_.get());
+ scoped_refptr<IndexedDBContextImpl> idb_context = new IndexedDBContextImpl(
+ temp_dir.path(), special_storage_policy_, NULL, task_runner_);
// Save session state. This should bypass the destruction-time deletion.
idb_context->SetForceKeepSessionState();
@@ -151,11 +145,8 @@ TEST_F(IndexedDBTest, ForceCloseOpenDatabasesOnDelete) {
const GURL kTestOrigin("http://test/");
- scoped_refptr<IndexedDBContextImpl> idb_context =
- new IndexedDBContextImpl(temp_dir.path(),
- special_storage_policy_.get(),
- NULL,
- task_runner_.get());
+ scoped_refptr<IndexedDBContextImpl> idb_context = new IndexedDBContextImpl(
+ temp_dir.path(), special_storage_policy_, NULL, task_runner_);
test_path = idb_context->GetFilePathForTesting(
webkit_database::GetIdentifierFromOrigin(kTestOrigin));
@@ -187,9 +178,8 @@ TEST_F(IndexedDBTest, ForceCloseOpenDatabasesOnDelete) {
idb_context->TaskRunner()->PostTask(
FROM_HERE,
- base::Bind(&IndexedDBContextImpl::DeleteForOrigin,
- idb_context,
- kTestOrigin));
+ base::Bind(
+ &IndexedDBContextImpl::DeleteForOrigin, idb_context, kTestOrigin));
FlushIndexedDBTaskRunner();
message_loop_.RunUntilIdle();
}