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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 #include "net/base/sdch_manager.h" | 54 #include "net/base/sdch_manager.h" |
55 #include "net/ftp/ftp_network_layer.h" | 55 #include "net/ftp/ftp_network_layer.h" |
56 #include "net/http/http_cache.h" | 56 #include "net/http/http_cache.h" |
57 #include "net/http/http_server_properties_manager.h" | 57 #include "net/http/http_server_properties_manager.h" |
58 #include "net/sdch/sdch_owner.h" | 58 #include "net/sdch/sdch_owner.h" |
59 #include "net/ssl/channel_id_service.h" | 59 #include "net/ssl/channel_id_service.h" |
60 #include "net/url_request/url_request_intercepting_job_factory.h" | 60 #include "net/url_request/url_request_intercepting_job_factory.h" |
61 #include "net/url_request/url_request_job_factory_impl.h" | 61 #include "net/url_request/url_request_job_factory_impl.h" |
62 #include "storage/browser/quota/special_storage_policy.h" | 62 #include "storage/browser/quota/special_storage_policy.h" |
63 | 63 |
64 #if defined(OS_ANDROID) | |
65 #include "components/data_reduction_proxy/content/browser/data_reduction_proxy_u i_service.h" | |
66 #endif | |
67 | |
64 namespace { | 68 namespace { |
65 | 69 |
66 net::BackendType ChooseCacheBackendType() { | 70 net::BackendType ChooseCacheBackendType() { |
67 #if defined(OS_ANDROID) | 71 #if defined(OS_ANDROID) |
68 return net::CACHE_BACKEND_SIMPLE; | 72 return net::CACHE_BACKEND_SIMPLE; |
69 #else | 73 #else |
70 const base::CommandLine& command_line = | 74 const base::CommandLine& command_line = |
71 *base::CommandLine::ForCurrentProcess(); | 75 *base::CommandLine::ForCurrentProcess(); |
72 if (command_line.HasSwitch(switches::kUseSimpleCacheBackend)) { | 76 if (command_line.HasSwitch(switches::kUseSimpleCacheBackend)) { |
73 const std::string opt_value = | 77 const std::string opt_value = |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 data_reduction_proxy_params(), | 469 data_reduction_proxy_params(), |
466 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)))); | 470 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)))); |
467 set_data_reduction_proxy_usage_stats( | 471 set_data_reduction_proxy_usage_stats( |
468 scoped_ptr<data_reduction_proxy::DataReductionProxyUsageStats> | 472 scoped_ptr<data_reduction_proxy::DataReductionProxyUsageStats> |
469 (new data_reduction_proxy::DataReductionProxyUsageStats( | 473 (new data_reduction_proxy::DataReductionProxyUsageStats( |
470 data_reduction_proxy_params(), | 474 data_reduction_proxy_params(), |
471 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI) | 475 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI) |
472 .get()))); | 476 .get()))); |
473 data_reduction_proxy_usage_stats()->set_unavailable_callback( | 477 data_reduction_proxy_usage_stats()->set_unavailable_callback( |
474 data_reduction_proxy_unavailable_callback()); | 478 data_reduction_proxy_unavailable_callback()); |
479 #if defined(OS_ANDROID) | |
480 set_data_reduction_proxy_ui_service( | |
481 scoped_ptr<data_reduction_proxy::DataReductionProxyUIService> | |
482 (new data_reduction_proxy::DataReductionProxyUIService( | |
mmenke
2015/01/16 20:15:27
DataReductionProxyDebugUIService? Should make it
megjablon
2015/01/17 02:21:48
Done.
| |
483 base::Bind(&data_reduction_proxy::DataReductionProxyConfigurator:: | |
484 GetProxyConfigOnIOThread, | |
485 base::Unretained(data_reduction_proxy_configurator())), | |
486 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | |
487 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)))); | |
488 #endif | |
475 | 489 |
476 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. | 490 // TODO(vadimt): Remove ScopedTracker below once crbug.com/436671 is fixed. |
477 tracked_objects::ScopedTracker tracking_profile3( | 491 tracked_objects::ScopedTracker tracking_profile3( |
478 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 492 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
479 "436671 ProfileImplIOData::InitializeInternal3")); | 493 "436671 ProfileImplIOData::InitializeInternal3")); |
480 | 494 |
481 scoped_ptr<data_reduction_proxy::DataReductionProxyNetworkDelegate> | 495 scoped_ptr<data_reduction_proxy::DataReductionProxyNetworkDelegate> |
482 data_reduction_proxy_network_delegate( | 496 data_reduction_proxy_network_delegate( |
483 new data_reduction_proxy::DataReductionProxyNetworkDelegate( | 497 new data_reduction_proxy::DataReductionProxyNetworkDelegate( |
484 chrome_network_delegate.Pass(), | 498 chrome_network_delegate.Pass(), |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
909 transport_security_state()->DeleteAllDynamicDataSince(time); | 923 transport_security_state()->DeleteAllDynamicDataSince(time); |
910 DCHECK(http_server_properties_manager_); | 924 DCHECK(http_server_properties_manager_); |
911 http_server_properties_manager_->Clear(completion); | 925 http_server_properties_manager_->Clear(completion); |
912 } | 926 } |
913 | 927 |
914 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { | 928 bool ProfileImplIOData::IsDataReductionProxyEnabled() const { |
915 return data_reduction_proxy_enabled_.GetValue() || | 929 return data_reduction_proxy_enabled_.GetValue() || |
916 base::CommandLine::ForCurrentProcess()->HasSwitch( | 930 base::CommandLine::ForCurrentProcess()->HasSwitch( |
917 data_reduction_proxy::switches::kEnableDataReductionProxy); | 931 data_reduction_proxy::switches::kEnableDataReductionProxy); |
918 } | 932 } |
OLD | NEW |