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

Unified Diff: chrome/browser/search/instant_service.cc

Issue 16290004: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
« no previous file with comments | « chrome/browser/search/instant_io_context.cc ('k') | chrome/browser/search/local_ntp_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/instant_service.cc
diff --git a/chrome/browser/search/instant_service.cc b/chrome/browser/search/instant_service.cc
index e6db319cb57adf2df49f10adc6d2c80b44557534..846761116e8cb53e67d57dbb27491ad43adff6fb 100644
--- a/chrome/browser/search/instant_service.cc
+++ b/chrome/browser/search/instant_service.cc
@@ -110,11 +110,12 @@ bool InstantService::IsInstantPath(const GURL& url) {
void InstantService::AddInstantProcess(int process_id) {
process_ids_.insert(process_id);
- if (instant_io_context_) {
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&InstantIOContext::AddInstantProcessOnIO,
- instant_io_context_, process_id));
+ if (instant_io_context_.get()) {
+ BrowserThread::PostTask(BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(&InstantIOContext::AddInstantProcessOnIO,
+ instant_io_context_,
+ process_id));
}
}
@@ -127,7 +128,7 @@ void InstantService::AddMostVisitedItems(
most_visited_item_cache_.AddItems(items);
// Post task to the IO thread to copy the data.
- if (instant_io_context_) {
+ if (instant_io_context_.get()) {
std::vector<InstantMostVisitedItemIDPair> items;
most_visited_item_cache_.GetCurrentItems(&items);
BrowserThread::PostTask(
@@ -153,9 +154,10 @@ bool InstantService::GetMostVisitedItemForID(
void InstantService::Shutdown() {
process_ids_.clear();
- if (instant_io_context_) {
+ if (instant_io_context_.get()) {
BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
+ BrowserThread::IO,
+ FROM_HERE,
base::Bind(&InstantIOContext::ClearInstantProcessesOnIO,
instant_io_context_));
}
@@ -171,11 +173,13 @@ void InstantService::Observe(int type,
content::Source<content::RenderProcessHost>(source)->GetID();
process_ids_.erase(process_id);
- if (instant_io_context_) {
+ if (instant_io_context_.get()) {
BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
+ BrowserThread::IO,
+ FROM_HERE,
base::Bind(&InstantIOContext::RemoveInstantProcessOnIO,
- instant_io_context_, process_id));
+ instant_io_context_,
+ process_id));
}
break;
}
« no previous file with comments | « chrome/browser/search/instant_io_context.cc ('k') | chrome/browser/search/local_ntp_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698