| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/cronet/android/cronet_data_reduction_proxy.h" | 5 #include "components/cronet/android/cronet_data_reduction_proxy.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 base::CommandLine::ForCurrentProcess()); | 85 base::CommandLine::ForCurrentProcess()); |
| 86 prefs_ = CreatePrefService(); | 86 prefs_ = CreatePrefService(); |
| 87 // In Cronet, the Data Reduction Proxy's UI classes are Created on Cronet's | 87 // In Cronet, the Data Reduction Proxy's UI classes are Created on Cronet's |
| 88 // network thread. | 88 // network thread. |
| 89 settings_.reset( | 89 settings_.reset( |
| 90 new data_reduction_proxy::DataReductionProxySettings()); | 90 new data_reduction_proxy::DataReductionProxySettings()); |
| 91 io_data_.reset(new data_reduction_proxy::DataReductionProxyIOData( | 91 io_data_.reset(new data_reduction_proxy::DataReductionProxyIOData( |
| 92 data_reduction_proxy::Client::CRONET_ANDROID, | 92 data_reduction_proxy::Client::CRONET_ANDROID, |
| 93 data_reduction_proxy::DataReductionProxyParams::kAllowed | | 93 data_reduction_proxy::DataReductionProxyParams::kAllowed | |
| 94 data_reduction_proxy::DataReductionProxyParams::kFallbackAllowed, | 94 data_reduction_proxy::DataReductionProxyParams::kFallbackAllowed, |
| 95 net_log, task_runner, task_runner, false, user_agent)); | 95 net_log, task_runner, task_runner, false, user_agent, std::string())); |
| 96 io_data_->request_options()->SetKeyOnIO(key); | 96 io_data_->request_options()->SetKeyOnIO(key); |
| 97 } | 97 } |
| 98 | 98 |
| 99 CronetDataReductionProxy::~CronetDataReductionProxy() { | 99 CronetDataReductionProxy::~CronetDataReductionProxy() { |
| 100 io_data_->ShutdownOnUIThread(); | 100 io_data_->ShutdownOnUIThread(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 std::unique_ptr<net::NetworkDelegate> | 103 std::unique_ptr<net::NetworkDelegate> |
| 104 CronetDataReductionProxy::CreateNetworkDelegate( | 104 CronetDataReductionProxy::CreateNetworkDelegate( |
| 105 std::unique_ptr<net::NetworkDelegate> wrapped_network_delegate) { | 105 std::unique_ptr<net::NetworkDelegate> wrapped_network_delegate) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 131 io_data_->SetDataReductionProxyService( | 131 io_data_->SetDataReductionProxyService( |
| 132 data_reduction_proxy_service->GetWeakPtr()); | 132 data_reduction_proxy_service->GetWeakPtr()); |
| 133 settings_->InitDataReductionProxySettings( | 133 settings_->InitDataReductionProxySettings( |
| 134 kDataReductionProxyEnabled, prefs_.get(), io_data_.get(), | 134 kDataReductionProxyEnabled, prefs_.get(), io_data_.get(), |
| 135 std::move(data_reduction_proxy_service)); | 135 std::move(data_reduction_proxy_service)); |
| 136 settings_->SetDataReductionProxyEnabled(enable); | 136 settings_->SetDataReductionProxyEnabled(enable); |
| 137 settings_->MaybeActivateDataReductionProxy(true); | 137 settings_->MaybeActivateDataReductionProxy(true); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace cronet | 140 } // namespace cronet |
| OLD | NEW |