Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_params.cc

Issue 347803003: Removed requirement that data reduction proxy key be non-empty (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/data_reduction_proxy/browser/data_reduction_proxy_params_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | components/data_reduction_proxy/browser/data_reduction_proxy_params_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698