Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Side by Side Diff: content/common/navigation_params.h

Issue 1678303004: PlzNavigate: inform the renderer that a navigation is a POST (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/frame_messages.h ('k') | content/common/navigation_params.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <string> 10 #include <string>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 const Referrer& referrer, 52 const Referrer& referrer,
53 ui::PageTransition transition, 53 ui::PageTransition transition,
54 FrameMsg_Navigate_Type::Value navigation_type, 54 FrameMsg_Navigate_Type::Value navigation_type,
55 bool allow_download, 55 bool allow_download,
56 bool should_replace_current_entry, 56 bool should_replace_current_entry,
57 base::TimeTicks ui_timestamp, 57 base::TimeTicks ui_timestamp,
58 FrameMsg_UILoadMetricsReportType::Value report_type, 58 FrameMsg_UILoadMetricsReportType::Value report_type,
59 const GURL& base_url_for_data_url, 59 const GURL& base_url_for_data_url,
60 const GURL& history_url_for_data_url, 60 const GURL& history_url_for_data_url,
61 LoFiState lofi_state, 61 LoFiState lofi_state,
62 const base::TimeTicks& navigation_start); 62 const base::TimeTicks& navigation_start,
63 std::string method);
63 CommonNavigationParams(const CommonNavigationParams& other); 64 CommonNavigationParams(const CommonNavigationParams& other);
64 ~CommonNavigationParams(); 65 ~CommonNavigationParams();
65 66
66 // The URL to navigate to. 67 // The URL to navigate to.
67 // PlzNavigate: May be modified when the navigation is ready to commit. 68 // PlzNavigate: May be modified when the navigation is ready to commit.
68 GURL url; 69 GURL url;
69 70
70 // The URL to send in the "Referer" header field. Can be empty if there is 71 // The URL to send in the "Referer" header field. Can be empty if there is
71 // no referrer. 72 // no referrer.
72 Referrer referrer; 73 Referrer referrer;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Whether or not to request a LoFi version of the document or let the browser 108 // Whether or not to request a LoFi version of the document or let the browser
108 // decide. 109 // decide.
109 LoFiState lofi_state; 110 LoFiState lofi_state;
110 111
111 // The navigationStart time exposed through the Navigation Timing API to JS. 112 // The navigationStart time exposed through the Navigation Timing API to JS.
112 // If this is for a browser-initiated navigation, this can override the 113 // If this is for a browser-initiated navigation, this can override the
113 // navigation_start value in Blink. 114 // navigation_start value in Blink.
114 // PlzNavigate: For renderer initiated navigations, this will be set on the 115 // PlzNavigate: For renderer initiated navigations, this will be set on the
115 // renderer side and sent with FrameHostMsg_BeginNavigation. 116 // renderer side and sent with FrameHostMsg_BeginNavigation.
116 base::TimeTicks navigation_start; 117 base::TimeTicks navigation_start;
118
119 // The request method: GET, POST, etc.
120 std::string method;
117 }; 121 };
118 122
119 // Provided by the renderer ---------------------------------------------------- 123 // Provided by the renderer ----------------------------------------------------
120 // 124 //
121 // This struct holds parameters sent by the renderer to the browser. It is only 125 // This struct holds parameters sent by the renderer to the browser. It is only
122 // used in PlzNavigate (since in the current architecture, the renderer does not 126 // used in PlzNavigate (since in the current architecture, the renderer does not
123 // inform the browser of navigations until they commit). 127 // inform the browser of navigations until they commit).
124 128
125 // This struct is not used outside of the PlzNavigate project. 129 // This struct is not used outside of the PlzNavigate project.
126 // PlzNavigate: parameters needed to start a navigation on the IO thread, 130 // PlzNavigate: parameters needed to start a navigation on the IO thread,
127 // following a renderer-initiated navigation request. 131 // following a renderer-initiated navigation request.
128 struct CONTENT_EXPORT BeginNavigationParams { 132 struct CONTENT_EXPORT BeginNavigationParams {
129 // TODO(clamy): See if it is possible to reuse this in 133 // TODO(clamy): See if it is possible to reuse this in
130 // ResourceMsg_Request_Params. 134 // ResourceMsg_Request_Params.
131 BeginNavigationParams(); 135 BeginNavigationParams();
132 BeginNavigationParams(std::string method, 136 BeginNavigationParams(std::string headers,
133 std::string headers,
134 int load_flags, 137 int load_flags,
135 bool has_user_gesture, 138 bool has_user_gesture,
136 bool skip_service_worker, 139 bool skip_service_worker,
137 RequestContextType request_context_type); 140 RequestContextType request_context_type);
138 BeginNavigationParams(const BeginNavigationParams& other); 141 BeginNavigationParams(const BeginNavigationParams& other);
139 142
140 // The request method: GET, POST, etc.
141 std::string method;
142
143 // Additional HTTP request headers. 143 // Additional HTTP request headers.
144 std::string headers; 144 std::string headers;
145 145
146 // net::URLRequest load flags (net::LOAD_NORMAL) by default). 146 // net::URLRequest load flags (net::LOAD_NORMAL) by default).
147 int load_flags; 147 int load_flags;
148 148
149 // True if the request was user initiated. 149 // True if the request was user initiated.
150 bool has_user_gesture; 150 bool has_user_gesture;
151 151
152 // True if the ServiceWorker should be skipped. 152 // True if the ServiceWorker should be skipped.
(...skipping 13 matching lines...) Expand all
166 166
167 // Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to 167 // Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to
168 // start a browser-initiated navigation besides those in CommonNavigationParams. 168 // start a browser-initiated navigation besides those in CommonNavigationParams.
169 // The difference with the RequestNavigationParams below is that they are only 169 // The difference with the RequestNavigationParams below is that they are only
170 // used in the current architecture of navigation, and will not be used by 170 // used in the current architecture of navigation, and will not be used by
171 // PlzNavigate. 171 // PlzNavigate.
172 // PlzNavigate: These are not used. 172 // PlzNavigate: These are not used.
173 struct CONTENT_EXPORT StartNavigationParams { 173 struct CONTENT_EXPORT StartNavigationParams {
174 StartNavigationParams(); 174 StartNavigationParams();
175 StartNavigationParams( 175 StartNavigationParams(
176 bool is_post,
177 const std::string& extra_headers, 176 const std::string& extra_headers,
178 const std::vector<unsigned char>& browser_initiated_post_data, 177 const std::vector<unsigned char>& browser_initiated_post_data,
179 #if defined(OS_ANDROID) 178 #if defined(OS_ANDROID)
180 bool has_user_gesture, 179 bool has_user_gesture,
181 #endif 180 #endif
182 int transferred_request_child_id, 181 int transferred_request_child_id,
183 int transferred_request_request_id); 182 int transferred_request_request_id);
184 StartNavigationParams(const StartNavigationParams& other); 183 StartNavigationParams(const StartNavigationParams& other);
185 ~StartNavigationParams(); 184 ~StartNavigationParams();
186 185
187 // Whether the navigation is a POST request (as opposed to a GET).
188 bool is_post;
189
190 // Extra headers (separated by \n) to send during the request. 186 // Extra headers (separated by \n) to send during the request.
191 std::string extra_headers; 187 std::string extra_headers;
192 188
193 // If is_post is true, holds the post_data information from browser. Empty 189 // If is_post is true, holds the post_data information from browser. Empty
194 // otherwise. 190 // otherwise.
195 std::vector<unsigned char> browser_initiated_post_data; 191 std::vector<unsigned char> browser_initiated_post_data;
196 192
197 #if defined(OS_ANDROID) 193 #if defined(OS_ANDROID)
198 bool has_user_gesture; 194 bool has_user_gesture;
199 #endif 195 #endif
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 ~NavigationParams(); 322 ~NavigationParams();
327 323
328 CommonNavigationParams common_params; 324 CommonNavigationParams common_params;
329 StartNavigationParams start_params; 325 StartNavigationParams start_params;
330 RequestNavigationParams request_params; 326 RequestNavigationParams request_params;
331 }; 327 };
332 328
333 } // namespace content 329 } // namespace content
334 330
335 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ 331 #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_
OLDNEW
« no previous file with comments | « content/common/frame_messages.h ('k') | content/common/navigation_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698