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

Unified Diff: content/public/browser/resource_request_info.h

Issue 2798953002: [PageLoadMetrics] Keep track of Ad Sizes on Pages (Closed)
Patch Set: Rebase 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
« no previous file with comments | « content/browser/loader/resource_request_info_impl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/resource_request_info.h
diff --git a/content/public/browser/resource_request_info.h b/content/public/browser/resource_request_info.h
index 7f0d825d7f0060f4d70993db026c32f665f8a792..33830f8e1e2a935a9fe1934006529b4af4759b40 100644
--- a/content/public/browser/resource_request_info.h
+++ b/content/public/browser/resource_request_info.h
@@ -73,6 +73,11 @@ class ResourceRequestInfo {
// non-null.
using WebContentsGetter = base::Callback<WebContents*(void)>;
+ // A callback that returns a frame tree node id . The callback can always
+ // be used, but it may return -1 if no id is found. The callback should only
+ // run on the UI thread.
+ using FrameTreeNodeIdGetter = base::Callback<int(void)>;
+
// Returns a callback that returns a pointer to the WebContents this request
// is associated with, or nullptr if it no longer exists or the request is
// not associated with a WebContents. The callback should only run on the UI
@@ -81,6 +86,13 @@ class ResourceRequestInfo {
// example, requests made by a ServiceWorker.
virtual WebContentsGetter GetWebContentsGetterForRequest() const = 0;
+ // Returns a callback that returns an int with the frame tree node id
+ // associated with this request, or -1 if it no longer exists. This
+ // callback should only be run on the UI thread.
+ // Note: Not all resource requests will be associated with a frame. For
+ // example, requests made by a ServiceWorker.
+ virtual FrameTreeNodeIdGetter GetFrameTreeNodeIdGetterForRequest() const = 0;
+
// Returns the associated ResourceContext.
virtual ResourceContext* GetContext() const = 0;
@@ -103,6 +115,7 @@ class ResourceRequestInfo {
// Returns the FrameTreeNode ID for this frame. This ID is browser-global and
// uniquely identifies a frame that hosts content.
+ // Note: Returns -1 for all requests except PlzNavigate requests.
virtual int GetFrameTreeNodeId() const = 0;
// The IPC route identifier of the RenderFrame.
« no previous file with comments | « content/browser/loader/resource_request_info_impl.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698