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

Unified Diff: chrome/browser/page_load_metrics/observers/protocol_page_load_metrics_observer.cc

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 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
Index: chrome/browser/page_load_metrics/observers/protocol_page_load_metrics_observer.cc
diff --git a/chrome/browser/page_load_metrics/observers/protocol_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/protocol_page_load_metrics_observer.cc
index 274a5638340ee77bfd3c1f9b3c3fb11563c9d1bf..33c281fe753744f0a86bc67e88e5a1030c3af02c 100644
--- a/chrome/browser/page_load_metrics/observers/protocol_page_load_metrics_observer.cc
+++ b/chrome/browser/page_load_metrics/observers/protocol_page_load_metrics_observer.cc
@@ -7,12 +7,58 @@
#include "chrome/browser/page_load_metrics/page_load_metrics_util.h"
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
+ProtocolPageLoadMetricsObserver::OnStart(
+ content::NavigationHandle* navigation_handle,
+ const GURL& currently_committed_url,
+ bool started_in_foreground) {
+ return started_in_foreground ? CONTINUE_OBSERVING : STOP_OBSERVING;
+}
+
+page_load_metrics::PageLoadMetricsObserver::ObservePolicy
ProtocolPageLoadMetricsObserver::OnCommit(
content::NavigationHandle* navigation_handle) {
connection_info_ = navigation_handle->GetConnectionInfo();
return CONTINUE_OBSERVING;
}
+page_load_metrics::PageLoadMetricsObserver::ObservePolicy
+ProtocolPageLoadMetricsObserver::OnHidden(
+ const page_load_metrics::PageLoadTiming& timing,
+ const page_load_metrics::PageLoadExtraInfo& info) {
+ return STOP_OBSERVING;
+}
+
+void ProtocolPageLoadMetricsObserver::OnParseStart(
+ const page_load_metrics::PageLoadTiming& timing,
+ const page_load_metrics::PageLoadExtraInfo& info) {
+ switch (connection_info_) {
+ case net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN:
+ case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_SPDY2:
+ case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_SPDY3:
+ case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_HTTP2_14:
+ case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_HTTP2_15:
+ case net::HttpResponseInfo::CONNECTION_INFO_HTTP0_9:
+ case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_0:
+ case net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS:
+ return;
+ case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1:
+ PAGE_LOAD_HISTOGRAM(
+ "PageLoad.Clients.Protocol.H11.ParseTiming.NavigationToParseStart",
+ timing.parse_start.value());
+ break;
+ case net::HttpResponseInfo::CONNECTION_INFO_HTTP2:
+ PAGE_LOAD_HISTOGRAM(
+ "PageLoad.Clients.Protocol.H2.ParseTiming.NavigationToParseStart",
+ timing.parse_start.value());
+ break;
+ case net::HttpResponseInfo::CONNECTION_INFO_QUIC:
+ PAGE_LOAD_HISTOGRAM(
+ "PageLoad.Clients.Protocol.QUIC.ParseTiming.NavigationToParseStart",
+ timing.parse_start.value());
+ break;
+ }
+}
+
void ProtocolPageLoadMetricsObserver::OnFirstContentfulPaint(
const page_load_metrics::PageLoadTiming& timing,
const page_load_metrics::PageLoadExtraInfo& extra_info) {
@@ -28,7 +74,7 @@ void ProtocolPageLoadMetricsObserver::OnFirstContentfulPaint(
return;
case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1:
PAGE_LOAD_HISTOGRAM(
- "PageLoad.Clients.Protocol.H1.PaintTiming."
+ "PageLoad.Clients.Protocol.H11.PaintTiming."
"ParseStartToFirstContentfulPaint",
timing.first_contentful_paint.value() - timing.parse_start.value());
break;
@@ -62,7 +108,7 @@ void ProtocolPageLoadMetricsObserver::OnFirstMeaningfulPaint(
return;
case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1:
PAGE_LOAD_HISTOGRAM(
- "PageLoad.Clients.Protocol.H1.Experimental.PaintTiming."
+ "PageLoad.Clients.Protocol.H11.Experimental.PaintTiming."
"ParseStartToFirstMeaningfulPaint",
timing.first_meaningful_paint.value() - timing.parse_start.value());
break;
@@ -96,7 +142,7 @@ void ProtocolPageLoadMetricsObserver::OnDomContentLoadedEventStart(
return;
case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1:
PAGE_LOAD_HISTOGRAM(
- "PageLoad.Clients.Protocol.H1.DocumentTiming."
+ "PageLoad.Clients.Protocol.H11.DocumentTiming."
"NavigationToDOMContentLoadedEventFired",
timing.dom_content_loaded_event_start.value());
break;
@@ -130,7 +176,7 @@ void ProtocolPageLoadMetricsObserver::OnLoadEventStart(
return;
case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1:
PAGE_LOAD_HISTOGRAM(
- "PageLoad.Clients.Protocol.H1.DocumentTiming."
+ "PageLoad.Clients.Protocol.H11.DocumentTiming."
"NavigationToLoadEventFired",
timing.load_event_start.value());
break;

Powered by Google App Engine
This is Rietveld 408576698