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

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

Issue 2780003003: Send an event to the page load metrics to track resource starting. (Closed)
Patch Set: Fix browser tests Created 3 years, 8 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_observer.h
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_observer.h b/chrome/browser/page_load_metrics/page_load_metrics_observer.h
index 11a98896bd91bf72d28f0f68b05251f2ef5229f3..347cbc767f175eeeb37a069a41b0f13250b4dd07 100644
--- a/chrome/browser/page_load_metrics/page_load_metrics_observer.h
+++ b/chrome/browser/page_load_metrics/page_load_metrics_observer.h
@@ -196,15 +196,16 @@ struct PageLoadExtraInfo {
};
// Container for various information about a request within a page load.
-struct ExtraRequestInfo {
- ExtraRequestInfo(bool was_cached,
- int64_t raw_body_bytes,
- bool data_reduction_proxy_used,
- int64_t original_network_content_length);
+struct ExtraRequestCompleteInfo {
+ ExtraRequestCompleteInfo(bool was_cached,
+ int64_t raw_body_bytes,
+ bool data_reduction_proxy_used,
+ int64_t original_network_content_length,
+ content::ResourceType found_type);
- ExtraRequestInfo(const ExtraRequestInfo& other);
+ ExtraRequestCompleteInfo(const ExtraRequestCompleteInfo& other);
- ~ExtraRequestInfo();
+ ~ExtraRequestCompleteInfo();
// True if the resource was loaded from cache.
const bool was_cached;
@@ -218,6 +219,23 @@ struct ExtraRequestInfo {
// The number of body (not header) bytes that the data reduction proxy saw
// before it compressed the requests.
const int64_t original_network_content_length;
+
+ // The type of the request as gleaned from the
+ // ChromeResourceDispatcherHostDelegate.
RyanSturm 2017/04/14 20:08:43 I'd adjust this comment to say "from ResourceReque
Pete Williamson 2017/04/17 18:53:11 Done in both places.
+ const content::ResourceType resource_type;
+};
+
+// Container for various information about a request within a page load.
+struct ExtraRequestStartInfo {
+ explicit ExtraRequestStartInfo(content::ResourceType type);
+
+ ExtraRequestStartInfo(const ExtraRequestStartInfo& other);
+
+ ~ExtraRequestStartInfo();
+
+ // The type of the request as gleaned from the
+ // ChromeResourceDispatcherHostDelegate.
+ const content::ResourceType resource_type;
};
// Interface for PageLoadMetrics observers. All instances of this class are
@@ -375,8 +393,13 @@ class PageLoadMetricsObserver {
const FailedProvisionalLoadInfo& failed_provisional_load_info,
const PageLoadExtraInfo& extra_info) {}
+ // Called whenever a request load begins.
+ virtual void OnStartedResource(
+ const ExtraRequestStartInfo& extra_request_start_info) {}
+
// Called whenever a request is loaded for this page load.
- virtual void OnLoadedResource(const ExtraRequestInfo& extra_request_info) {}
+ virtual void OnLoadedResource(
+ const ExtraRequestCompleteInfo& extra_request_complete_info) {}
};
} // namespace page_load_metrics

Powered by Google App Engine
This is Rietveld 408576698