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

Unified Diff: chrome/browser/policy/device_management_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
Index: chrome/browser/policy/device_management_service.cc
diff --git a/chrome/browser/policy/device_management_service.cc b/chrome/browser/policy/device_management_service.cc
index aab92e142f2470010f9aa3c4ae029fe43d81a6ae..3e15e96489a5167f04db384621b99b68d9ef380a 100644
--- a/chrome/browser/policy/device_management_service.cc
+++ b/chrome/browser/policy/device_management_service.cc
@@ -186,10 +186,9 @@ const std::string& GetPlatformString() {
class DeviceManagementRequestContext : public net::URLRequestContext {
public:
explicit DeviceManagementRequestContext(net::URLRequestContext* base_context);
-
- private:
virtual ~DeviceManagementRequestContext();
+ private:
// Overridden from net::URLRequestContext:
virtual const std::string& GetUserAgent(const GURL& url) const OVERRIDE;
};
@@ -243,7 +242,7 @@ class DeviceManagementRequestContextGetter
virtual ~DeviceManagementRequestContextGetter() {}
private:
- scoped_refptr<net::URLRequestContext> context_;
+ scoped_ptr<net::URLRequestContext> context_;
scoped_refptr<net::URLRequestContextGetter> base_context_getter_;
};
@@ -251,9 +250,9 @@ class DeviceManagementRequestContextGetter
net::URLRequestContext*
DeviceManagementRequestContextGetter::GetURLRequestContext() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- if (!context_) {
- context_ = new DeviceManagementRequestContext(
- base_context_getter_->GetURLRequestContext());
+ if (!context_.get()) {
+ context_.reset(new DeviceManagementRequestContext(
+ base_context_getter_->GetURLRequestContext()));
}
return context_.get();
« no previous file with comments | « chrome/browser/net/http_pipelining_compatibility_client.cc ('k') | chrome/browser/profiles/off_the_record_profile_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698