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..1e6af5716c95d5d73e6b3f7ac37c3955a13d8c08 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); |
+ |
+// If the given hostname is a google hostname, returns the portion of the |
+// hostname before the google hostname. Otherwise, returns an unset optional |
+// value. |
+// |
+// For example: |
+// https://example.com/foo => returns an unset optional value |
+// https://google.com/foo => returns '' |
+// https://www.google.com/foo => returns 'www' |
+// https://news.google.com/foo => returns 'news' |
+// https://a.b.c.google.com/foo => returns 'a.b.c' |
+base::Optional<std::string> GetGoogleHostnamePrefix(const GURL& url); |
+ |
} // namespace page_load_metrics |
#endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_UTIL_H_ |