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

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

Issue 14994003: Remove round trip from data reduction proxy authentication (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added data reduction proxy initialization logic Created 7 years, 7 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 | Annotate | Revision Log
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/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
11 #include "base/prefs/pref_member.h" 11 #include "base/prefs/pref_member.h"
12 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
13 #include "base/sequenced_task_runner.h" 13 #include "base/sequenced_task_runner.h"
14 #include "base/stl_util.h" 14 #include "base/stl_util.h"
15 #include "base/string_util.h" 15 #include "base/string_util.h"
16 #include "base/threading/sequenced_worker_pool.h" 16 #include "base/threading/sequenced_worker_pool.h"
17 #include "base/threading/worker_pool.h" 17 #include "base/threading/worker_pool.h"
18 #if defined(OS_ANDROID)
Yaron 2013/05/21 18:04:30 Conditional if-defs go at the bottom
bengr 2013/05/22 19:03:15 Done.
19 #include "chrome/app/android/chrome_data_reduction_proxy_android.h"
20 #endif
18 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 21 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
19 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 22 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
20 #include "chrome/browser/io_thread.h" 23 #include "chrome/browser/io_thread.h"
21 #include "chrome/browser/net/chrome_net_log.h" 24 #include "chrome/browser/net/chrome_net_log.h"
22 #include "chrome/browser/net/chrome_network_delegate.h" 25 #include "chrome/browser/net/chrome_network_delegate.h"
23 #include "chrome/browser/net/connect_interceptor.h" 26 #include "chrome/browser/net/connect_interceptor.h"
24 #include "chrome/browser/net/http_server_properties_manager.h" 27 #include "chrome/browser/net/http_server_properties_manager.h"
25 #include "chrome/browser/net/predictor.h" 28 #include "chrome/browser/net/predictor.h"
26 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" 29 #include "chrome/browser/net/sqlite_server_bound_cert_store.h"
27 #include "chrome/browser/profiles/profile.h" 30 #include "chrome/browser/profiles/profile.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 ChooseCacheBackendType(), 413 ChooseCacheBackendType(),
411 lazy_params_->cache_path, 414 lazy_params_->cache_path,
412 lazy_params_->cache_max_size, 415 lazy_params_->cache_max_size,
413 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)); 416 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
414 net::HttpNetworkSession::Params network_session_params; 417 net::HttpNetworkSession::Params network_session_params;
415 PopulateNetworkSessionParams(profile_params, &network_session_params); 418 PopulateNetworkSessionParams(profile_params, &network_session_params);
416 net::HttpCache* main_cache = new net::HttpCache( 419 net::HttpCache* main_cache = new net::HttpCache(
417 network_session_params, main_backend); 420 network_session_params, main_backend);
418 main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path); 421 main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path);
419 422
423 #if defined(OS_ANDROID)
424 scoped_ptr<ChromeDataReductionProxyAndroid> chrome_data_reduction_proxy(
425 ChromeDataReductionProxyAndroid::Create());
426 chrome_data_reduction_proxy->Init(main_cache->GetSession());
427 #endif
mmenke 2013/05/22 15:55:50 Is there a reason not to just do this all in a sta
bengr 2013/05/22 19:03:15 I was imagining that ChromeDataReductionProxy woul
mmenke 2013/05/22 19:20:12 Since this is an "eventually", and it currently se
428
420 if (record_mode || playback_mode) { 429 if (record_mode || playback_mode) {
421 main_cache->set_mode( 430 main_cache->set_mode(
422 record_mode ? net::HttpCache::RECORD : net::HttpCache::PLAYBACK); 431 record_mode ? net::HttpCache::RECORD : net::HttpCache::PLAYBACK);
423 } 432 }
424 433
425 main_http_factory_.reset(main_cache); 434 main_http_factory_.reset(main_cache);
426 main_context->set_http_transaction_factory(main_cache); 435 main_context->set_http_transaction_factory(main_cache);
427 436
428 #if !defined(DISABLE_FTP_SUPPORT) 437 #if !defined(DISABLE_FTP_SUPPORT)
429 ftp_factory_.reset( 438 ftp_factory_.reset(
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 const base::Closure& completion) { 690 const base::Closure& completion) {
682 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 691 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
683 DCHECK(initialized()); 692 DCHECK(initialized());
684 693
685 DCHECK(transport_security_state()); 694 DCHECK(transport_security_state());
686 // Completes synchronously. 695 // Completes synchronously.
687 transport_security_state()->DeleteAllDynamicDataSince(time); 696 transport_security_state()->DeleteAllDynamicDataSince(time);
688 DCHECK(http_server_properties_manager_); 697 DCHECK(http_server_properties_manager_);
689 http_server_properties_manager_->Clear(completion); 698 http_server_properties_manager_->Clear(completion);
690 } 699 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698