OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_COMMON_NAVIGATION_PARAMS_H_ | 5 #ifndef CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
6 #define CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 6 #define CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/optional.h" | 14 #include "base/optional.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
18 #include "content/common/frame_message_enums.h" | 18 #include "content/common/frame_message_enums.h" |
19 #include "content/common/resource_request_body_impl.h" | 19 #include "content/common/resource_request_body_impl.h" |
20 #include "content/public/common/page_state.h" | 20 #include "content/public/common/page_state.h" |
21 #include "content/public/common/previews_state.h" | 21 #include "content/public/common/previews_state.h" |
22 #include "content/public/common/referrer.h" | 22 #include "content/public/common/referrer.h" |
23 #include "content/public/common/request_context_type.h" | 23 #include "content/public/common/request_context_type.h" |
24 #include "content/public/common/resource_response.h" | 24 #include "content/public/common/resource_response.h" |
25 #include "net/url_request/redirect_info.h" | |
25 #include "third_party/WebKit/public/platform/WebMixedContentContextType.h" | 26 #include "third_party/WebKit/public/platform/WebMixedContentContextType.h" |
26 #include "ui/base/page_transition_types.h" | 27 #include "ui/base/page_transition_types.h" |
27 #include "url/gurl.h" | 28 #include "url/gurl.h" |
28 #include "url/origin.h" | 29 #include "url/origin.h" |
29 | 30 |
30 namespace content { | 31 namespace content { |
31 | 32 |
32 // PlzNavigate | 33 // PlzNavigate |
33 // Helper function to determine if the navigation to |url| should make a request | 34 // Helper function to determine if the navigation to |url| should make a request |
34 // to the network stack. A request should not be sent for JavaScript URLs or | 35 // to the network stack. A request should not be sent for JavaScript URLs or |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 }; | 222 }; |
222 | 223 |
223 // Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to | 224 // Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to |
224 // start a browser-initiated navigation besides those in CommonNavigationParams. | 225 // start a browser-initiated navigation besides those in CommonNavigationParams. |
225 // PlzNavigate: sent to the renderer to make it issue a stream request for a | 226 // PlzNavigate: sent to the renderer to make it issue a stream request for a |
226 // navigation that is ready to commit. | 227 // navigation that is ready to commit. |
227 struct CONTENT_EXPORT RequestNavigationParams { | 228 struct CONTENT_EXPORT RequestNavigationParams { |
228 RequestNavigationParams(); | 229 RequestNavigationParams(); |
229 RequestNavigationParams(bool is_overriding_user_agent, | 230 RequestNavigationParams(bool is_overriding_user_agent, |
230 const std::vector<GURL>& redirects, | 231 const std::vector<GURL>& redirects, |
232 const GURL& original_url, | |
233 const std::string& original_method, | |
231 bool can_load_local_resources, | 234 bool can_load_local_resources, |
232 const PageState& page_state, | 235 const PageState& page_state, |
233 int nav_entry_id, | 236 int nav_entry_id, |
234 bool is_history_navigation_in_new_child, | 237 bool is_history_navigation_in_new_child, |
235 std::map<std::string, bool> subframe_unique_names, | 238 std::map<std::string, bool> subframe_unique_names, |
236 bool has_committed_real_load, | 239 bool has_committed_real_load, |
237 bool intended_as_new_entry, | 240 bool intended_as_new_entry, |
238 int pending_history_list_offset, | 241 int pending_history_list_offset, |
239 int current_history_list_offset, | 242 int current_history_list_offset, |
240 int current_history_list_length, | 243 int current_history_list_length, |
241 bool is_view_source, | 244 bool is_view_source, |
242 bool should_clear_history_list, | 245 bool should_clear_history_list, |
243 bool has_user_gesture); | 246 bool has_user_gesture); |
244 RequestNavigationParams(const RequestNavigationParams& other); | 247 RequestNavigationParams(const RequestNavigationParams& other); |
245 ~RequestNavigationParams(); | 248 ~RequestNavigationParams(); |
246 | 249 |
247 // Whether or not the user agent override string should be used. | 250 // Whether or not the user agent override string should be used. |
248 bool is_overriding_user_agent; | 251 bool is_overriding_user_agent; |
249 | 252 |
250 // Any redirect URLs that occurred before |url|. Useful for cross-process | 253 // Any redirect URLs that occurred before |url|. Useful for cross-process |
251 // navigations; defaults to empty. | 254 // navigations; defaults to empty. |
252 std::vector<GURL> redirects; | 255 std::vector<GURL> redirects; |
253 | 256 |
254 // The ResourceResponseInfos received during redirects. | 257 // The ResourceResponseInfos received during redirects. |
255 std::vector<ResourceResponseInfo> redirect_response; | 258 std::vector<ResourceResponseInfo> redirect_response; |
256 | 259 |
260 // PlzNavigate | |
261 // The RedirectInfos received during redirects. | |
262 std::vector<net::RedirectInfo> redirect_infos; | |
263 | |
264 // PlzNavigate | |
265 // The original URL & method for this navigation. | |
266 GURL original_url; | |
267 std::string original_method; | |
nasko
2017/02/10 23:53:09
Can the method change between redirects? If not, w
clamy
2017/02/13 14:29:37
Yes. It's possible for a POST (like a form submiss
nasko
2017/02/14 17:25:02
Acknowledged.
| |
268 | |
257 // Whether or not this url should be allowed to access local file:// | 269 // Whether or not this url should be allowed to access local file:// |
258 // resources. | 270 // resources. |
259 bool can_load_local_resources; | 271 bool can_load_local_resources; |
260 | 272 |
261 // Opaque history state (received by ViewHostMsg_UpdateState). | 273 // Opaque history state (received by ViewHostMsg_UpdateState). |
262 PageState page_state; | 274 PageState page_state; |
263 | 275 |
264 // For browser-initiated navigations, this is the unique id of the | 276 // For browser-initiated navigations, this is the unique id of the |
265 // NavigationEntry being navigated to. (For renderer-initiated navigations it | 277 // NavigationEntry being navigated to. (For renderer-initiated navigations it |
266 // is 0.) If the load succeeds, then this nav_entry_id will be reflected in | 278 // is 0.) If the load succeeds, then this nav_entry_id will be reflected in |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
353 ~NavigationParams(); | 365 ~NavigationParams(); |
354 | 366 |
355 CommonNavigationParams common_params; | 367 CommonNavigationParams common_params; |
356 StartNavigationParams start_params; | 368 StartNavigationParams start_params; |
357 RequestNavigationParams request_params; | 369 RequestNavigationParams request_params; |
358 }; | 370 }; |
359 | 371 |
360 } // namespace content | 372 } // namespace content |
361 | 373 |
362 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 374 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
OLD | NEW |