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

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

Issue 382313003: Add data reduction functionality to all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch to run tests overnight. Created 6 years, 5 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
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/proxy/proxy_info.h" 10 #include "net/proxy/proxy_info.h"
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 request->context()->proxy_service()->config().proxy_rules().Apply( 309 request->context()->proxy_service()->config().proxy_rules().Apply(
310 request->url(), &result); 310 request->url(), &result);
311 if (!result.proxy_server().is_valid()) 311 if (!result.proxy_server().is_valid())
312 return false; 312 return false;
313 if (result.proxy_server().is_direct()) 313 if (result.proxy_server().is_direct())
314 return false; 314 return false;
315 return IsDataReductionProxy(result.proxy_server().host_port_pair(), NULL); 315 return IsDataReductionProxy(result.proxy_server().host_port_pair(), NULL);
316 } 316 }
317 317
318 std::string DataReductionProxyParams::GetDefaultDevOrigin() const { 318 std::string DataReductionProxyParams::GetDefaultDevOrigin() const {
319 #if defined(DATA_REDUCTION_DEV_HOST)
320 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 319 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
321 if (command_line.HasSwitch(switches::kDisableDataReductionProxyDev)) 320 if (command_line.HasSwitch(switches::kDisableDataReductionProxyDev))
322 return std::string(); 321 return std::string();
323 if (command_line.HasSwitch(switches::kEnableDataReductionProxyDev) || 322 if (command_line.HasSwitch(switches::kEnableDataReductionProxyDev) ||
324 (FieldTrialList::FindFullName("DataCompressionProxyDevRollout") == 323 (FieldTrialList::FindFullName("DataCompressionProxyDevRollout") ==
325 kEnabled)) { 324 kEnabled)) {
326 return DATA_REDUCTION_DEV_HOST; 325 return "http://proxy-dev.googlezip.net:80/";
bengr 2014/07/15 16:38:17 Add a TODO that this class and its tests should be
Not at Google. Contact bengr 2014/07/16 22:41:34 Added todo and an entry in sheet.
327 } 326 }
328 #endif
329 return std::string(); 327 return std::string();
330 } 328 }
331 329
332 std::string DataReductionProxyParams::GetDefaultOrigin() const { 330 std::string DataReductionProxyParams::GetDefaultOrigin() const {
333 #if defined(SPDY_PROXY_AUTH_ORIGIN) 331 return "https://proxy.googlezip.net:443/";
334 return SPDY_PROXY_AUTH_ORIGIN;
335 #endif
336 return std::string();
337 } 332 }
338 333
339 std::string DataReductionProxyParams::GetDefaultFallbackOrigin() const { 334 std::string DataReductionProxyParams::GetDefaultFallbackOrigin() const {
340 #if defined(DATA_REDUCTION_FALLBACK_HOST) 335 return "http://compress.googlezip.net:80/";
341 return DATA_REDUCTION_FALLBACK_HOST;
342 #endif
343 return std::string();
344 } 336 }
345 337
346 std::string DataReductionProxyParams::GetDefaultSSLOrigin() const { 338 std::string DataReductionProxyParams::GetDefaultSSLOrigin() const {
347 #if defined(DATA_REDUCTION_PROXY_SSL_ORIGIN) 339 return "http://ssl.googlezip.net:1043/";
348 return DATA_REDUCTION_PROXY_SSL_ORIGIN;
349 #endif
350 return std::string();
351 } 340 }
352 341
353 std::string DataReductionProxyParams::GetDefaultAltOrigin() const { 342 std::string DataReductionProxyParams::GetDefaultAltOrigin() const {
354 #if defined(DATA_REDUCTION_PROXY_ALT_ORIGIN) 343 return "https://proxy.googlezip.net:443/";
355 return DATA_REDUCTION_PROXY_ALT_ORIGIN;
356 #endif
357 return std::string();
358 } 344 }
359 345
360 std::string DataReductionProxyParams::GetDefaultAltFallbackOrigin() const { 346 std::string DataReductionProxyParams::GetDefaultAltFallbackOrigin() const {
361 #if defined(DATA_REDUCTION_PROXY_ALT_FALLBACK_ORIGIN) 347 return "http://compress.googlezip.net:80/";
362 return DATA_REDUCTION_PROXY_ALT_FALLBACK_ORIGIN;
363 #endif
364 return std::string();
365 } 348 }
366 349
367 std::string DataReductionProxyParams::GetDefaultProbeURL() const { 350 std::string DataReductionProxyParams::GetDefaultProbeURL() const {
368 #if defined(DATA_REDUCTION_PROXY_PROBE_URL) 351 return "http://check.googlezip.net/connect";
369 return DATA_REDUCTION_PROXY_PROBE_URL;
370 #endif
371 return std::string();
372 } 352 }
373 353
374 std::string DataReductionProxyParams::GetDefaultWarmupURL() const { 354 std::string DataReductionProxyParams::GetDefaultWarmupURL() const {
375 #if defined(DATA_REDUCTION_PROXY_WARMUP_URL) 355 return "http://www.gstatic.com/generate_204";
376 return DATA_REDUCTION_PROXY_WARMUP_URL;
377 #endif
378 return std::string();
379 } 356 }
380 357
381 } // namespace data_reduction_proxy 358 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698