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

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

Issue 1547273003: Set trusted SPDY proxy dynamically on per-profile basis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated based on design doc discussion Created 4 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 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_io_data.h" 5 #include "chrome/browser/profiles/profile_io_data.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string>
9 #include <utility> 8 #include <utility>
10 9
11 #include "base/bind.h" 10 #include "base/bind.h"
12 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
13 #include "base/callback.h" 12 #include "base/callback.h"
14 #include "base/command_line.h" 13 #include "base/command_line.h"
15 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
16 #include "base/debug/alias.h" 15 #include "base/debug/alias.h"
17 #include "base/logging.h" 16 #include "base/logging.h"
18 #include "base/macros.h" 17 #include "base/macros.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 #include "components/url_formatter/url_fixer.h" 66 #include "components/url_formatter/url_fixer.h"
68 #include "content/public/browser/browser_thread.h" 67 #include "content/public/browser/browser_thread.h"
69 #include "content/public/browser/host_zoom_map.h" 68 #include "content/public/browser/host_zoom_map.h"
70 #include "content/public/browser/notification_service.h" 69 #include "content/public/browser/notification_service.h"
71 #include "content/public/browser/resource_context.h" 70 #include "content/public/browser/resource_context.h"
72 #include "net/base/keygen_handler.h" 71 #include "net/base/keygen_handler.h"
73 #include "net/base/network_quality_estimator.h" 72 #include "net/base/network_quality_estimator.h"
74 #include "net/cert/cert_verifier.h" 73 #include "net/cert/cert_verifier.h"
75 #include "net/cert/multi_log_ct_verifier.h" 74 #include "net/cert/multi_log_ct_verifier.h"
76 #include "net/cookies/canonical_cookie.h" 75 #include "net/cookies/canonical_cookie.h"
77 #include "net/http/http_network_session.h"
78 #include "net/http/http_transaction_factory.h" 76 #include "net/http/http_transaction_factory.h"
79 #include "net/http/http_util.h" 77 #include "net/http/http_util.h"
80 #include "net/http/transport_security_persister.h" 78 #include "net/http/transport_security_persister.h"
81 #include "net/proxy/proxy_config_service_fixed.h" 79 #include "net/proxy/proxy_config_service_fixed.h"
82 #include "net/proxy/proxy_script_fetcher_impl.h" 80 #include "net/proxy/proxy_script_fetcher_impl.h"
83 #include "net/proxy/proxy_service.h" 81 #include "net/proxy/proxy_service.h"
84 #include "net/ssl/channel_id_service.h" 82 #include "net/ssl/channel_id_service.h"
85 #include "net/ssl/client_cert_store.h" 83 #include "net/ssl/client_cert_store.h"
86 #include "net/url_request/certificate_report_sender.h" 84 #include "net/url_request/certificate_report_sender.h"
87 #include "net/url_request/data_protocol_handler.h" 85 #include "net/url_request/data_protocol_handler.h"
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1292 1290
1293 IOThread* const io_thread = profile_params.io_thread; 1291 IOThread* const io_thread = profile_params.io_thread;
1294 1292
1295 io_thread->InitializeNetworkSessionParams(&params); 1293 io_thread->InitializeNetworkSessionParams(&params);
1296 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context, 1294 net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context,
1297 &params); 1295 &params);
1298 if (!IsOffTheRecord()) { 1296 if (!IsOffTheRecord()) {
1299 params.socket_performance_watcher_factory = 1297 params.socket_performance_watcher_factory =
1300 io_thread->globals()->network_quality_estimator.get(); 1298 io_thread->globals()->network_quality_estimator.get();
1301 } 1299 }
1300 SetProxyDelegate(profile_params, &params);
1301
1302 if (data_reduction_proxy_io_data_.get()) 1302 if (data_reduction_proxy_io_data_.get())
1303 params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate(); 1303 params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate();
1304 1304
1305 return scoped_ptr<net::HttpNetworkSession>( 1305 return scoped_ptr<net::HttpNetworkSession>(
1306 new net::HttpNetworkSession(params)); 1306 new net::HttpNetworkSession(params));
1307 } 1307 }
1308 1308
1309 scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory( 1309 scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory(
1310 net::HttpNetworkSession* session, 1310 net::HttpNetworkSession* session,
1311 scoped_ptr<net::HttpCache::BackendFactory> main_backend) const { 1311 scoped_ptr<net::HttpCache::BackendFactory> main_backend) const {
(...skipping 10 matching lines...) Expand all
1322 make_scoped_ptr(new DevToolsNetworkTransactionFactory( 1322 make_scoped_ptr(new DevToolsNetworkTransactionFactory(
1323 network_controller_handle_.GetController(), shared_session)), 1323 network_controller_handle_.GetController(), shared_session)),
1324 std::move(backend), true /* set_up_quic_server_info */)); 1324 std::move(backend), true /* set_up_quic_server_info */));
1325 } 1325 }
1326 1326
1327 void ProfileIOData::SetCookieSettingsForTesting( 1327 void ProfileIOData::SetCookieSettingsForTesting(
1328 content_settings::CookieSettings* cookie_settings) { 1328 content_settings::CookieSettings* cookie_settings) {
1329 DCHECK(!cookie_settings_.get()); 1329 DCHECK(!cookie_settings_.get());
1330 cookie_settings_ = cookie_settings; 1330 cookie_settings_ = cookie_settings;
1331 } 1331 }
1332
1333 void ProfileIOData::SetProxyDelegate(
bengr 2016/01/26 19:39:55 Line 1302 already does this, so remove this method
tbansal1 2016/01/27 00:13:33 Obsolete.
1334 const ProfileParams& profile_params,
1335 net::HttpNetworkSession::Params* params) const {
1336 DCHECK_CURRENTLY_ON(BrowserThread::IO);
1337 DCHECK(!params->proxy_delegate);
1338
1339 if (IsOffTheRecord())
bengr 2016/01/26 19:39:55 Can you implement this in ProfileImplIOData instea
tbansal1 2016/01/27 00:13:33 Obsolete.
1340 return;
1341
1342 // Set proxy_delegate to Data Reduction Proxy.
bengr 2016/01/26 19:39:55 Proxy -> Proxy's
tbansal1 2016/01/27 00:13:33 Obsolete.
1343 if (data_reduction_proxy_io_data()) {
1344 params->proxy_delegate = data_reduction_proxy_io_data()->proxy_delegate();
1345 return;
bengr 2016/01/26 19:39:55 Remove the return and the curly braces.
tbansal1 2016/01/27 00:13:33 Obsolete.
1346 }
1347 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698