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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prerender/prerender_util.h ('k') | chrome/common/extensions/manifest_url_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_util.cc
diff --git a/chrome/browser/prerender/prerender_util.cc b/chrome/browser/prerender/prerender_util.cc
index ca254183172eee47ceb320d2e513b14dda77c28e..1c4ab6ff59683aa5221c01e66ceda7f6a6873db6 100644
--- a/chrome/browser/prerender/prerender_util.cc
+++ b/chrome/browser/prerender/prerender_util.cc
@@ -79,10 +79,6 @@ bool IsGoogleSearchResultURL(const GURL& url) {
StartsWithASCII(url.path(), std::string("/webhp"), true));
}
-bool IsWebURL(const GURL& url) {
- return url.SchemeIs("http") || url.SchemeIs("https");
-}
-
bool IsNoSwapInExperiment(uint8 experiment_id) {
// Currently, experiments 5 and 6 fall in this category.
return experiment_id == 5 || experiment_id == 6;
@@ -100,7 +96,7 @@ void URLRequestResponseStarted(net::URLRequest* request) {
content::ResourceRequestInfo::ForRequest(request);
// Gather histogram information about the X-Mod-Pagespeed header.
if (info->GetResourceType() == ResourceType::MAIN_FRAME &&
- IsWebURL(request->url())) {
+ request->url().SchemeIsHTTPOrHTTPS()) {
UMA_HISTOGRAM_SPARSE_SLOWLY(kModPagespeedHistogram, 0);
if (request->response_headers() &&
request->response_headers()->HasHeader(kModPagespeedHeader)) {
« no previous file with comments | « chrome/browser/prerender/prerender_util.h ('k') | chrome/common/extensions/manifest_url_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698