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

Unified Diff: chrome/service/net/service_url_request_context.cc

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address erikwright's second round of comments. Created 8 years, 3 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/service/net/service_url_request_context.cc
diff --git a/chrome/service/net/service_url_request_context.cc b/chrome/service/net/service_url_request_context.cc
index a7ab6f2d2fe628f82012404c2a57be9007e99ad6..42bd1bd9f0fb09c19263e8350e560aa48a452558 100644
--- a/chrome/service/net/service_url_request_context.cc
+++ b/chrome/service/net/service_url_request_context.cc
@@ -25,6 +25,7 @@
#include "net/http/http_server_properties_impl.h"
#include "net/proxy/proxy_config_service.h"
#include "net/proxy/proxy_service.h"
+#include "net/url_request/const_http_user_agent_settings.h"
#include "net/url_request/url_request_throttler_manager.h"
namespace {
@@ -108,8 +109,7 @@ std::string MakeUserAgentForServiceProcess() {
ServiceURLRequestContext::ServiceURLRequestContext(
const std::string& user_agent,
net::ProxyConfigService* net_proxy_config_service)
- : user_agent_(user_agent),
- ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
+ : ALLOW_THIS_IN_INITIALIZER_LIST(storage_(this)) {
storage_.set_host_resolver(
net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
net::HostResolver::kDefaultRetryAttempts,
@@ -141,16 +141,8 @@ ServiceURLRequestContext::ServiceURLRequestContext(
net::HttpCache::DefaultBackend::InMemory(0)));
// In-memory cookie store.
storage_.set_cookie_store(new net::CookieMonster(NULL, NULL));
- set_accept_language("en-us,fr");
- set_accept_charset("iso-8859-1,*,utf-8");
-}
-
-const std::string& ServiceURLRequestContext::GetUserAgent(
- const GURL& url) const {
- // If the user agent is set explicitly return that, otherwise call the
- // base class method to return default value.
- return user_agent_.empty() ?
- net::URLRequestContext::GetUserAgent(url) : user_agent_;
+ storage_.set_http_user_agent_settings(new net::ConstHttpUserAgentSettings(
+ "en-us,fr", "iso-8859-1,*,utf-8", user_agent));
mmenke 2012/09/26 16:28:20 nit: 4-space indent
}
ServiceURLRequestContext::~ServiceURLRequestContext() {

Powered by Google App Engine
This is Rietveld 408576698