#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/page_load_metrics/observers/local_network_requests_page_load_metrics_observer.h"
#include "base/lazy_instance.h"
#include "base/metrics/histogram_macros.h"
#include "chrome/browser/browser_process.h"
#include "components/page_load_metrics/browser/page_load_metrics_util.h"
#include "content/public/browser/navigation_handle.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/base/url_util.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "url/gurl.h"
namespace {
bool IsLikelyRouterIP(net::IPAddress ip_address) { … }
bool GetIPAndPort(
const page_load_metrics::ExtraRequestCompleteInfo& extra_request_info,
net::IPAddress* resource_ip,
int* resource_port) { … }
const std::map<uint16_t, internal::PortType>& GetLocalhostPortCategories() { … }
}
LocalNetworkRequestsPageLoadMetricsObserver::
LocalNetworkRequestsPageLoadMetricsObserver() { … }
LocalNetworkRequestsPageLoadMetricsObserver::
~LocalNetworkRequestsPageLoadMetricsObserver() { … }
const char* LocalNetworkRequestsPageLoadMetricsObserver::GetObserverName()
const { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
LocalNetworkRequestsPageLoadMetricsObserver::OnFencedFramesStart(
content::NavigationHandle* navigation_handle,
const GURL& currently_committed_url) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
LocalNetworkRequestsPageLoadMetricsObserver::OnPrerenderStart(
content::NavigationHandle* navigation_handle,
const GURL& currently_committed_url) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
LocalNetworkRequestsPageLoadMetricsObserver::OnCommit(
content::NavigationHandle* navigation_handle) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
LocalNetworkRequestsPageLoadMetricsObserver::FlushMetricsOnAppEnterBackground(
const page_load_metrics::mojom::PageLoadTiming& timing) { … }
void LocalNetworkRequestsPageLoadMetricsObserver::OnLoadedResource(
const page_load_metrics::ExtraRequestCompleteInfo& extra_request_info) { … }
void LocalNetworkRequestsPageLoadMetricsObserver::OnComplete(
const page_load_metrics::mojom::PageLoadTiming& timing) { … }
void LocalNetworkRequestsPageLoadMetricsObserver::ClearLocalState() { … }
internal::ResourceType
LocalNetworkRequestsPageLoadMetricsObserver::DetermineResourceType(
net::IPAddress resource_ip) { … }
internal::PortType
LocalNetworkRequestsPageLoadMetricsObserver::DeterminePortType(int port) { … }
void LocalNetworkRequestsPageLoadMetricsObserver::ResolveResourceTypes() { … }
void LocalNetworkRequestsPageLoadMetricsObserver::RecordUkmMetrics(
ukm::SourceId source_id) { … }
void LocalNetworkRequestsPageLoadMetricsObserver::RecordUkmDomainType(
ukm::SourceId source_id) { … }