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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_service.cc

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add TODO Created 8 years, 2 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/safe_browsing/safe_browsing_service.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index a92d736391d706dcdb0ec6d8e8399bb718ee1e60..0369490f45ad5b4c5e27634c1c3aefbfe7d10ea9 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -100,22 +100,6 @@ FilePath CookieFilePath() {
} // namespace
-// Custom URLRequestContext used by SafeBrowsing requests, which are not
-// associated with a particular profile. We need to use a subclass of
-// URLRequestContext in order to provide the correct User-Agent.
-class SafeBrowsingURLRequestContext : public net::URLRequestContext {
- public:
- virtual const std::string& GetUserAgent(
- const GURL& url) const OVERRIDE {
- return content::GetUserAgent(url);
- }
-
- private:
- virtual ~SafeBrowsingURLRequestContext() {}
-
- base::debug::LeakTracker<SafeBrowsingURLRequestContext> leak_tracker_;
-};
-
class SafeBrowsingURLRequestContextGetter
: public net::URLRequestContextGetter {
public:
@@ -620,11 +604,12 @@ void SafeBrowsingService::InitURLRequestContextOnIOThread(
new SQLitePersistentCookieStore(CookieFilePath(), false, NULL),
NULL);
- url_request_context_.reset(new SafeBrowsingURLRequestContext);
+ url_request_context_.reset(new net::URLRequestContext);
// |system_url_request_context_getter| may be NULL during tests.
- if (system_url_request_context_getter)
+ if (system_url_request_context_getter) {
url_request_context_->CopyFrom(
system_url_request_context_getter->GetURLRequestContext());
+ }
url_request_context_->set_cookie_store(cookie_store);
}

Powered by Google App Engine
This is Rietveld 408576698