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 "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" | 5 #include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h
" | 9 #include "components/data_reduction_proxy/common/data_reduction_proxy_switches.h
" |
10 #include "net/url_request/url_request.h" | 10 #include "net/url_request/url_request.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 << alt_fallback_origin_.spec(); | 130 << alt_fallback_origin_.spec(); |
131 return false; | 131 return false; |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 if (allowed && !probe_url_.is_valid()) { | 135 if (allowed && !probe_url_.is_valid()) { |
136 DVLOG(1) << "Invalid probe url: <null>"; | 136 DVLOG(1) << "Invalid probe url: <null>"; |
137 return false; | 137 return false; |
138 } | 138 } |
139 | 139 |
140 if (allowed || alt_allowed) { | |
141 if (key_.empty()) { | |
142 DVLOG(1) << "Invalid key: <empty>"; | |
143 return false; | |
144 } | |
145 } | |
146 | |
147 if (fallback_allowed_ && !allowed_) { | 140 if (fallback_allowed_ && !allowed_) { |
148 DVLOG(1) << "The data reduction proxy fallback cannot be allowed if " | 141 DVLOG(1) << "The data reduction proxy fallback cannot be allowed if " |
149 << "the data reduction proxy is not allowed"; | 142 << "the data reduction proxy is not allowed"; |
150 return false; | 143 return false; |
151 } | 144 } |
152 if (promo_allowed_ && !allowed_) { | 145 if (promo_allowed_ && !allowed_) { |
153 DVLOG(1) << "The data reduction proxy promo cannot be allowed if the " | 146 DVLOG(1) << "The data reduction proxy promo cannot be allowed if the " |
154 << "data reduction proxy is not allowed"; | 147 << "data reduction proxy is not allowed"; |
155 return false; | 148 return false; |
156 } | 149 } |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 } | 329 } |
337 | 330 |
338 std::string DataReductionProxyParams::GetDefaultProbeURL() const { | 331 std::string DataReductionProxyParams::GetDefaultProbeURL() const { |
339 #if defined(DATA_REDUCTION_PROXY_PROBE_URL) | 332 #if defined(DATA_REDUCTION_PROXY_PROBE_URL) |
340 return DATA_REDUCTION_PROXY_PROBE_URL; | 333 return DATA_REDUCTION_PROXY_PROBE_URL; |
341 #endif | 334 #endif |
342 return std::string(); | 335 return std::string(); |
343 } | 336 } |
344 | 337 |
345 } // namespace data_reduction_proxy | 338 } // namespace data_reduction_proxy |
OLD | NEW |