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/content_security_policy/csp_disposition_enum.h" | 18 #include "content/common/content_security_policy/csp_disposition_enum.h" |
19 #include "content/common/frame_message_enums.h" | 19 #include "content/common/frame_message_enums.h" |
20 #include "content/common/resource_request_body_impl.h" | |
21 #include "content/public/common/page_state.h" | 20 #include "content/public/common/page_state.h" |
22 #include "content/public/common/previews_state.h" | 21 #include "content/public/common/previews_state.h" |
23 #include "content/public/common/referrer.h" | 22 #include "content/public/common/referrer.h" |
24 #include "content/public/common/request_context_type.h" | 23 #include "content/public/common/request_context_type.h" |
| 24 #include "content/public/common/resource_request_body.h" |
25 #include "content/public/common/resource_response.h" | 25 #include "content/public/common/resource_response.h" |
26 #include "net/url_request/redirect_info.h" | 26 #include "net/url_request/redirect_info.h" |
27 #include "third_party/WebKit/public/platform/WebMixedContentContextType.h" | 27 #include "third_party/WebKit/public/platform/WebMixedContentContextType.h" |
28 #include "ui/base/page_transition_types.h" | 28 #include "ui/base/page_transition_types.h" |
29 #include "url/gurl.h" | 29 #include "url/gurl.h" |
30 #include "url/origin.h" | 30 #include "url/origin.h" |
31 | 31 |
32 namespace content { | 32 namespace content { |
33 | 33 |
34 // PlzNavigate | 34 // PlzNavigate |
(...skipping 19 matching lines...) Expand all Loading... |
54 | 54 |
55 // The following structures hold parameters used during a navigation. In | 55 // The following structures hold parameters used during a navigation. In |
56 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and | 56 // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and |
57 // FrameHostMsg_BeginNavigation. | 57 // FrameHostMsg_BeginNavigation. |
58 | 58 |
59 // Provided by the browser or the renderer ------------------------------------- | 59 // Provided by the browser or the renderer ------------------------------------- |
60 | 60 |
61 // Used by all navigation IPCs. | 61 // Used by all navigation IPCs. |
62 struct CONTENT_EXPORT CommonNavigationParams { | 62 struct CONTENT_EXPORT CommonNavigationParams { |
63 CommonNavigationParams(); | 63 CommonNavigationParams(); |
64 CommonNavigationParams( | 64 CommonNavigationParams(const GURL& url, |
65 const GURL& url, | 65 const Referrer& referrer, |
66 const Referrer& referrer, | 66 ui::PageTransition transition, |
67 ui::PageTransition transition, | 67 FrameMsg_Navigate_Type::Value navigation_type, |
68 FrameMsg_Navigate_Type::Value navigation_type, | 68 bool allow_download, |
69 bool allow_download, | 69 bool should_replace_current_entry, |
70 bool should_replace_current_entry, | 70 base::TimeTicks ui_timestamp, |
71 base::TimeTicks ui_timestamp, | 71 FrameMsg_UILoadMetricsReportType::Value report_type, |
72 FrameMsg_UILoadMetricsReportType::Value report_type, | 72 const GURL& base_url_for_data_url, |
73 const GURL& base_url_for_data_url, | 73 const GURL& history_url_for_data_url, |
74 const GURL& history_url_for_data_url, | 74 PreviewsState previews_state, |
75 PreviewsState previews_state, | 75 const base::TimeTicks& navigation_start, |
76 const base::TimeTicks& navigation_start, | 76 std::string method, |
77 std::string method, | 77 const scoped_refptr<ResourceRequestBody>& post_data, |
78 const scoped_refptr<ResourceRequestBodyImpl>& post_data, | 78 base::Optional<SourceLocation> source_location, |
79 base::Optional<SourceLocation> source_location, | 79 CSPDisposition should_check_main_world_csp); |
80 CSPDisposition should_check_main_world_csp); | |
81 CommonNavigationParams(const CommonNavigationParams& other); | 80 CommonNavigationParams(const CommonNavigationParams& other); |
82 ~CommonNavigationParams(); | 81 ~CommonNavigationParams(); |
83 | 82 |
84 // The URL to navigate to. | 83 // The URL to navigate to. |
85 // PlzNavigate: May be modified when the navigation is ready to commit. | 84 // PlzNavigate: May be modified when the navigation is ready to commit. |
86 GURL url; | 85 GURL url; |
87 | 86 |
88 // The URL to send in the "Referer" header field. Can be empty if there is | 87 // The URL to send in the "Referer" header field. Can be empty if there is |
89 // no referrer. | 88 // no referrer. |
90 Referrer referrer; | 89 Referrer referrer; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // If this is for a browser-initiated navigation, this can override the | 129 // If this is for a browser-initiated navigation, this can override the |
131 // navigation_start value in Blink. | 130 // navigation_start value in Blink. |
132 // PlzNavigate: For renderer initiated navigations, this will be set on the | 131 // PlzNavigate: For renderer initiated navigations, this will be set on the |
133 // renderer side and sent with FrameHostMsg_BeginNavigation. | 132 // renderer side and sent with FrameHostMsg_BeginNavigation. |
134 base::TimeTicks navigation_start; | 133 base::TimeTicks navigation_start; |
135 | 134 |
136 // The request method: GET, POST, etc. | 135 // The request method: GET, POST, etc. |
137 std::string method; | 136 std::string method; |
138 | 137 |
139 // Body of HTTP POST request. | 138 // Body of HTTP POST request. |
140 scoped_refptr<ResourceRequestBodyImpl> post_data; | 139 scoped_refptr<ResourceRequestBody> post_data; |
141 | 140 |
142 // PlzNavigate | 141 // PlzNavigate |
143 // Information about the Javascript source for this navigation. Used for | 142 // Information about the Javascript source for this navigation. Used for |
144 // providing information in console error messages triggered by the | 143 // providing information in console error messages triggered by the |
145 // navigation. If the navigation was not caused by Javascript, this should | 144 // navigation. If the navigation was not caused by Javascript, this should |
146 // not be set. | 145 // not be set. |
147 base::Optional<SourceLocation> source_location; | 146 base::Optional<SourceLocation> source_location; |
148 | 147 |
149 // Whether or not the CSP of the main world should apply. When the navigation | 148 // Whether or not the CSP of the main world should apply. When the navigation |
150 // is initiated from a content script in an isolated world, the CSP defined | 149 // is initiated from a content script in an isolated world, the CSP defined |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 ~NavigationParams(); | 401 ~NavigationParams(); |
403 | 402 |
404 CommonNavigationParams common_params; | 403 CommonNavigationParams common_params; |
405 StartNavigationParams start_params; | 404 StartNavigationParams start_params; |
406 RequestNavigationParams request_params; | 405 RequestNavigationParams request_params; |
407 }; | 406 }; |
408 | 407 |
409 } // namespace content | 408 } // namespace content |
410 | 409 |
411 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ | 410 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |
OLD | NEW |