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

Unified Diff: content/shell/shell_url_request_context_getter.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: content/shell/shell_url_request_context_getter.cc
diff --git a/content/shell/shell_url_request_context_getter.cc b/content/shell/shell_url_request_context_getter.cc
index 23da2144453522525d0d7ec5eb0d4e0b15203171..88c292142db0025ae17ae7c3ecd3cb61d8707765 100644
--- a/content/shell/shell_url_request_context_getter.cc
+++ b/content/shell/shell_url_request_context_getter.cc
@@ -48,11 +48,12 @@ ShellURLRequestContextGetter::~ShellURLRequestContextGetter() {
net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- if (!url_request_context_) {
- url_request_context_ = new net::URLRequestContext();
+ if (!url_request_context_.get()) {
+ url_request_context_.reset(new net::URLRequestContext());
network_delegate_.reset(new ShellNetworkDelegate);
url_request_context_->set_network_delegate(network_delegate_.get());
- storage_.reset(new net::URLRequestContextStorage(url_request_context_));
+ storage_.reset(
+ new net::URLRequestContextStorage(url_request_context_.get()));
storage_->set_cookie_store(new net::CookieMonster(NULL, NULL));
storage_->set_server_bound_cert_service(new net::ServerBoundCertService(
new net::DefaultServerBoundCertStore(NULL)));
@@ -104,7 +105,7 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
storage_->set_job_factory(new net::URLRequestJobFactory);
}
- return url_request_context_;
+ return url_request_context_.get();
}
scoped_refptr<base::MessageLoopProxy>

Powered by Google App Engine
This is Rietveld 408576698