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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service.cc

Issue 3581008: Fix instances of passing raw pointers to RefCounted objects in tasks. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Merge Created 10 years, 2 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: chrome/browser/safe_browsing/safe_browsing_service.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index e0ac3d7211a887a51a92b7b5bed8728e67338ccd..a375ba4296551241e88be38e26e3a55f7bde008b 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -386,9 +386,6 @@ void SafeBrowsingService::OnIOInitialize(
mackey_url_prefix,
disable_auto_update);
- // Balance the reference added by Start().
- request_context_getter->Release();
-
protocol_manager_->Initialize();
}
@@ -648,14 +645,16 @@ void SafeBrowsingService::Start() {
}
// We will issue network fetches using the default profile's request context.
- URLRequestContextGetter* request_context_getter =
+ scoped_refptr<URLRequestContextGetter> request_context_getter =
GetDefaultProfile()->GetRequestContext();
- request_context_getter->AddRef(); // Balanced in OnIOInitialize.
ChromeThread::PostTask(
ChromeThread::IO, FROM_HERE,
NewRunnableMethod(
- this, &SafeBrowsingService::OnIOInitialize, client_key, wrapped_key,
+ this,
+ &SafeBrowsingService::OnIOInitialize,
+ client_key,
+ wrapped_key,
request_context_getter));
}
« no previous file with comments | « chrome/browser/renderer_host/save_file_resource_handler.cc ('k') | chrome/profile_import/profile_import_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698