| 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 "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_io_data.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData> | 52 std::unique_ptr<data_reduction_proxy::DataReductionProxyIOData> |
| 53 CreateDataReductionProxyChromeIOData( | 53 CreateDataReductionProxyChromeIOData( |
| 54 net::NetLog* net_log, | 54 net::NetLog* net_log, |
| 55 PrefService* prefs, | 55 PrefService* prefs, |
| 56 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, | 56 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner, |
| 57 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { | 57 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { |
| 58 DCHECK(net_log); | 58 DCHECK(net_log); |
| 59 DCHECK(prefs); | 59 DCHECK(prefs); |
| 60 | 60 |
| 61 int flags = DataReductionProxyParams::kAllowed | | 61 int flags = 0; |
| 62 DataReductionProxyParams::kFallbackAllowed; | |
| 63 if (data_reduction_proxy::params::IsIncludedInPromoFieldTrial()) | 62 if (data_reduction_proxy::params::IsIncludedInPromoFieldTrial()) |
| 64 flags |= DataReductionProxyParams::kPromoAllowed; | 63 flags |= DataReductionProxyParams::kPromoAllowed; |
| 65 if (data_reduction_proxy::params::IsIncludedInHoldbackFieldTrial()) | 64 if (data_reduction_proxy::params::IsIncludedInHoldbackFieldTrial()) |
| 66 flags |= DataReductionProxyParams::kHoldback; | 65 flags |= DataReductionProxyParams::kHoldback; |
| 67 #if defined(OS_ANDROID) | 66 #if defined(OS_ANDROID) |
| 68 if (data_reduction_proxy::params::IsIncludedInAndroidOnePromoFieldTrial( | 67 if (data_reduction_proxy::params::IsIncludedInAndroidOnePromoFieldTrial( |
| 69 base::android::BuildInfo::GetInstance()->android_build_fp())) { | 68 base::android::BuildInfo::GetInstance()->android_build_fp())) { |
| 70 flags |= DataReductionProxyParams::kPromoAllowed; | 69 flags |= DataReductionProxyParams::kPromoAllowed; |
| 71 } | 70 } |
| 72 #endif | 71 #endif |
| (...skipping 13 matching lines...) Expand all Loading... |
| 86 data_reduction_proxy_io_data->set_resource_type_provider( | 85 data_reduction_proxy_io_data->set_resource_type_provider( |
| 87 base::MakeUnique<data_reduction_proxy::ContentResourceTypeProvider>()); | 86 base::MakeUnique<data_reduction_proxy::ContentResourceTypeProvider>()); |
| 88 data_reduction_proxy_io_data->set_lofi_ui_service( | 87 data_reduction_proxy_io_data->set_lofi_ui_service( |
| 89 base::MakeUnique<data_reduction_proxy::ContentLoFiUIService>( | 88 base::MakeUnique<data_reduction_proxy::ContentLoFiUIService>( |
| 90 ui_task_runner, base::Bind(&OnLoFiResponseReceivedOnUI))); | 89 ui_task_runner, base::Bind(&OnLoFiResponseReceivedOnUI))); |
| 91 data_reduction_proxy_io_data->set_data_usage_source_provider( | 90 data_reduction_proxy_io_data->set_data_usage_source_provider( |
| 92 base::MakeUnique<ChromeDataUseGroupProvider>()); | 91 base::MakeUnique<ChromeDataUseGroupProvider>()); |
| 93 | 92 |
| 94 return data_reduction_proxy_io_data; | 93 return data_reduction_proxy_io_data; |
| 95 } | 94 } |
| OLD | NEW |