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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "extensions/common/constants.h" | 42 #include "extensions/common/constants.h" |
43 #include "net/base/cache_type.h" | 43 #include "net/base/cache_type.h" |
44 #include "net/ftp/ftp_network_layer.h" | 44 #include "net/ftp/ftp_network_layer.h" |
45 #include "net/http/http_cache.h" | 45 #include "net/http/http_cache.h" |
46 #include "net/ssl/server_bound_cert_service.h" | 46 #include "net/ssl/server_bound_cert_service.h" |
47 #include "net/url_request/protocol_intercept_job_factory.h" | 47 #include "net/url_request/protocol_intercept_job_factory.h" |
48 #include "net/url_request/url_request_job_factory_impl.h" | 48 #include "net/url_request/url_request_job_factory_impl.h" |
49 #include "webkit/browser/quota/special_storage_policy.h" | 49 #include "webkit/browser/quota/special_storage_policy.h" |
50 | 50 |
51 #if defined(OS_ANDROID) || defined(OS_IOS) | 51 #if defined(OS_ANDROID) || defined(OS_IOS) |
| 52 #if defined(SPDY_PROXY_AUTH_VALUE) |
52 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" | 53 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings.
h" |
53 #endif | 54 #endif |
| 55 #endif |
54 | 56 |
55 namespace { | 57 namespace { |
56 | 58 |
57 // Identifies Chrome as the source of Domain Reliability uploads it sends. | 59 // Identifies Chrome as the source of Domain Reliability uploads it sends. |
58 const char* kDomainReliabilityUploadReporterString = "chrome"; | 60 const char* kDomainReliabilityUploadReporterString = "chrome"; |
59 | 61 |
60 net::BackendType ChooseCacheBackendType() { | 62 net::BackendType ChooseCacheBackendType() { |
61 #if defined(OS_ANDROID) | 63 #if defined(OS_ANDROID) |
62 return net::CACHE_BACKEND_SIMPLE; | 64 return net::CACHE_BACKEND_SIMPLE; |
63 #else | 65 #else |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 lazy_params_->cache_path, | 474 lazy_params_->cache_path, |
473 lazy_params_->cache_max_size, | 475 lazy_params_->cache_max_size, |
474 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE) | 476 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE) |
475 .get()); | 477 .get()); |
476 net::HttpNetworkSession::Params network_session_params; | 478 net::HttpNetworkSession::Params network_session_params; |
477 PopulateNetworkSessionParams(profile_params, &network_session_params); | 479 PopulateNetworkSessionParams(profile_params, &network_session_params); |
478 net::HttpCache* main_cache = new net::HttpCache( | 480 net::HttpCache* main_cache = new net::HttpCache( |
479 network_session_params, main_backend); | 481 network_session_params, main_backend); |
480 main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path); | 482 main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path); |
481 | 483 |
| 484 #if defined(OS_ANDROID) || defined(OS_IOS) |
482 #if defined(SPDY_PROXY_AUTH_VALUE) | 485 #if defined(SPDY_PROXY_AUTH_VALUE) |
483 data_reduction_proxy::DataReductionProxySettings:: | 486 data_reduction_proxy::DataReductionProxySettings:: |
484 InitDataReductionProxySession(main_cache->GetSession(), | 487 InitDataReductionProxySession(main_cache->GetSession(), |
485 SPDY_PROXY_AUTH_VALUE); | 488 SPDY_PROXY_AUTH_VALUE); |
486 #endif | 489 #endif |
| 490 #endif |
487 | 491 |
488 if (chrome_browser_net::ShouldUseInMemoryCookiesAndCache()) { | 492 if (chrome_browser_net::ShouldUseInMemoryCookiesAndCache()) { |
489 main_cache->set_mode( | 493 main_cache->set_mode( |
490 chrome_browser_net::IsCookieRecordMode() ? | 494 chrome_browser_net::IsCookieRecordMode() ? |
491 net::HttpCache::RECORD : net::HttpCache::PLAYBACK); | 495 net::HttpCache::RECORD : net::HttpCache::PLAYBACK); |
492 } | 496 } |
493 | 497 |
494 main_http_factory_.reset(main_cache); | 498 main_http_factory_.reset(main_cache); |
495 main_context->set_http_transaction_factory(main_cache); | 499 main_context->set_http_transaction_factory(main_cache); |
496 | 500 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 domain_reliability::DomainReliabilityClearMode mode, | 768 domain_reliability::DomainReliabilityClearMode mode, |
765 const base::Closure& completion) { | 769 const base::Closure& completion) { |
766 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 770 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
767 DCHECK(initialized()); | 771 DCHECK(initialized()); |
768 | 772 |
769 if (domain_reliability_monitor_) | 773 if (domain_reliability_monitor_) |
770 domain_reliability_monitor_->ClearBrowsingData(mode); | 774 domain_reliability_monitor_->ClearBrowsingData(mode); |
771 | 775 |
772 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, completion); | 776 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, completion); |
773 } | 777 } |
OLD | NEW |