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

Unified Diff: net/url_request/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: Disable test for chrome_frame_net_tests Created 8 years, 1 month 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 | « net/url_request/url_request_context.h ('k') | net/url_request/url_request_context_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_context.cc
diff --git a/net/url_request/url_request_context.cc b/net/url_request/url_request_context.cc
index 42a578961e72c8c66fd310f2bf1de718dc6c67d7..94d7f22e1007a98017e6d56e3230c00bae623498 100644
--- a/net/url_request/url_request_context.cc
+++ b/net/url_request/url_request_context.cc
@@ -12,6 +12,7 @@
#include "net/cookies/cookie_store.h"
#include "net/ftp/ftp_transaction_factory.h"
#include "net/http/http_transaction_factory.h"
+#include "net/url_request/http_user_agent_settings.h"
#include "net/url_request/url_request.h"
namespace net {
@@ -26,6 +27,7 @@ URLRequestContext::URLRequestContext()
proxy_service_(NULL),
network_delegate_(NULL),
http_server_properties_(NULL),
+ http_user_agent_settings_(NULL),
transport_security_state_(NULL),
#if !defined(DISABLE_FTP_SUPPORT)
ftp_auth_cache_(new FtpAuthCache),
@@ -56,12 +58,11 @@ void URLRequestContext::CopyFrom(const URLRequestContext* other) {
set_cookie_store(other->cookie_store_);
set_transport_security_state(other->transport_security_state_);
// FTPAuthCache is unique per context.
- set_accept_language(other->accept_language_);
- set_accept_charset(other->accept_charset_);
set_http_transaction_factory(other->http_transaction_factory_);
set_ftp_transaction_factory(other->ftp_transaction_factory_);
set_job_factory(other->job_factory_);
set_throttler_manager(other->throttler_manager_);
+ set_http_user_agent_settings(other->http_user_agent_settings_);
}
const HttpNetworkSession::Params* URLRequestContext::GetNetworkSessionParams(
@@ -84,8 +85,19 @@ void URLRequestContext::set_cookie_store(CookieStore* cookie_store) {
cookie_store_ = cookie_store;
}
-const std::string& URLRequestContext::GetUserAgent(const GURL& url) const {
- return EmptyString();
+std::string URLRequestContext::GetAcceptCharset() const {
+ return http_user_agent_settings_ ?
+ http_user_agent_settings_->GetAcceptCharset() : EmptyString();
+}
+
+std::string URLRequestContext::GetAcceptLanguage() const {
+ return http_user_agent_settings_ ?
+ http_user_agent_settings_->GetAcceptLanguage() : EmptyString();
+}
+
+std::string URLRequestContext::GetUserAgent(const GURL& url) const {
+ return http_user_agent_settings_ ?
+ http_user_agent_settings_->GetUserAgent(url) : EmptyString();
}
void URLRequestContext::AssertNoURLRequests() const {
« no previous file with comments | « net/url_request/url_request_context.h ('k') | net/url_request/url_request_context_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698