Chromium Code Reviews| 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..582b2aaf1caef84235bd41f88ed8cfba5dc96681 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,8 @@ 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. |
| + // TODO(jkarlin): Set the id for all requests from frames. |
|
jam
2017/04/17 15:41:55
nit: remove this TODO. you can file a bug to discu
jkarlin
2017/04/24 17:27:59
Done.
|
| virtual int GetFrameTreeNodeId() const = 0; |
| // The IPC route identifier of the RenderFrame. |