Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | |
|
davidben
2015/11/19 17:46:13
callback_forward.h
clamy
2015/11/20 13:50:43
Done.
| |
| 9 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/public/browser/web_contents.h" | |
| 10 #include "content/public/common/resource_type.h" | 12 #include "content/public/common/resource_type.h" |
| 11 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" | 13 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" |
| 12 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" | 14 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" |
| 13 #include "ui/base/page_transition_types.h" | 15 #include "ui/base/page_transition_types.h" |
| 14 | 16 |
| 15 namespace net { | 17 namespace net { |
| 16 class URLRequest; | 18 class URLRequest; |
| 17 } | 19 } |
| 18 | 20 |
| 19 namespace content { | 21 namespace content { |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 44 | 46 |
| 45 // Returns the associated RenderFrame for a given process. Returns false, if | 47 // Returns the associated RenderFrame for a given process. Returns false, if |
| 46 // there is no associated RenderFrame. This method does not rely on the | 48 // there is no associated RenderFrame. This method does not rely on the |
| 47 // request being allocated by the ResourceDispatcherHost, but works for all | 49 // request being allocated by the ResourceDispatcherHost, but works for all |
| 48 // URLRequests that are associated with a RenderFrame. | 50 // URLRequests that are associated with a RenderFrame. |
| 49 CONTENT_EXPORT static bool GetRenderFrameForRequest( | 51 CONTENT_EXPORT static bool GetRenderFrameForRequest( |
| 50 const net::URLRequest* request, | 52 const net::URLRequest* request, |
| 51 int* render_process_id, | 53 int* render_process_id, |
| 52 int* render_frame_id); | 54 int* render_frame_id); |
| 53 | 55 |
| 56 // Returns a callback that returns a pointer to the WebContents this request | |
| 57 // is asscoaited with, or nullptr if it does not exit. The callback should | |
|
davidben
2015/11/19 17:46:13
asscoaited -> associated
exit -> exist
Probably a
clamy
2015/11/20 13:50:43
Done.
| |
| 58 // only run on the UI thread. | |
| 59 using WebContentsGetterOnUI = base::Callback<WebContents*(void)>; | |
|
davidben
2015/11/19 17:46:13
base::Callback<WebContents*(void)> isn't much long
clamy
2015/11/20 13:50:43
Done.
| |
| 60 virtual WebContentsGetterOnUI GetWebContentsForRequest() = 0; | |
| 61 | |
| 54 // Returns the associated ResourceContext. | 62 // Returns the associated ResourceContext. |
| 55 virtual ResourceContext* GetContext() const = 0; | 63 virtual ResourceContext* GetContext() const = 0; |
| 56 | 64 |
| 57 // The child process unique ID of the requestor. | 65 // The child process unique ID of the requestor. |
|
davidben
2015/11/19 17:46:13
// Use GetWebContentsForRequest() instead.
(Or is
clamy
2015/11/20 13:50:43
Done.
| |
| 58 virtual int GetChildID() const = 0; | 66 virtual int GetChildID() const = 0; |
| 59 | 67 |
| 60 // The IPC route identifier for this request (this identifies the RenderView | 68 // The IPC route identifier for this request (this identifies the RenderView |
| 61 // or like-thing in the renderer that the request gets routed to). | 69 // or like-thing in the renderer that the request gets routed to). |
|
davidben
2015/11/19 17:46:13
// Use GetWebContentsForRequest() instead.
(Or is
clamy
2015/11/20 13:50:43
Done. I don't think it's too early, most people ar
| |
| 62 virtual int GetRouteID() const = 0; | 70 virtual int GetRouteID() const = 0; |
| 63 | 71 |
| 64 // The pid of the originating process, if the request is sent on behalf of a | 72 // The pid of the originating process, if the request is sent on behalf of a |
| 65 // another process. Otherwise it is 0. | 73 // another process. Otherwise it is 0. |
| 66 virtual int GetOriginPID() const = 0; | 74 virtual int GetOriginPID() const = 0; |
| 67 | 75 |
| 68 // Unique identifier (within the scope of the child process) for this request. | 76 // Unique identifier (within the scope of the child process) for this request. |
| 69 virtual int GetRequestID() const = 0; | 77 virtual int GetRequestID() const = 0; |
| 70 | 78 |
| 71 // The IPC route identifier of the RenderFrame. | 79 // The IPC route identifier of the RenderFrame. |
| 72 // TODO(jam): once all navigation and resource requests are sent between | 80 // TODO(jam): once all navigation and resource requests are sent between |
| 73 // frames and RenderView/RenderViewHost aren't involved we can remove this and | 81 // frames and RenderView/RenderViewHost aren't involved we can remove this and |
| 74 // just use GetRouteID above. | 82 // just use GetRouteID above. |
|
davidben
2015/11/19 17:46:13
// Use GetWebContentsForRequest() instead.
(Or is
clamy
2015/11/20 13:50:43
Done.
| |
| 75 virtual int GetRenderFrameID() const = 0; | 83 virtual int GetRenderFrameID() const = 0; |
| 76 | 84 |
| 77 // True if GetRenderFrameID() represents a main frame in the RenderView. | 85 // True if GetRenderFrameID() represents a main frame in the RenderView. |
| 78 virtual bool IsMainFrame() const = 0; | 86 virtual bool IsMainFrame() const = 0; |
| 79 | 87 |
| 80 // True if GetParentRenderFrameID() represents a main frame in the RenderView. | 88 // True if GetParentRenderFrameID() represents a main frame in the RenderView. |
| 81 virtual bool ParentIsMainFrame() const = 0; | 89 virtual bool ParentIsMainFrame() const = 0; |
| 82 | 90 |
| 83 // Routing ID of parent frame of frame that sent this resource request. | 91 // Routing ID of parent frame of frame that sent this resource request. |
| 84 // -1 if unknown / invalid. | 92 // -1 if unknown / invalid. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 // Whether this request if using Lo-Fi mode. | 136 // Whether this request if using Lo-Fi mode. |
| 129 virtual bool IsUsingLoFi() const = 0; | 137 virtual bool IsUsingLoFi() const = 0; |
| 130 | 138 |
| 131 protected: | 139 protected: |
| 132 virtual ~ResourceRequestInfo() {} | 140 virtual ~ResourceRequestInfo() {} |
| 133 }; | 141 }; |
| 134 | 142 |
| 135 } // namespace content | 143 } // namespace content |
| 136 | 144 |
| 137 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ | 145 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_REQUEST_INFO_H_ |
| OLD | NEW |