OLD | NEW |
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" |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "content/public/browser/storage_partition.h" | 38 #include "content/public/browser/storage_partition.h" |
39 #include "extensions/common/constants.h" | 39 #include "extensions/common/constants.h" |
40 #include "net/base/cache_type.h" | 40 #include "net/base/cache_type.h" |
41 #include "net/ftp/ftp_network_layer.h" | 41 #include "net/ftp/ftp_network_layer.h" |
42 #include "net/http/http_cache.h" | 42 #include "net/http/http_cache.h" |
43 #include "net/ssl/server_bound_cert_service.h" | 43 #include "net/ssl/server_bound_cert_service.h" |
44 #include "net/url_request/protocol_intercept_job_factory.h" | 44 #include "net/url_request/protocol_intercept_job_factory.h" |
45 #include "net/url_request/url_request_job_factory_impl.h" | 45 #include "net/url_request/url_request_job_factory_impl.h" |
46 #include "webkit/browser/quota/special_storage_policy.h" | 46 #include "webkit/browser/quota/special_storage_policy.h" |
47 | 47 |
48 #if defined(OS_ANDROID) | 48 #if defined(OS_ANDROID) || defined(OS_IOS) |
49 #include "chrome/app/android/chrome_data_reduction_proxy_android.h" | 49 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h" |
50 #endif | 50 #endif |
51 | 51 |
52 namespace { | 52 namespace { |
53 | 53 |
54 net::BackendType ChooseCacheBackendType() { | 54 net::BackendType ChooseCacheBackendType() { |
55 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 55 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
56 if (command_line.HasSwitch(switches::kUseSimpleCacheBackend)) { | 56 if (command_line.HasSwitch(switches::kUseSimpleCacheBackend)) { |
57 const std::string opt_value = | 57 const std::string opt_value = |
58 command_line.GetSwitchValueASCII(switches::kUseSimpleCacheBackend); | 58 command_line.GetSwitchValueASCII(switches::kUseSimpleCacheBackend); |
59 if (LowerCaseEqualsASCII(opt_value, "off")) | 59 if (LowerCaseEqualsASCII(opt_value, "off")) |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 lazy_params_->cache_path, | 425 lazy_params_->cache_path, |
426 lazy_params_->cache_max_size, | 426 lazy_params_->cache_max_size, |
427 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE) | 427 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE) |
428 .get()); | 428 .get()); |
429 net::HttpNetworkSession::Params network_session_params; | 429 net::HttpNetworkSession::Params network_session_params; |
430 PopulateNetworkSessionParams(profile_params, &network_session_params); | 430 PopulateNetworkSessionParams(profile_params, &network_session_params); |
431 net::HttpCache* main_cache = new net::HttpCache( | 431 net::HttpCache* main_cache = new net::HttpCache( |
432 network_session_params, main_backend); | 432 network_session_params, main_backend); |
433 main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path); | 433 main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path); |
434 | 434 |
435 #if defined(OS_ANDROID) | 435 #if defined(OS_ANDROID) || defined(OS_IOS) |
436 ChromeDataReductionProxyAndroid::Init(main_cache->GetSession()); | 436 DataReductionProxySettings::InitDataReductionProxySession( |
| 437 main_cache->GetSession()); |
437 #endif | 438 #endif |
438 | 439 |
439 if (record_mode || playback_mode) { | 440 if (record_mode || playback_mode) { |
440 main_cache->set_mode( | 441 main_cache->set_mode( |
441 record_mode ? net::HttpCache::RECORD : net::HttpCache::PLAYBACK); | 442 record_mode ? net::HttpCache::RECORD : net::HttpCache::PLAYBACK); |
442 } | 443 } |
443 | 444 |
444 main_http_factory_.reset(main_cache); | 445 main_http_factory_.reset(main_cache); |
445 main_context->set_http_transaction_factory(main_cache); | 446 main_context->set_http_transaction_factory(main_cache); |
446 | 447 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 const base::Closure& completion) { | 696 const base::Closure& completion) { |
696 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 697 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
697 DCHECK(initialized()); | 698 DCHECK(initialized()); |
698 | 699 |
699 DCHECK(transport_security_state()); | 700 DCHECK(transport_security_state()); |
700 // Completes synchronously. | 701 // Completes synchronously. |
701 transport_security_state()->DeleteAllDynamicDataSince(time); | 702 transport_security_state()->DeleteAllDynamicDataSince(time); |
702 DCHECK(http_server_properties_manager_); | 703 DCHECK(http_server_properties_manager_); |
703 http_server_properties_manager_->Clear(completion); | 704 http_server_properties_manager_->Clear(completion); |
704 } | 705 } |
OLD | NEW |