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

Side by Side Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 903213003: Enable QUIC for proxies based on Finch config and command line switch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments and removed code duplication. Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profiles/profile_impl_io_data.h" 5 #include "chrome/browser/profiles/profile_impl_io_data.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 165
166 io_data_->predictor_.reset(predictor); 166 io_data_->predictor_.reset(predictor);
167 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass(); 167 io_data_->domain_reliability_monitor_ = domain_reliability_monitor.Pass();
168 168
169 io_data_->InitializeMetricsEnabledStateOnUIThread(); 169 io_data_->InitializeMetricsEnabledStateOnUIThread();
170 if (io_data_->domain_reliability_monitor_) 170 if (io_data_->domain_reliability_monitor_)
171 io_data_->domain_reliability_monitor_->MoveToNetworkThread(); 171 io_data_->domain_reliability_monitor_->MoveToNetworkThread();
172 172
173 ChromeNetLog* const net_log = g_browser_process->io_thread()->net_log(); 173 ChromeNetLog* const net_log = g_browser_process->io_thread()->net_log();
174 174
175 const base::CommandLine& command_line =
176 *base::CommandLine::ForCurrentProcess();
177 bool quic_enabled_for_proxies =
178 IOThread::ShouldEnableQuicForProxies(command_line,
179 IOThread::QuicFieldTrialName());
175 io_data_->set_data_reduction_proxy_io_data( 180 io_data_->set_data_reduction_proxy_io_data(
176 CreateDataReductionProxyChromeIOData( 181 CreateDataReductionProxyChromeIOData(
177 net_log, profile_, profile_->GetPrefs(), 182 net_log, profile_, profile_->GetPrefs(),
178 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), 183 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
179 BrowserThread::GetMessageLoopProxyForThread( 184 BrowserThread::GetMessageLoopProxyForThread(
180 BrowserThread::UI)).Pass()); 185 BrowserThread::UI)).Pass());
181 186
182 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_)-> 187 DataReductionProxyChromeSettingsFactory::GetForBrowserContext(profile_)
183 InitDataReductionProxySettings(io_data_->data_reduction_proxy_io_data(), 188 ->InitDataReductionProxySettings(
184 profile_->GetPrefs(), 189 io_data_->data_reduction_proxy_io_data(), profile_->GetPrefs(),
185 g_browser_process->local_state(), 190 g_browser_process->local_state(), profile_->GetRequestContext(),
186 profile_->GetRequestContext()); 191 quic_enabled_for_proxies);
187 } 192 }
188 193
189 content::ResourceContext* 194 content::ResourceContext*
190 ProfileImplIOData::Handle::GetResourceContext() const { 195 ProfileImplIOData::Handle::GetResourceContext() const {
191 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 196 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
192 LazyInitialize(); 197 LazyInitialize();
193 return GetResourceContextNoInit(); 198 return GetResourceContextNoInit();
194 } 199 }
195 200
196 content::ResourceContext* 201 content::ResourceContext*
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 const base::Closure& completion) { 852 const base::Closure& completion) {
848 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 853 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
849 DCHECK(initialized()); 854 DCHECK(initialized());
850 855
851 DCHECK(transport_security_state()); 856 DCHECK(transport_security_state());
852 // Completes synchronously. 857 // Completes synchronously.
853 transport_security_state()->DeleteAllDynamicDataSince(time); 858 transport_security_state()->DeleteAllDynamicDataSince(time);
854 DCHECK(http_server_properties_manager_); 859 DCHECK(http_server_properties_manager_);
855 http_server_properties_manager_->Clear(completion); 860 http_server_properties_manager_->Clear(completion);
856 } 861 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698