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

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

Issue 2624283004: Associate a main resource request with its PageLoadTracker. (Closed)
Patch Set: comment cleanup Created 3 years, 11 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/metrics_web_contents_observer.h
diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h
index f8158ba85230ec3861a13484e368a1c1ed9dd324..3a9e0b97871f45faf37558c6ae6f665cdbc1d71b 100644
--- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h
+++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h
@@ -54,6 +54,8 @@ class MetricsWebContentsObserver
// content::WebContentsObserver implementation:
bool OnMessageReceived(const IPC::Message& message,
content::RenderFrameHost* render_frame_host) override;
+ void ReadyToCommitNavigation(
+ content::NavigationHandle* navigation_handle) override;
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override;
void DidRedirectNavigation(
@@ -69,8 +71,10 @@ class MetricsWebContentsObserver
// This method is forwarded from the MetricsNavigationThrottle.
void WillStartNavigationRequest(content::NavigationHandle* navigation_handle);
- // A resource request completed on the IO thread.
- void OnRequestComplete(content::ResourceType resource_type,
+ // A resource request completed on the IO thread. This method is invoked on
+ // the UI thread.
+ void OnRequestComplete(const content::GlobalRequestID& request_id,
Charlie Harrison 2017/01/13 15:56:23 #include "content/public/browser/global_request_id
+ content::ResourceType resource_type,
bool was_cached,
bool used_data_reduction_proxy,
int64_t raw_body_bytes,
@@ -97,6 +101,14 @@ class MetricsWebContentsObserver
content::NavigationHandle* navigation_handle,
std::unique_ptr<PageLoadTracker> tracker);
+ // Return a PageLoadTracker (either provisional or committed) that matches the
+ // given request attributes, or nullptr if there are no matching
+ // PageLoadTrackers.
+ PageLoadTracker* GetTrackerOrNullForRequest(
+ const content::GlobalRequestID& request_id,
+ content::ResourceType resource_type,
+ base::TimeTicks creation_time);
+
// Notify all loads, provisional and committed, that we performed an action
// that might abort them.
void NotifyAbortAllLoads(UserAbortType abort_type,

Powered by Google App Engine
This is Rietveld 408576698