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

Unified Diff: chrome/test/base/testing_profile.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/test/base/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index b24948bfb636a709da2664fc6d3836af115969ee..eb5f92c45e8dabb732c47db53b02e4a94413fe34 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -99,7 +99,6 @@ class TestExtensionURLRequestContext : public net::URLRequestContext {
set_cookie_store(cookie_monster);
}
- private:
virtual ~TestExtensionURLRequestContext() {}
};
@@ -107,8 +106,8 @@ class TestExtensionURLRequestContextGetter
: public net::URLRequestContextGetter {
public:
virtual net::URLRequestContext* GetURLRequestContext() {
- if (!context_)
- context_ = new TestExtensionURLRequestContext();
+ if (!context_.get())
+ context_.reset(new TestExtensionURLRequestContext());
return context_.get();
}
virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const {
@@ -119,7 +118,7 @@ class TestExtensionURLRequestContextGetter
virtual ~TestExtensionURLRequestContextGetter() {}
private:
- scoped_refptr<net::URLRequestContext> context_;
+ scoped_ptr<net::URLRequestContext> context_;
};
ProfileKeyedService* CreateTestDesktopNotificationService(Profile* profile) {

Powered by Google App Engine
This is Rietveld 408576698