 Chromium Code Reviews
 Chromium Code Reviews Issue 286013002:
  Added alternative configuration for the data reduction proxy  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 286013002:
  Added alternative configuration for the data reduction proxy  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 #if defined(SPDY_PROXY_AUTH_VALUE) | 
| 53 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" | |
| 
mmenke
2014/05/21 16:10:17
Is this actually needed?  We don't dereference a p
 
bengr
2014/05/28 01:25:32
Done.
 | |
| 53 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" | 54 #include "components/data_reduction_proxy/browser/data_reduction_proxy_settings. h" | 
| 54 #endif | 55 #endif | 
| 55 #endif | 56 #endif | 
| 56 | 57 | 
| 57 namespace { | 58 namespace { | 
| 58 | 59 | 
| 59 // Identifies Chrome as the source of Domain Reliability uploads it sends. | 60 // Identifies Chrome as the source of Domain Reliability uploads it sends. | 
| 60 const char* kDomainReliabilityUploadReporterString = "chrome"; | 61 const char* kDomainReliabilityUploadReporterString = "chrome"; | 
| 61 | 62 | 
| 62 net::BackendType ChooseCacheBackendType() { | 63 net::BackendType ChooseCacheBackendType() { | 
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 477 .get()); | 478 .get()); | 
| 478 net::HttpNetworkSession::Params network_session_params; | 479 net::HttpNetworkSession::Params network_session_params; | 
| 479 PopulateNetworkSessionParams(profile_params, &network_session_params); | 480 PopulateNetworkSessionParams(profile_params, &network_session_params); | 
| 480 net::HttpCache* main_cache = new net::HttpCache( | 481 net::HttpCache* main_cache = new net::HttpCache( | 
| 481 network_session_params, main_backend); | 482 network_session_params, main_backend); | 
| 482 main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path); | 483 main_cache->InitializeInfiniteCache(lazy_params_->infinite_cache_path); | 
| 483 | 484 | 
| 484 #if defined(OS_ANDROID) || defined(OS_IOS) | 485 #if defined(OS_ANDROID) || defined(OS_IOS) | 
| 485 #if defined(SPDY_PROXY_AUTH_VALUE) | 486 #if defined(SPDY_PROXY_AUTH_VALUE) | 
| 486 data_reduction_proxy::DataReductionProxySettings:: | 487 data_reduction_proxy::DataReductionProxySettings:: | 
| 487 InitDataReductionProxySession(main_cache->GetSession(), | 488 InitDataReductionProxySession( | 
| 488 SPDY_PROXY_AUTH_VALUE); | 489 main_cache->GetSession(), | 
| 490 io_thread_globals->data_reduction_proxy_params.get()); | |
| 489 #endif | 491 #endif | 
| 490 #endif | 492 #endif | 
| 491 | 493 | 
| 492 if (chrome_browser_net::ShouldUseInMemoryCookiesAndCache()) { | 494 if (chrome_browser_net::ShouldUseInMemoryCookiesAndCache()) { | 
| 493 main_cache->set_mode( | 495 main_cache->set_mode( | 
| 494 chrome_browser_net::IsCookieRecordMode() ? | 496 chrome_browser_net::IsCookieRecordMode() ? | 
| 495 net::HttpCache::RECORD : net::HttpCache::PLAYBACK); | 497 net::HttpCache::RECORD : net::HttpCache::PLAYBACK); | 
| 496 } | 498 } | 
| 497 | 499 | 
| 498 main_http_factory_.reset(main_cache); | 500 main_http_factory_.reset(main_cache); | 
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 768 domain_reliability::DomainReliabilityClearMode mode, | 770 domain_reliability::DomainReliabilityClearMode mode, | 
| 769 const base::Closure& completion) { | 771 const base::Closure& completion) { | 
| 770 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 772 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 
| 771 DCHECK(initialized()); | 773 DCHECK(initialized()); | 
| 772 | 774 | 
| 773 if (domain_reliability_monitor_) | 775 if (domain_reliability_monitor_) | 
| 774 domain_reliability_monitor_->ClearBrowsingData(mode); | 776 domain_reliability_monitor_->ClearBrowsingData(mode); | 
| 775 | 777 | 
| 776 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, completion); | 778 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, completion); | 
| 777 } | 779 } | 
| OLD | NEW |