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

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: Initialize to NULL Created 8 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/safe_browsing/safe_browsing_service.h ('k') | chrome/browser/sync/glue/http_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 642bf387012c5fe8d35ba9c5f037e13af524bb3c..6fea46fd80143f6ebfed7b7542eebf457915bfb7 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() {
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service.h ('k') | chrome/browser/sync/glue/http_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698