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

Unified Diff: chrome/browser/net/chrome_url_request_context.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/net/chrome_url_request_context.h ('k') | chrome/browser/net/connection_tester.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/chrome_url_request_context.cc
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index 96bdde42b026b505ca109834e25b2ca371a0ed10..80c0c8a6abae96e2d75a9a5e161ba09a233fbbff 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -30,7 +30,7 @@ class ChromeURLRequestContextFactory {
virtual ~ChromeURLRequestContextFactory() {}
// Called to create a new instance (will only be called once).
- virtual scoped_refptr<ChromeURLRequestContext> Create() = 0;
+ virtual ChromeURLRequestContext* Create() = 0;
protected:
DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextFactory);
@@ -48,7 +48,7 @@ class FactoryForMain : public ChromeURLRequestContextFactory {
explicit FactoryForMain(const ProfileIOData* profile_io_data)
: profile_io_data_(profile_io_data) {}
- virtual scoped_refptr<ChromeURLRequestContext> Create() {
+ virtual ChromeURLRequestContext* Create() OVERRIDE {
return profile_io_data_->GetMainRequestContext();
}
@@ -62,7 +62,7 @@ class FactoryForExtensions : public ChromeURLRequestContextFactory {
explicit FactoryForExtensions(const ProfileIOData* profile_io_data)
: profile_io_data_(profile_io_data) {}
- virtual scoped_refptr<ChromeURLRequestContext> Create() {
+ virtual ChromeURLRequestContext* Create() OVERRIDE {
return profile_io_data_->GetExtensionsRequestContext();
}
@@ -80,7 +80,7 @@ class FactoryForIsolatedApp : public ChromeURLRequestContextFactory {
app_id_(app_id),
main_request_context_getter_(main_context) {}
- virtual scoped_refptr<ChromeURLRequestContext> Create() {
+ virtual ChromeURLRequestContext* Create() OVERRIDE {
// We will copy most of the state from the main request context.
return profile_io_data_->GetIsolatedAppRequestContext(
main_request_context_getter_->GetIOContext(), app_id_);
@@ -100,7 +100,7 @@ class FactoryForMedia : public ChromeURLRequestContextFactory {
: profile_io_data_(profile_io_data) {
}
- virtual scoped_refptr<ChromeURLRequestContext> Create() {
+ virtual ChromeURLRequestContext* Create() OVERRIDE {
return profile_io_data_->GetMediaRequestContext();
}
@@ -315,7 +315,12 @@ void ChromeURLRequestContextGetter::OnClearSiteDataOnExitChange(
// ----------------------------------------------------------------------------
ChromeURLRequestContext::ChromeURLRequestContext()
- : is_incognito_(false) {
+ : ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
+ is_incognito_(false) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+}
+
+ChromeURLRequestContext::~ChromeURLRequestContext() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
}
@@ -338,10 +343,6 @@ void ChromeURLRequestContext::set_chrome_url_data_manager_backend(
chrome_url_data_manager_backend_ = backend;
}
-ChromeURLRequestContext::~ChromeURLRequestContext() {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-}
-
const std::string& ChromeURLRequestContext::GetUserAgent(
const GURL& url) const {
return content::GetUserAgent(url);
« no previous file with comments | « chrome/browser/net/chrome_url_request_context.h ('k') | chrome/browser/net/connection_tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698