OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/net/spdyproxy/data_reduction_proxy_chrome_settings.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
| 8 #include <utility> |
8 | 9 |
9 #include "base/base64.h" | 10 #include "base/base64.h" |
10 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
12 #include "base/metrics/histogram_macros.h" | 13 #include "base/metrics/histogram_macros.h" |
13 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
14 #include "base/prefs/scoped_user_pref_update.h" | 15 #include "base/prefs/scoped_user_pref_update.h" |
15 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
16 #include "base/time/time.h" | 17 #include "base/time/time.h" |
17 #include "build/build_config.h" | 18 #include "build/build_config.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // every 60 minutes and on termination. Shutdown hooks must be added for | 195 // every 60 minutes and on termination. Shutdown hooks must be added for |
195 // Android and iOS in order for non-zero delays to be supported. | 196 // Android and iOS in order for non-zero delays to be supported. |
196 // (http://crbug.com/408264) | 197 // (http://crbug.com/408264) |
197 base::TimeDelta commit_delay = base::TimeDelta(); | 198 base::TimeDelta commit_delay = base::TimeDelta(); |
198 #else | 199 #else |
199 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); | 200 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); |
200 #endif | 201 #endif |
201 | 202 |
202 scoped_ptr<data_reduction_proxy::DataReductionProxyService> service = | 203 scoped_ptr<data_reduction_proxy::DataReductionProxyService> service = |
203 make_scoped_ptr(new data_reduction_proxy::DataReductionProxyService( | 204 make_scoped_ptr(new data_reduction_proxy::DataReductionProxyService( |
204 this, profile_prefs, request_context_getter, store.Pass(), | 205 this, profile_prefs, request_context_getter, std::move(store), |
205 ui_task_runner, io_data->io_task_runner(), db_task_runner, | 206 ui_task_runner, io_data->io_task_runner(), db_task_runner, |
206 commit_delay)); | 207 commit_delay)); |
207 data_reduction_proxy::DataReductionProxySettings:: | 208 data_reduction_proxy::DataReductionProxySettings:: |
208 InitDataReductionProxySettings( | 209 InitDataReductionProxySettings(data_reduction_proxy_enabled_pref_name_, |
209 data_reduction_proxy_enabled_pref_name_, profile_prefs, io_data, | 210 profile_prefs, io_data, |
210 service.Pass()); | 211 std::move(service)); |
211 io_data->SetDataReductionProxyService( | 212 io_data->SetDataReductionProxyService( |
212 data_reduction_proxy_service()->GetWeakPtr()); | 213 data_reduction_proxy_service()->GetWeakPtr()); |
213 | 214 |
214 data_reduction_proxy::DataReductionProxySettings:: | 215 data_reduction_proxy::DataReductionProxySettings:: |
215 SetCallbackToRegisterSyntheticFieldTrial( | 216 SetCallbackToRegisterSyntheticFieldTrial( |
216 base::Bind( | 217 base::Bind( |
217 &ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial)); | 218 &ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial)); |
218 // TODO(bengr): Remove after M46. See http://crbug.com/445599. | 219 // TODO(bengr): Remove after M46. See http://crbug.com/445599. |
219 MigrateDataReductionProxyOffProxyPrefs(profile_prefs); | 220 MigrateDataReductionProxyOffProxyPrefs(profile_prefs); |
220 } | 221 } |
(...skipping 17 matching lines...) Expand all Loading... |
238 #elif defined(OS_OPENBSD) | 239 #elif defined(OS_OPENBSD) |
239 return data_reduction_proxy::Client::CHROME_OPENBSD; | 240 return data_reduction_proxy::Client::CHROME_OPENBSD; |
240 #elif defined(OS_SOLARIS) | 241 #elif defined(OS_SOLARIS) |
241 return data_reduction_proxy::Client::CHROME_SOLARIS; | 242 return data_reduction_proxy::Client::CHROME_SOLARIS; |
242 #elif defined(OS_QNX) | 243 #elif defined(OS_QNX) |
243 return data_reduction_proxy::Client::CHROME_QNX; | 244 return data_reduction_proxy::Client::CHROME_QNX; |
244 #else | 245 #else |
245 return data_reduction_proxy::Client::UNKNOWN; | 246 return data_reduction_proxy::Client::UNKNOWN; |
246 #endif | 247 #endif |
247 } | 248 } |
OLD | NEW |