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

Unified Diff: chrome/browser/page_load_metrics/page_load_metrics_util.h

Issue 2880323003: Various cleaups for AMP page load metrics. (Closed)
Patch Set: improve tests Created 3 years, 7 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
Index: chrome/browser/page_load_metrics/page_load_metrics_util.h
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_util.h b/chrome/browser/page_load_metrics/page_load_metrics_util.h
index a0af192a8b21db5b51127f0313538d4dab7576b6..fc56e84abf23fd8e15f932ee9e8d295ccdd18fd1 100644
--- a/chrome/browser/page_load_metrics/page_load_metrics_util.h
+++ b/chrome/browser/page_load_metrics/page_load_metrics_util.h
@@ -131,6 +131,21 @@ bool DidObserveLoadingBehaviorInAnyFrame(
const page_load_metrics::PageLoadExtraInfo& info,
blink::WebLoadingBehaviorFlag behavior);
+// Whether the given url has a google hostname.
+bool IsGoogleHostname(const GURL& url);
+
+// Returns whether the given url has google hostname. If true, emits the portion
+// of the hostname before the google hostname in |out_google_hostname_prefix|.
+//
+// For example:
+// https://google.com/foo => true, out_google_hostname_prefix = ''
+// https://www.google.com/foo => true, out_google_hostname_prefix = 'www'
+// https://news.google.com/foo => true, out_google_hostname_prefix = 'news'
+// https://a.b.c.google.com/foo => true, out_google_hostname_prefix = 'a.b.c'
+bool IsGoogleHostnameAndGetPrefix(
+ const GURL& url,
+ base::StringPiece* out_google_hostname_prefix);
+
} // namespace page_load_metrics
#endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698