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

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

Issue 2546533003: Respect QuicAllowed policy for new streams (Closed)
Patch Set: Move ApplySettingsOnIOThread out of NetHttpSessionParamsObserver Created 3 years, 11 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 f5acaf6aa25e5c973a439269282e438a6bb3eeb9..e54729d36c704d329f30f373456f74af12c8baae 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -46,6 +46,7 @@
#include "chrome/browser/policy/policy_helpers.h"
#include "chrome/browser/predictors/resource_prefetch_predictor.h"
#include "chrome/browser/predictors/resource_prefetch_predictor_factory.h"
+#include "chrome/browser/profiles/net_http_session_params_observer.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ssl/chrome_expect_ct_reporter.h"
@@ -470,6 +471,14 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) {
&allowed_domains_for_apps_,
pref_service);
+ DCHECK(!net_http_session_params_observer_);
+ NetHttpSessionParamsObserver::UpdateNetParamsCallback
+ update_net_params_callback = base::Bind(
+ &ProfileIOData::UpdateNetParamsOnIOThread, base::Unretained(this));
+ net_http_session_params_observer_ =
+ base::MakeUnique<NetHttpSessionParamsObserver>(
+ pref_service, update_net_params_callback);
mmenke 2017/01/09 16:46:04 I believe this is a bug. We haven't even created
pmarko 2017/01/09 19:53:12 This was very misleading, sorry about that. I've t
+
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner =
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO);
@@ -926,6 +935,16 @@ std::unique_ptr<net::ClientCertStore> ProfileIOData::CreateClientCertStore() {
#endif
}
+void ProfileIOData::UpdateNetParamsOnIOThread(
+ net::HttpNetworkSession::ParamsUpdate params_update) {
+ if (!main_request_context_storage_ ||
+ !main_request_context_storage_->http_network_session())
+ return;
+
+ main_request_context_storage_->http_network_session()->UpdateParams(
+ params_update);
+}
+
void ProfileIOData::set_data_reduction_proxy_io_data(
std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData>
data_reduction_proxy_io_data) const {
@@ -1236,6 +1255,7 @@ void ProfileIOData::ShutdownOnUIThread(
if (chrome_http_user_agent_settings_)
chrome_http_user_agent_settings_->CleanupOnUIThread();
incognito_availibility_pref_.Destroy();
+ net_http_session_params_observer_.reset();
if (!context_getters->empty()) {
if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) {

Powered by Google App Engine
This is Rietveld 408576698