| Index: chrome/browser/page_load_metrics/page_load_metrics_util.cc
|
| diff --git a/chrome/browser/page_load_metrics/page_load_metrics_util.cc b/chrome/browser/page_load_metrics/page_load_metrics_util.cc
|
| index 22ec5505e23665708b80541e24c2f059047659b0..ab1acc1ded52fdcc6c75c52bf01f18452cb6c8a8 100644
|
| --- a/chrome/browser/page_load_metrics/page_load_metrics_util.cc
|
| +++ b/chrome/browser/page_load_metrics/page_load_metrics_util.cc
|
| @@ -7,8 +7,6 @@
|
| #include <algorithm>
|
|
|
| #include "chrome/common/page_load_metrics/page_load_timing.h"
|
| -#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
|
| -#include "url/gurl.h"
|
|
|
| namespace page_load_metrics {
|
|
|
| @@ -45,45 +43,6 @@ PageAbortReason GetAbortReasonForEndReason(PageEndReason end_reason) {
|
|
|
| } // namespace
|
|
|
| -base::Optional<std::string> GetGoogleHostnamePrefix(const GURL& url) {
|
| - const size_t registry_length =
|
| - net::registry_controlled_domains::GetRegistryLength(
|
| - url,
|
| -
|
| - // Do not include unknown registries (registries that don't have any
|
| - // matches in effective TLD names).
|
| - net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
|
| -
|
| - // Do not include private registries, such as appspot.com. We don't
|
| - // want to match URLs like www.google.appspot.com.
|
| - net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
|
| -
|
| - const base::StringPiece hostname = url.host_piece();
|
| - if (registry_length == 0 || registry_length == std::string::npos ||
|
| - registry_length >= hostname.length()) {
|
| - return base::Optional<std::string>();
|
| - }
|
| -
|
| - // Removes the tld and the preceding dot.
|
| - const base::StringPiece hostname_minus_registry =
|
| - hostname.substr(0, hostname.length() - (registry_length + 1));
|
| -
|
| - if (hostname_minus_registry == "google")
|
| - return std::string("");
|
| -
|
| - if (!base::EndsWith(hostname_minus_registry, ".google",
|
| - base::CompareCase::INSENSITIVE_ASCII)) {
|
| - return base::Optional<std::string>();
|
| - }
|
| -
|
| - return std::string(hostname_minus_registry.substr(
|
| - 0, hostname_minus_registry.length() - strlen(".google")));
|
| -}
|
| -
|
| -bool IsGoogleHostname(const GURL& url) {
|
| - return GetGoogleHostnamePrefix(url).has_value();
|
| -}
|
| -
|
| bool WasStartedInForegroundOptionalEventInForeground(
|
| const base::Optional<base::TimeDelta>& event,
|
| const PageLoadExtraInfo& info) {
|
| @@ -132,18 +91,6 @@ base::Optional<base::TimeDelta> GetInitialForegroundDuration(
|
| return time_on_page;
|
| }
|
|
|
| -base::Optional<base::TimeDelta> OptionalMin(
|
| - const base::Optional<base::TimeDelta>& a,
|
| - const base::Optional<base::TimeDelta>& b) {
|
| - if (a && !b)
|
| - return a;
|
| - if (b && !a)
|
| - return b;
|
| - if (!a && !b)
|
| - return a; // doesn't matter which
|
| - return base::Optional<base::TimeDelta>(std::min(a.value(), b.value()));
|
| -}
|
| -
|
| bool DidObserveLoadingBehaviorInAnyFrame(
|
| const page_load_metrics::PageLoadExtraInfo& info,
|
| blink::WebLoadingBehaviorFlag behavior) {
|
|
|