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

Side by Side Diff: chrome/browser/prerender/prerender_util.cc

Issue 23064011: Consolidate scheme checks into an easy GURL method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/prerender/prerender_util.h" 5 #include "chrome/browser/prerender/prerender_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/sparse_histogram.h" 8 #include "base/metrics/sparse_histogram.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "content/public/browser/resource_request_info.h" 10 #include "content/public/browser/resource_request_info.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 bool IsGoogleSearchResultURL(const GURL& url) { 73 bool IsGoogleSearchResultURL(const GURL& url) {
74 if (!IsGoogleDomain(url)) 74 if (!IsGoogleDomain(url))
75 return false; 75 return false;
76 return (url.path().empty() || 76 return (url.path().empty() ||
77 StartsWithASCII(url.path(), std::string("/search"), true) || 77 StartsWithASCII(url.path(), std::string("/search"), true) ||
78 (url.path() == "/") || 78 (url.path() == "/") ||
79 StartsWithASCII(url.path(), std::string("/webhp"), true)); 79 StartsWithASCII(url.path(), std::string("/webhp"), true));
80 } 80 }
81 81
82 bool IsWebURL(const GURL& url) { 82 bool IsWebURL(const GURL& url) {
83 return url.SchemeIs("http") || url.SchemeIs("https"); 83 return url.SchemeIsHttp();
84 } 84 }
abarth-chromium 2013/08/19 18:11:49 Shoudl we just inline this function into its calle
Cris Neckar 2013/08/19 20:15:49 Done.
85 85
86 bool IsNoSwapInExperiment(uint8 experiment_id) { 86 bool IsNoSwapInExperiment(uint8 experiment_id) {
87 // Currently, experiments 5 and 6 fall in this category. 87 // Currently, experiments 5 and 6 fall in this category.
88 return experiment_id == 5 || experiment_id == 6; 88 return experiment_id == 5 || experiment_id == 6;
89 } 89 }
90 90
91 bool IsControlGroupExperiment(uint8 experiment_id) { 91 bool IsControlGroupExperiment(uint8 experiment_id) {
92 // Currently, experiments 7 and 8 fall in this category. 92 // Currently, experiments 7 and 8 fall in this category.
93 return experiment_id == 7 || experiment_id == 8; 93 return experiment_id == 7 || experiment_id == 8;
94 } 94 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 if (output < 2 || output >= 99) 127 if (output < 2 || output >= 99)
128 output = 99; 128 output = 99;
129 UMA_HISTOGRAM_SPARSE_SLOWLY(kModPagespeedHistogram, output); 129 UMA_HISTOGRAM_SPARSE_SLOWLY(kModPagespeedHistogram, output);
130 } 130 }
131 } 131 }
132 } 132 }
133 } 133 }
134 } 134 }
135 135
136 } // namespace prerender 136 } // namespace prerender
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698