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

Unified Diff: chrome/browser/profiles/profile_io_data.cc

Issue 10918279: Provide mutable members of UrlRequestContext via pure-virtual interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: const-ify HUAS getters 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/profiles/profile_io_data.cc
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index 78153f5e1371dbc29328b18a54d92590db72a41a..0ad6918767c8075cf4c6ebe04df25920ca12a288 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -31,6 +31,7 @@
#include "chrome/browser/io_thread.h"
#include "chrome/browser/net/chrome_cookie_notification_details.h"
#include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h"
+#include "chrome/browser/net/chrome_http_user_agent_settings.h"
#include "chrome/browser/net/chrome_net_log.h"
#include "chrome/browser/net/chrome_network_delegate.h"
#include "chrome/browser/net/http_server_properties_manager.h"
@@ -144,12 +145,8 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
scoped_ptr<ProfileParams> params(new ProfileParams);
params->path = profile->GetPath();
- // Set up Accept-Language and Accept-Charset header values
- params->accept_language = net::HttpUtil::GenerateAcceptLanguageHeader(
- pref_service->GetString(prefs::kAcceptLanguages));
- std::string default_charset = pref_service->GetString(prefs::kDefaultCharset);
- params->accept_charset =
- net::HttpUtil::GenerateAcceptCharsetHeader(default_charset);
+ params->chrome_http_user_agent_settings.reset(
+ new ChromeHttpUserAgentSettings(pref_service));
params->io_thread = g_browser_process->io_thread();
@@ -569,6 +566,9 @@ void ProfileIOData::LazyInitialize() const {
profile_params_->resource_prefetch_predictor_observer_.release());
}
+ chrome_http_user_agent_settings_.reset(
+ profile_params_->chrome_http_user_agent_settings.release());
+
LazyInitializeInternal(profile_params_.get());
profile_params_.reset();
@@ -578,8 +578,8 @@ void ProfileIOData::LazyInitialize() const {
void ProfileIOData::ApplyProfileParamsToContext(
ChromeURLRequestContext* context) const {
context->set_is_incognito(is_incognito());
- context->set_accept_language(profile_params_->accept_language);
- context->set_accept_charset(profile_params_->accept_charset);
+ context->set_http_user_agent_settings(
+ chrome_http_user_agent_settings_.get());
mmenke 2012/10/25 18:06:33 nit: 4 space indent. Actually, can this all fit
context->set_ssl_config_service(profile_params_->ssl_config_service);
}
@@ -663,6 +663,8 @@ void ProfileIOData::ShutdownOnUIThread() {
if (url_blacklist_manager_.get())
url_blacklist_manager_->ShutdownOnUIThread();
#endif
+ if (chrome_http_user_agent_settings_.get())
+ chrome_http_user_agent_settings_->CleanupOnUIThread();
mmenke 2012/10/25 18:06:33 Doesn't this always need to be called? Otherwise,
pauljensen 2012/10/25 21:30:25 I don't think we can construct ChromeHttpUserAgent
mmenke 2012/10/26 18:42:09 Sounds like the best approach to me, too.
bool posted = BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, this);
if (!posted)
delete this;

Powered by Google App Engine
This is Rietveld 408576698