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

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: 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 | « content/shell/shell_url_request_context_getter.h ('k') | content/test/mock_resource_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e0438a23e486a5fe848877d2d9d97980d6d957dd..64a42719d429cf665ef2d6fbd0c44df06640fbe5 100644
--- a/content/shell/shell_url_request_context_getter.cc
+++ b/content/shell/shell_url_request_context_getter.cc
@@ -49,11 +49,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),
@@ -106,7 +107,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>
« no previous file with comments | « content/shell/shell_url_request_context_getter.h ('k') | content/test/mock_resource_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698