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

Unified Diff: chrome/browser/prerender/prerender_local_predictor.cc

Issue 11412288: Add new stats to local predictor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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_local_predictor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prerender/prerender_local_predictor.cc
===================================================================
--- chrome/browser/prerender/prerender_local_predictor.cc (revision 170571)
+++ chrome/browser/prerender/prerender_local_predictor.cc (working copy)
@@ -144,9 +144,20 @@
return haystack.find(needle) != std::string::npos;
}
+bool IsExtendedRootURL(const GURL& url) {
+ const std::string& path = url.path();
+ return path == "/index.html" || path == "/home.html" ||
Shishir 2012/12/01 01:33:23 Maybe add this to a static set and lookup.
+ path == "/main.html" ||
+ path == "/index.htm" || path == "/home.htm" || path == "/main.htm" ||
+ path == "/index.php" || path == "/home.php" || path == "/main.php" ||
+ path == "/index.asp" || path == "/home.asp" || path == "/main.asp" ||
+ path == "/index.py" || path == "/home.py" || path == "/main.py" ||
+ path == "/index.pl" || path == "/home.pl" || path == "/main.pl";
+}
+
bool IsRootPageURL(const GURL& url) {
- return (url.path() == "/" || url.path() == "") && (!url.has_query()) &&
- (!url.has_ref());
+ return (url.path() == "/" || url.path() == "" || IsExtendedRootURL(url)) &&
+ (!url.has_query()) && (!url.has_ref());
}
int64 URLHashToInt64(const unsigned char* data) {
@@ -384,6 +395,10 @@
}
if (IsRootPageURL(url))
RecordEvent(EVENT_PRERENDER_URL_LOOKUP_RESULT_ROOT_PAGE);
+ if (IsExtendedRootURL(url))
+ RecordEvent(EVENT_PRERENDER_URL_LOOKUP_RESULT_EXTENDED_ROOT_PAGE);
+ if (IsRootPageURL(url) && url.SchemeIs("http"))
+ RecordEvent(EVENT_PRERENDER_URL_LOOKUP_RESULT_ROOT_PAGE_HTTP);
if (url.SchemeIs("http"))
RecordEvent(EVENT_PRERENDER_URL_LOOKUP_RESULT_IS_HTTP);
if (url.has_query())
« no previous file with comments | « chrome/browser/prerender/prerender_local_predictor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698