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

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

Issue 10299002: Stop refcounting URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fixes Created 8 years, 8 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 100f22a46295d7aadc8e47b16d98f814d5f1ebe1..f2c674f0fb56dca327a65868210ce333c6a8a3c9 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -145,9 +145,9 @@ SafeBrowsingURLRequestContextGetter::~SafeBrowsingURLRequestContextGetter() {}
net::URLRequestContext*
SafeBrowsingURLRequestContextGetter::GetURLRequestContext() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- DCHECK(sb_service_->url_request_context_);
+ DCHECK(sb_service_->url_request_context_.get());
- return sb_service_->url_request_context_;
+ return sb_service_->url_request_context_.get();
}
scoped_refptr<base::MessageLoopProxy>
@@ -614,7 +614,7 @@ void SafeBrowsingService::InitURLRequestContextOnIOThread(
FilePath(BaseFilename().value() + kCookiesFile), false),
NULL);
- url_request_context_ = new SafeBrowsingURLRequestContext;
+ url_request_context_.reset(new SafeBrowsingURLRequestContext);
// |system_url_request_context_getter| may be NULL during tests.
if (system_url_request_context_getter)
url_request_context_->CopyFrom(
@@ -633,8 +633,7 @@ void SafeBrowsingService::DestroyURLRequestContextOnIOThread() {
using base::debug::LeakTracker;
LeakTracker<SafeBrowsingURLRequestContextGetter>::CheckForLeaks();
- DCHECK(url_request_context_.get());
- url_request_context_ = NULL;
+ url_request_context_.reset();
}
void SafeBrowsingService::StartOnIOThread() {

Powered by Google App Engine
This is Rietveld 408576698