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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/supports_user_data.h" | 16 #include "base/supports_user_data.h" |
17 #include "content/browser/loader/resource_requester_info.h" | 17 #include "content/browser/loader/resource_requester_info.h" |
18 #include "content/common/resource_request_body_impl.h" | 18 #include "content/common/resource_request_body_impl.h" |
19 #include "content/common/url_loader.mojom.h" | 19 #include "content/common/url_loader.mojom.h" |
20 #include "content/public/browser/navigation_ui_data.h" | 20 #include "content/public/browser/navigation_ui_data.h" |
21 #include "content/public/browser/resource_request_info.h" | 21 #include "content/public/browser/resource_request_info.h" |
| 22 #include "content/public/common/previews_state.h" |
22 #include "content/public/common/referrer.h" | 23 #include "content/public/common/referrer.h" |
23 #include "content/public/common/resource_type.h" | 24 #include "content/public/common/resource_type.h" |
24 #include "net/base/load_states.h" | 25 #include "net/base/load_states.h" |
25 | 26 |
26 namespace content { | 27 namespace content { |
27 class DetachableResourceHandler; | 28 class DetachableResourceHandler; |
28 class ResourceContext; | 29 class ResourceContext; |
29 struct GlobalRequestID; | 30 struct GlobalRequestID; |
30 struct GlobalRoutingID; | 31 struct GlobalRoutingID; |
31 | 32 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 bool allow_download, | 64 bool allow_download, |
64 bool has_user_gesture, | 65 bool has_user_gesture, |
65 bool enable_load_timing, | 66 bool enable_load_timing, |
66 bool enable_upload_progress, | 67 bool enable_upload_progress, |
67 bool do_not_prompt_for_login, | 68 bool do_not_prompt_for_login, |
68 blink::WebReferrerPolicy referrer_policy, | 69 blink::WebReferrerPolicy referrer_policy, |
69 blink::WebPageVisibilityState visibility_state, | 70 blink::WebPageVisibilityState visibility_state, |
70 ResourceContext* context, | 71 ResourceContext* context, |
71 bool report_raw_headers, | 72 bool report_raw_headers, |
72 bool is_async, | 73 bool is_async, |
73 bool is_using_lofi, | 74 PreviewsState previews_state, |
74 const std::string& original_headers, | 75 const std::string& original_headers, |
75 const scoped_refptr<ResourceRequestBodyImpl> body, | 76 const scoped_refptr<ResourceRequestBodyImpl> body, |
76 bool initiated_in_secure_context); | 77 bool initiated_in_secure_context); |
77 ~ResourceRequestInfoImpl() override; | 78 ~ResourceRequestInfoImpl() override; |
78 | 79 |
79 // ResourceRequestInfo implementation: | 80 // ResourceRequestInfo implementation: |
80 WebContentsGetter GetWebContentsGetterForRequest() const override; | 81 WebContentsGetter GetWebContentsGetterForRequest() const override; |
81 ResourceContext* GetContext() const override; | 82 ResourceContext* GetContext() const override; |
82 int GetChildID() const override; | 83 int GetChildID() const override; |
83 int GetRouteID() const override; | 84 int GetRouteID() const override; |
84 GlobalRequestID GetGlobalRequestID() const override; | 85 GlobalRequestID GetGlobalRequestID() const override; |
85 int GetOriginPID() const override; | 86 int GetOriginPID() const override; |
86 int GetRenderFrameID() const override; | 87 int GetRenderFrameID() const override; |
87 int GetFrameTreeNodeId() const override; | 88 int GetFrameTreeNodeId() const override; |
88 bool IsMainFrame() const override; | 89 bool IsMainFrame() const override; |
89 bool ParentIsMainFrame() const override; | 90 bool ParentIsMainFrame() const override; |
90 ResourceType GetResourceType() const override; | 91 ResourceType GetResourceType() const override; |
91 int GetProcessType() const override; | 92 int GetProcessType() const override; |
92 blink::WebReferrerPolicy GetReferrerPolicy() const override; | 93 blink::WebReferrerPolicy GetReferrerPolicy() const override; |
93 blink::WebPageVisibilityState GetVisibilityState() const override; | 94 blink::WebPageVisibilityState GetVisibilityState() const override; |
94 ui::PageTransition GetPageTransition() const override; | 95 ui::PageTransition GetPageTransition() const override; |
95 bool HasUserGesture() const override; | 96 bool HasUserGesture() const override; |
96 bool WasIgnoredByHandler() const override; | 97 bool WasIgnoredByHandler() const override; |
97 bool GetAssociatedRenderFrame(int* render_process_id, | 98 bool GetAssociatedRenderFrame(int* render_process_id, |
98 int* render_frame_id) const override; | 99 int* render_frame_id) const override; |
99 bool IsAsync() const override; | 100 bool IsAsync() const override; |
100 bool IsDownload() const override; | 101 bool IsDownload() const override; |
101 bool IsUsingLoFi() const override; | 102 PreviewsState GetPreviewsState() const override; |
102 bool ShouldReportRawHeaders() const; | 103 bool ShouldReportRawHeaders() const; |
103 NavigationUIData* GetNavigationUIData() const override; | 104 NavigationUIData* GetNavigationUIData() const override; |
104 | 105 |
105 CONTENT_EXPORT void AssociateWithRequest(net::URLRequest* request); | 106 CONTENT_EXPORT void AssociateWithRequest(net::URLRequest* request); |
106 | 107 |
107 CONTENT_EXPORT int GetRequestID() const; | 108 CONTENT_EXPORT int GetRequestID() const; |
108 GlobalRoutingID GetGlobalRoutingID() const; | 109 GlobalRoutingID GetGlobalRoutingID() const; |
109 | 110 |
110 // PlzNavigate | 111 // PlzNavigate |
111 // The id of the FrameTreeNode that initiated this request (for a navigation | 112 // The id of the FrameTreeNode that initiated this request (for a navigation |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 bool was_ignored_by_handler_; | 227 bool was_ignored_by_handler_; |
227 bool counted_as_in_flight_request_; | 228 bool counted_as_in_flight_request_; |
228 ResourceType resource_type_; | 229 ResourceType resource_type_; |
229 ui::PageTransition transition_type_; | 230 ui::PageTransition transition_type_; |
230 int memory_cost_; | 231 int memory_cost_; |
231 blink::WebReferrerPolicy referrer_policy_; | 232 blink::WebReferrerPolicy referrer_policy_; |
232 blink::WebPageVisibilityState visibility_state_; | 233 blink::WebPageVisibilityState visibility_state_; |
233 ResourceContext* context_; | 234 ResourceContext* context_; |
234 bool report_raw_headers_; | 235 bool report_raw_headers_; |
235 bool is_async_; | 236 bool is_async_; |
236 bool is_using_lofi_; | 237 PreviewsState previews_state_; |
237 const std::string original_headers_; | 238 const std::string original_headers_; |
238 scoped_refptr<ResourceRequestBodyImpl> body_; | 239 scoped_refptr<ResourceRequestBodyImpl> body_; |
239 bool initiated_in_secure_context_; | 240 bool initiated_in_secure_context_; |
240 std::unique_ptr<NavigationUIData> navigation_ui_data_; | 241 std::unique_ptr<NavigationUIData> navigation_ui_data_; |
241 | 242 |
242 // This callback is set by MojoAsyncResourceHandler to update its mojo binding | 243 // This callback is set by MojoAsyncResourceHandler to update its mojo binding |
243 // and remote endpoint. This callback will be removed once PlzNavigate is | 244 // and remote endpoint. This callback will be removed once PlzNavigate is |
244 // shipped. | 245 // shipped. |
245 TransferCallback on_transfer_; | 246 TransferCallback on_transfer_; |
246 | 247 |
247 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); | 248 DISALLOW_COPY_AND_ASSIGN(ResourceRequestInfoImpl); |
248 }; | 249 }; |
249 | 250 |
250 } // namespace content | 251 } // namespace content |
251 | 252 |
252 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ | 253 #endif // CONTENT_BROWSER_LOADER_RESOURCE_REQUEST_INFO_IMPL_H_ |
OLD | NEW |