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_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
| 6 #define CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 6 #define CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/supports_user_data.h" | 15 #include "base/supports_user_data.h" |
| 16 #include "content/public/browser/resource_request_info.h" | 16 #include "content/public/browser/resource_request_info.h" |
| 17 #include "content/public/common/referrer.h" | 17 #include "content/public/common/referrer.h" |
| 18 #include "content/public/common/resource_type.h" | 18 #include "content/public/common/resource_type.h" |
| 19 #include "net/base/load_states.h" | 19 #include "net/base/load_states.h" |
| 20 | 20 |
| 21 namespace content { | 21 namespace content { |
| 22 class CrossSiteResourceHandler; | 22 class CrossSiteResourceHandler; |
| 23 class DetachableResourceHandler; | 23 class DetachableResourceHandler; |
| 24 class ResourceContext; | 24 class ResourceContext; |
| 25 class ResourceMessageFilter; | 25 class ResourceMessageFilter; |
| 26 class WebContents; | |
| 27 struct GlobalRequestID; | 26 struct GlobalRequestID; |
| 28 struct GlobalRoutingID; | 27 struct GlobalRoutingID; |
| 29 | 28 |
| 30 // Holds the data ResourceDispatcherHost associates with each request. | 29 // Holds the data ResourceDispatcherHost associates with each request. |
| 31 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. | 30 // Retrieve this data by calling ResourceDispatcherHost::InfoForRequest. |
| 32 class ResourceRequestInfoImpl : public ResourceRequestInfo, | 31 class ResourceRequestInfoImpl : public ResourceRequestInfo, |
| 33 public base::SupportsUserData::Data { | 32 public base::SupportsUserData::Data { |
| 34 public: | 33 public: |
| 35 // Returns the ResourceRequestInfoImpl associated with the given URLRequest. | 34 // Returns the ResourceRequestInfoImpl associated with the given URLRequest. |
| 36 CONTENT_EXPORT static ResourceRequestInfoImpl* ForRequest( | 35 CONTENT_EXPORT static ResourceRequestInfoImpl* ForRequest( |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 64 blink::WebReferrerPolicy referrer_policy, | 63 blink::WebReferrerPolicy referrer_policy, |
| 65 blink::WebPageVisibilityState visibility_state, | 64 blink::WebPageVisibilityState visibility_state, |
| 66 ResourceContext* context, | 65 ResourceContext* context, |
| 67 base::WeakPtr<ResourceMessageFilter> filter, | 66 base::WeakPtr<ResourceMessageFilter> filter, |
| 68 bool report_raw_headers, | 67 bool report_raw_headers, |
| 69 bool is_async, | 68 bool is_async, |
| 70 bool is_using_lofi); | 69 bool is_using_lofi); |
| 71 ~ResourceRequestInfoImpl() override; | 70 ~ResourceRequestInfoImpl() override; |
| 72 | 71 |
| 73 // ResourceRequestInfo implementation: | 72 // ResourceRequestInfo implementation: |
| 73 base::Callback<WebContents*(void)> GetWebContentsForRequest() const override; | |
|
asanka
2015/11/24 16:13:19
Nit: This method doesn't really return a WebConten
clamy
2015/11/25 14:02:02
Done.
| |
| 74 ResourceContext* GetContext() const override; | 74 ResourceContext* GetContext() const override; |
| 75 int GetChildID() const override; | 75 int GetChildID() const override; |
| 76 int GetRouteID() const override; | 76 int GetRouteID() const override; |
| 77 int GetOriginPID() const override; | 77 int GetOriginPID() const override; |
| 78 int GetRenderFrameID() const override; | 78 int GetRenderFrameID() const override; |
| 79 bool IsMainFrame() const override; | 79 bool IsMainFrame() const override; |
| 80 bool ParentIsMainFrame() const override; | 80 bool ParentIsMainFrame() const override; |
| 81 int GetParentRenderFrameID() const override; | 81 int GetParentRenderFrameID() const override; |
| 82 ResourceType GetResourceType() const override; | 82 ResourceType GetResourceType() const override; |
| 83 int GetProcessType() const override; | 83 int GetProcessType() const override; |
| 84 blink::WebReferrerPolicy GetReferrerPolicy() const override; | 84 blink::WebReferrerPolicy GetReferrerPolicy() const override; |
| 85 blink::WebPageVisibilityState GetVisibilityState() const override; | 85 blink::WebPageVisibilityState GetVisibilityState() const override; |
| 86 ui::PageTransition GetPageTransition() const override; | 86 ui::PageTransition GetPageTransition() const override; |
| 87 bool HasUserGesture() const override; | 87 bool HasUserGesture() const override; |
| 88 bool WasIgnoredByHandler() const override; | 88 bool WasIgnoredByHandler() const override; |
| 89 bool GetAssociatedRenderFrame(int* render_process_id, | 89 bool GetAssociatedRenderFrame(int* render_process_id, |
| 90 int* render_frame_id) const override; | 90 int* render_frame_id) const override; |
| 91 bool IsAsync() const override; | 91 bool IsAsync() const override; |
| 92 bool IsDownload() const override; | 92 bool IsDownload() const override; |
| 93 bool IsUsingLoFi() const override; | 93 bool IsUsingLoFi() const override; |
| 94 bool ShouldReportRawHeaders() const; | 94 bool ShouldReportRawHeaders() const; |
| 95 | 95 |
| 96 // Returns a callback that returns a pointer to the WebContents this request | |
| 97 // is associated with, or nullptr if it no longer exists or the request is | |
| 98 // not associated with a WebContents. The callback should only run on the UI | |
| 99 // thread. | |
| 100 // Note: Not all resource requests will be owned by a WebContents. For | |
| 101 // example, requests made by a ServiceWorker. | |
| 102 base::Callback<WebContents*(void)> GetWebContentsForRequest() const; | |
| 103 | |
| 104 CONTENT_EXPORT void AssociateWithRequest(net::URLRequest* request); | 96 CONTENT_EXPORT void AssociateWithRequest(net::URLRequest* request); |
| 105 | 97 |
| 106 CONTENT_EXPORT int GetRequestID() const; | 98 CONTENT_EXPORT int GetRequestID() const; |
| 107 CONTENT_EXPORT GlobalRequestID GetGlobalRequestID() const; | 99 CONTENT_EXPORT GlobalRequestID GetGlobalRequestID() const; |
| 108 GlobalRoutingID GetGlobalRoutingID() const; | 100 GlobalRoutingID GetGlobalRoutingID() const; |
| 109 | 101 |
| 110 // PlzNavigate | 102 // PlzNavigate |
| 111 // The id of the FrameTreeNode that initiated this request (for a navigation | 103 // The id of the FrameTreeNode that initiated this request (for a navigation |
| 112 // request). | 104 // request). |
| 113 int frame_tree_node_id() const { return frame_tree_node_id_; } | 105 int frame_tree_node_id() const { return frame_tree_node_id_; } |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 233 bool report_raw_headers_; | 225 bool report_raw_headers_; |
| 234 bool is_async_; | 226 bool is_async_; |
| 235 bool is_using_lofi_; | 227 bool is_using_lofi_; |
| 236 | 228 |
| 237 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); | 229 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); |
| 238 }; | 230 }; |
| 239 | 231 |
| 240 } // namespace content | 232 } // namespace content |
| 241 | 233 |
| 242 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 234 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
| OLD | NEW |