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

Unified Diff: content/browser/loader/resource_request_info_impl.h

Issue 1459473003: Add a WebContents getter callback in ResourceRequestInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + addressed David's comments Created 5 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: content/browser/loader/resource_request_info_impl.h
diff --git a/content/browser/loader/resource_request_info_impl.h b/content/browser/loader/resource_request_info_impl.h
index 40a597a3fd50a7bcf50c1b13288e0b39ff35c0ce..5855f4fc921cbc6311ed1cf5fe2864191f6c91ff 100644
--- a/content/browser/loader/resource_request_info_impl.h
+++ b/content/browser/loader/resource_request_info_impl.h
@@ -23,6 +23,7 @@ class CrossSiteResourceHandler;
class DetachableResourceHandler;
class ResourceContext;
class ResourceMessageFilter;
+class WebContents;
struct GlobalRequestID;
struct GlobalRoutingID;
@@ -93,6 +94,13 @@ class ResourceRequestInfoImpl : public ResourceRequestInfo,
bool IsUsingLoFi() const override;
bool ShouldReportRawHeaders() const;
+ // Returns a callback that returns a pointer to the WebContents this request
+ // is associated with, or nullptr if it does not exist. The callback should
nasko 2015/11/23 17:00:24 nit: The request itself can be from a context that
clamy 2015/11/23 17:56:53 Done.
+ // only run on the UI thread.
+ // Note: not all resource requests will be owned by a WebContents. For
nasko 2015/11/23 17:00:24 nit: Capitalize Not.
clamy 2015/11/23 17:56:53 Done.
+ // example, requests made by a ServiceWorker.
+ base::Callback<WebContents*(void)> GetWebContentsForRequest() const;
+
CONTENT_EXPORT void AssociateWithRequest(net::URLRequest* request);
CONTENT_EXPORT GlobalRequestID GetGlobalRequestID() const;

Powered by Google App Engine
This is Rietveld 408576698