diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-02 19:17:16 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-02 19:17:16 +0000 |
commit | 901174d96b0769ad258ff42a7df7cdf6ede5c11b (patch) | |
tree | ac4c552016842a1b2aaf722737b124f48c6fa917 /components | |
parent | fee18e79ec56e01875ec2de2e4dfac17aee25906 (diff) | |
download | chromium_src-901174d96b0769ad258ff42a7df7cdf6ede5c11b.zip chromium_src-901174d96b0769ad258ff42a7df7cdf6ede5c11b.tar.gz chromium_src-901174d96b0769ad258ff42a7df7cdf6ede5c11b.tar.bz2 |
Update components/ to use scoped_refptr<T>::get() rather than implicit "operator T*"
Linux fixes
BUG=110610
TBR=darin
Review URL: https://chromiumcodereview.appspot.com/15649019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203615 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
10 files changed, 33 insertions, 33 deletions
diff --git a/components/autofill/browser/autocheckout_manager.cc b/components/autofill/browser/autocheckout_manager.cc index 223c5b6..eb0a58d 100644 --- a/components/autofill/browser/autocheckout_manager.cc +++ b/components/autofill/browser/autocheckout_manager.cc @@ -283,7 +283,7 @@ void AutocheckoutManager::MaybeShowAutocheckoutBubble( scoped_refptr<net::URLRequestContextGetter>( browser_context->GetRequestContext()); - if (!request_context) + if (!request_context.get()) return; base::Closure task = base::Bind(&GetGoogleCookies, request_context, callback); diff --git a/components/autofill/browser/autocomplete_history_manager.cc b/components/autofill/browser/autocomplete_history_manager.cc index 5d982949f..ca79889 100644 --- a/components/autofill/browser/autocomplete_history_manager.cc +++ b/components/autofill/browser/autocomplete_history_manager.cc @@ -170,7 +170,7 @@ void AutocompleteHistoryManager::SetExternalDelegate( void AutocompleteHistoryManager::CancelPendingQuery() { if (pending_query_handle_) { - if (autofill_data_) + if (autofill_data_.get()) autofill_data_->CancelRequest(pending_query_handle_); pending_query_handle_ = 0; } diff --git a/components/autofill/browser/autocomplete_history_manager_unittest.cc b/components/autofill/browser/autocomplete_history_manager_unittest.cc index 3575ae2..b8b144e 100644 --- a/components/autofill/browser/autocomplete_history_manager_unittest.cc +++ b/components/autofill/browser/autocomplete_history_manager_unittest.cc @@ -141,7 +141,7 @@ TEST_F(AutocompleteHistoryManagerTest, CreditCardNumberValue) { valid_cc.form_control_type = "text"; form.fields.push_back(valid_cc); - EXPECT_CALL(*web_data_service_, AddFormFields(_)).Times(0); + EXPECT_CALL(*web_data_service_.get(), AddFormFields(_)).Times(0); autocomplete_manager_->OnFormSubmitted(form); } @@ -184,7 +184,7 @@ TEST_F(AutocompleteHistoryManagerTest, SSNValue) { ssn.form_control_type = "text"; form.fields.push_back(ssn); - EXPECT_CALL(*web_data_service_, AddFormFields(_)).Times(0); + EXPECT_CALL(*web_data_service_.get(), AddFormFields(_)).Times(0); autocomplete_manager_->OnFormSubmitted(form); } diff --git a/components/autofill/browser/wallet/encryption_escrow_client.cc b/components/autofill/browser/wallet/encryption_escrow_client.cc index 53754a2..837949e 100644 --- a/components/autofill/browser/wallet/encryption_escrow_client.cc +++ b/components/autofill/browser/wallet/encryption_escrow_client.cc @@ -45,7 +45,7 @@ EncryptionEscrowClient::EncryptionEscrowClient( : context_getter_(context_getter), observer_(observer), request_type_(NO_PENDING_REQUEST) { - DCHECK(context_getter_); + DCHECK(context_getter_.get()); DCHECK(observer_); } @@ -119,7 +119,7 @@ void EncryptionEscrowClient::MakeRequest(const GURL& url, request_.reset(net::URLFetcher::Create( 1, url, net::URLFetcher::POST, this)); - request_->SetRequestContext(context_getter_); + request_->SetRequestContext(context_getter_.get()); DVLOG(1) << "url=" << url << ", post_body=" << post_body; request_->SetUploadData(kApplicationMimeType, post_body); request_->Start(); diff --git a/components/autofill/browser/wallet/wallet_client.cc b/components/autofill/browser/wallet/wallet_client.cc index ace0f5d..d1c0f34 100644 --- a/components/autofill/browser/wallet/wallet_client.cc +++ b/components/autofill/browser/wallet/wallet_client.cc @@ -238,7 +238,7 @@ WalletClient::WalletClient(net::URLRequestContextGetter* context_getter, request_type_(NO_PENDING_REQUEST), one_time_pad_(kOneTimePadLength), encryption_escrow_client_(context_getter, this) { - DCHECK(context_getter_); + DCHECK(context_getter_.get()); DCHECK(delegate_); } @@ -632,7 +632,7 @@ void WalletClient::MakeWalletRequest(const GURL& url, request_.reset(net::URLFetcher::Create( 0, url, net::URLFetcher::POST, this)); - request_->SetRequestContext(context_getter_); + request_->SetRequestContext(context_getter_.get()); DVLOG(1) << "Making request to " << url << " with post_body=" << post_body; request_->SetUploadData(kJsonMimeType, post_body); request_started_timestamp_ = base::Time::Now(); diff --git a/components/autofill/browser/webdata/autofill_webdata_service.cc b/components/autofill/browser/webdata/autofill_webdata_service.cc index 51cb60d..9aada6b 100644 --- a/components/autofill/browser/webdata/autofill_webdata_service.cc +++ b/components/autofill/browser/webdata/autofill_webdata_service.cc @@ -168,14 +168,14 @@ void AutofillWebDataService::RemoveOriginURLsModifiedBetween( void AutofillWebDataService::AddObserver( AutofillWebDataServiceObserverOnDBThread* observer) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); - if (autofill_backend_) + if (autofill_backend_.get()) autofill_backend_->AddObserver(observer); } void AutofillWebDataService::RemoveObserver( AutofillWebDataServiceObserverOnDBThread* observer) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); - if (autofill_backend_) + if (autofill_backend_.get()) autofill_backend_->RemoveObserver(observer); } diff --git a/components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.cc b/components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.cc index 6b749a8..060ddc1 100644 --- a/components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.cc +++ b/components/browser_context_keyed_service/refcounted_browser_context_keyed_service_factory.cc @@ -100,7 +100,7 @@ void RefcountedBrowserContextKeyedServiceFactory::Associate( void RefcountedBrowserContextKeyedServiceFactory::BrowserContextShutdown( content::BrowserContext* context) { RefCountedStorage::iterator it = mapping_.find(context); - if (it != mapping_.end() && it->second) + if (it != mapping_.end() && it->second.get()) it->second->ShutdownOnUIThread(); } diff --git a/components/visitedlink/browser/visitedlink_master.cc b/components/visitedlink/browser/visitedlink_master.cc index 71bc07c..97b83ab 100644 --- a/components/visitedlink/browser/visitedlink_master.cc +++ b/components/visitedlink/browser/visitedlink_master.cc @@ -262,7 +262,7 @@ VisitedLinkMaster::Hash VisitedLinkMaster::TryToAddURL(const GURL& url) { Fingerprint fingerprint = ComputeURLFingerprint(url.spec().data(), url.spec().size(), salt_); - if (table_builder_) { + if (table_builder_.get()) { // If we have a pending delete for this fingerprint, cancel it. std::set<Fingerprint>::iterator found = deleted_since_rebuild_.find(fingerprint); @@ -293,7 +293,7 @@ void VisitedLinkMaster::PostIOTask(const tracked_objects::Location& from_here, void VisitedLinkMaster::AddURL(const GURL& url) { Hash index = TryToAddURL(url); - if (!table_builder_ && index != null_hash_) { + if (!table_builder_.get() && index != null_hash_) { // Not rebuilding, so we want to keep the file on disk up-to-date. if (persist_to_disk_) { WriteUsedItemCountToFile(); @@ -307,12 +307,12 @@ void VisitedLinkMaster::AddURLs(const std::vector<GURL>& url) { for (std::vector<GURL>::const_iterator i = url.begin(); i != url.end(); ++i) { Hash index = TryToAddURL(*i); - if (!table_builder_ && index != null_hash_) + if (!table_builder_.get() && index != null_hash_) ResizeTableIfNecessary(); } // Keeps the file on disk up-to-date. - if (!table_builder_ && persist_to_disk_) + if (!table_builder_.get() && persist_to_disk_) WriteFullTable(); } @@ -343,7 +343,7 @@ void VisitedLinkMaster::DeleteURLs(URLIterator* urls) { listener_->Reset(); - if (table_builder_) { + if (table_builder_.get()) { // A rebuild is in progress, save this deletion in the temporary list so // it can be added once rebuild is complete. while (urls->HasNextURL()) { @@ -830,7 +830,7 @@ uint32 VisitedLinkMaster::NewTableSizeForCount(int32 item_count) const { // See the TableBuilder definition in the header file for how this works. bool VisitedLinkMaster::RebuildTableFromDelegate() { - DCHECK(!table_builder_); + DCHECK(!table_builder_.get()); // TODO(brettw) make sure we have reasonable salt! table_builder_ = new TableBuilder(this, salt_); diff --git a/components/webdata/common/web_data_service_base.cc b/components/webdata/common/web_data_service_base.cc index 9b36197..209e612 100644 --- a/components/webdata/common/web_data_service_base.cc +++ b/components/webdata/common/web_data_service_base.cc @@ -54,19 +54,19 @@ void WebDataServiceBase::Init() { } void WebDataServiceBase::UnloadDatabase() { - if (!wdbs_) + if (!wdbs_.get()) return; wdbs_->UnloadDatabase(); } void WebDataServiceBase::ShutdownDatabase() { - if (!wdbs_) + if (!wdbs_.get()) return; wdbs_->ShutdownDatabase(); } void WebDataServiceBase::CancelRequest(Handle h) { - if (!wdbs_) + if (!wdbs_.get()) return; wdbs_->CancelRequest(h); } @@ -80,19 +80,19 @@ bool WebDataServiceBase::IsDatabaseLoaded() { } void WebDataServiceBase::AddDBObserver(WebDatabaseObserver* observer) { - if (!wdbs_) + if (!wdbs_.get()) return; wdbs_->AddObserver(observer); } void WebDataServiceBase::RemoveDBObserver(WebDatabaseObserver* observer) { - if (!wdbs_) + if (!wdbs_.get()) return; wdbs_->RemoveObserver(observer); } WebDatabase* WebDataServiceBase::GetDatabase() { - if (!wdbs_) + if (!wdbs_.get()) return NULL; return wdbs_->GetDatabaseOnDB(); } diff --git a/components/webdata/common/web_database_service.cc b/components/webdata/common/web_database_service.cc index ddbf733..a1b1889 100644 --- a/components/webdata/common/web_database_service.cc +++ b/components/webdata/common/web_database_service.cc @@ -51,7 +51,7 @@ WebDatabaseService::~WebDatabaseService() { } void WebDatabaseService::AddTable(scoped_ptr<WebDatabaseTable> table) { - if (!wds_backend_) { + if (!wds_backend_.get()) { wds_backend_ = new WebDataServiceBackend( path_, new BackendDelegate(weak_ptr_factory_.GetWeakPtr())); } @@ -59,7 +59,7 @@ void WebDatabaseService::AddTable(scoped_ptr<WebDatabaseTable> table) { } void WebDatabaseService::LoadDatabase() { - DCHECK(wds_backend_); + DCHECK(wds_backend_.get()); BrowserThread::PostTask( BrowserThread::DB, @@ -68,7 +68,7 @@ void WebDatabaseService::LoadDatabase() { } void WebDatabaseService::UnloadDatabase() { - if (!wds_backend_) + if (!wds_backend_.get()) return; BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, Bind(&WebDataServiceBackend::ShutdownDatabase, @@ -76,7 +76,7 @@ void WebDatabaseService::UnloadDatabase() { } void WebDatabaseService::ShutdownDatabase() { - if (!wds_backend_) + if (!wds_backend_.get()) return; weak_ptr_factory_.InvalidateWeakPtrs(); BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, @@ -86,7 +86,7 @@ void WebDatabaseService::ShutdownDatabase() { WebDatabase* WebDatabaseService::GetDatabaseOnDB() const { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); - if (!wds_backend_) + if (!wds_backend_.get()) return NULL; return wds_backend_->database(); } @@ -98,13 +98,13 @@ scoped_refptr<WebDataServiceBackend> WebDatabaseService::GetBackend() const { void WebDatabaseService::ScheduleDBTask( const tracked_objects::Location& from_here, const WriteTask& task) { - if (!wds_backend_) { + if (!wds_backend_.get()) { NOTREACHED() << "Task scheduled after Shutdown()"; return; } scoped_ptr<WebDataRequest> request( - new WebDataRequest(NULL, wds_backend_->request_manager())); + new WebDataRequest(NULL, wds_backend_->request_manager().get())); BrowserThread::PostTask(BrowserThread::DB, from_here, Bind(&WebDataServiceBackend::DBWriteTaskWrapper, wds_backend_, @@ -118,13 +118,13 @@ WebDataServiceBase::Handle WebDatabaseService::ScheduleDBTaskWithResult( DCHECK(consumer); WebDataServiceBase::Handle handle = 0; - if (!wds_backend_) { + if (!wds_backend_.get()) { NOTREACHED() << "Task scheduled after Shutdown()"; return handle; } scoped_ptr<WebDataRequest> request( - new WebDataRequest(consumer, wds_backend_->request_manager())); + new WebDataRequest(consumer, wds_backend_->request_manager().get())); handle = request->GetHandle(); BrowserThread::PostTask(BrowserThread::DB, from_here, @@ -135,7 +135,7 @@ WebDataServiceBase::Handle WebDatabaseService::ScheduleDBTaskWithResult( } void WebDatabaseService::CancelRequest(WebDataServiceBase::Handle h) { - if (!wds_backend_) + if (!wds_backend_.get()) return; wds_backend_->request_manager()->CancelRequest(h); } |