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

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

Issue 1999943002: Moving HTTP POST body from StartNavigationParams to CommonNavigationParams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR feedback from clamy@. Created 4 years, 7 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>
11 11
12 #include "base/memory/ref_counted.h"
12 #include "base/time/time.h" 13 #include "base/time/time.h"
13 #include "build/build_config.h" 14 #include "build/build_config.h"
14 #include "content/common/content_export.h" 15 #include "content/common/content_export.h"
15 #include "content/common/frame_message_enums.h" 16 #include "content/common/frame_message_enums.h"
17 #include "content/common/resource_request_body.h"
16 #include "content/public/common/page_state.h" 18 #include "content/public/common/page_state.h"
17 #include "content/public/common/referrer.h" 19 #include "content/public/common/referrer.h"
18 #include "content/public/common/request_context_type.h" 20 #include "content/public/common/request_context_type.h"
19 #include "ui/base/page_transition_types.h" 21 #include "ui/base/page_transition_types.h"
20 #include "url/gurl.h" 22 #include "url/gurl.h"
21 23
22 namespace content { 24 namespace content {
23 25
24 // The LoFi state which determines whether to add the Lo-Fi header. 26 // The LoFi state which determines whether to add the Lo-Fi header.
25 enum LoFiState { 27 enum LoFiState {
(...skipping 27 matching lines...) Expand all
53 ui::PageTransition transition, 55 ui::PageTransition transition,
54 FrameMsg_Navigate_Type::Value navigation_type, 56 FrameMsg_Navigate_Type::Value navigation_type,
55 bool allow_download, 57 bool allow_download,
56 bool should_replace_current_entry, 58 bool should_replace_current_entry,
57 base::TimeTicks ui_timestamp, 59 base::TimeTicks ui_timestamp,
58 FrameMsg_UILoadMetricsReportType::Value report_type, 60 FrameMsg_UILoadMetricsReportType::Value report_type,
59 const GURL& base_url_for_data_url, 61 const GURL& base_url_for_data_url,
60 const GURL& history_url_for_data_url, 62 const GURL& history_url_for_data_url,
61 LoFiState lofi_state, 63 LoFiState lofi_state,
62 const base::TimeTicks& navigation_start, 64 const base::TimeTicks& navigation_start,
63 std::string method); 65 std::string method,
66 const scoped_refptr<ResourceRequestBody>& post_data);
64 CommonNavigationParams(const CommonNavigationParams& other); 67 CommonNavigationParams(const CommonNavigationParams& other);
65 ~CommonNavigationParams(); 68 ~CommonNavigationParams();
66 69
67 // The URL to navigate to. 70 // The URL to navigate to.
68 // PlzNavigate: May be modified when the navigation is ready to commit. 71 // PlzNavigate: May be modified when the navigation is ready to commit.
69 GURL url; 72 GURL url;
70 73
71 // The URL to send in the "Referer" header field. Can be empty if there is 74 // The URL to send in the "Referer" header field. Can be empty if there is
72 // no referrer. 75 // no referrer.
73 Referrer referrer; 76 Referrer referrer;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 114
112 // The navigationStart time exposed through the Navigation Timing API to JS. 115 // The navigationStart time exposed through the Navigation Timing API to JS.
113 // If this is for a browser-initiated navigation, this can override the 116 // If this is for a browser-initiated navigation, this can override the
114 // navigation_start value in Blink. 117 // navigation_start value in Blink.
115 // PlzNavigate: For renderer initiated navigations, this will be set on the 118 // PlzNavigate: For renderer initiated navigations, this will be set on the
116 // renderer side and sent with FrameHostMsg_BeginNavigation. 119 // renderer side and sent with FrameHostMsg_BeginNavigation.
117 base::TimeTicks navigation_start; 120 base::TimeTicks navigation_start;
118 121
119 // The request method: GET, POST, etc. 122 // The request method: GET, POST, etc.
120 std::string method; 123 std::string method;
124
125 // Body of HTTP POST request.
126 scoped_refptr<ResourceRequestBody> post_data;
121 }; 127 };
122 128
123 // Provided by the renderer ---------------------------------------------------- 129 // Provided by the renderer ----------------------------------------------------
124 // 130 //
125 // This struct holds parameters sent by the renderer to the browser. It is only 131 // This struct holds parameters sent by the renderer to the browser. It is only
126 // used in PlzNavigate (since in the current architecture, the renderer does not 132 // used in PlzNavigate (since in the current architecture, the renderer does not
127 // inform the browser of navigations until they commit). 133 // inform the browser of navigations until they commit).
128 134
129 // This struct is not used outside of the PlzNavigate project. 135 // This struct is not used outside of the PlzNavigate project.
130 // PlzNavigate: parameters needed to start a navigation on the IO thread, 136 // PlzNavigate: parameters needed to start a navigation on the IO thread,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // architecture should go in StartNavigationParams. 171 // architecture should go in StartNavigationParams.
166 172
167 // Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to 173 // Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to
168 // start a browser-initiated navigation besides those in CommonNavigationParams. 174 // start a browser-initiated navigation besides those in CommonNavigationParams.
169 // The difference with the RequestNavigationParams below is that they are only 175 // 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 176 // used in the current architecture of navigation, and will not be used by
171 // PlzNavigate. 177 // PlzNavigate.
172 // PlzNavigate: These are not used. 178 // PlzNavigate: These are not used.
173 struct CONTENT_EXPORT StartNavigationParams { 179 struct CONTENT_EXPORT StartNavigationParams {
174 StartNavigationParams(); 180 StartNavigationParams();
175 StartNavigationParams( 181 StartNavigationParams(const std::string& extra_headers,
176 const std::string& extra_headers,
177 const std::vector<unsigned char>& browser_initiated_post_data,
178 #if defined(OS_ANDROID) 182 #if defined(OS_ANDROID)
179 bool has_user_gesture, 183 bool has_user_gesture,
180 #endif 184 #endif
181 int transferred_request_child_id, 185 int transferred_request_child_id,
182 int transferred_request_request_id); 186 int transferred_request_request_id);
183 StartNavigationParams(const StartNavigationParams& other); 187 StartNavigationParams(const StartNavigationParams& other);
184 ~StartNavigationParams(); 188 ~StartNavigationParams();
185 189
186 // Extra headers (separated by \n) to send during the request. 190 // Extra headers (separated by \n) to send during the request.
187 std::string extra_headers; 191 std::string extra_headers;
188 192
189 // If is_post is true, holds the post_data information from browser. Empty
190 // otherwise.
191 std::vector<unsigned char> browser_initiated_post_data;
192
193 #if defined(OS_ANDROID) 193 #if defined(OS_ANDROID)
194 bool has_user_gesture; 194 bool has_user_gesture;
195 #endif 195 #endif
196 196
197 // The following two members identify a previous request that has been 197 // The following two members identify a previous request that has been
198 // created before this navigation is being transferred to a new render view. 198 // created before this navigation is being transferred to a new render view.
199 // This serves the purpose of recycling the old request. 199 // This serves the purpose of recycling the old request.
200 // Unless this refers to a transferred navigation, these values are -1 and -1. 200 // Unless this refers to a transferred navigation, these values are -1 and -1.
201 int transferred_request_child_id; 201 int transferred_request_child_id;
202 int transferred_request_request_id; 202 int transferred_request_request_id;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 ~NavigationParams(); 322 ~NavigationParams();
323 323
324 CommonNavigationParams common_params; 324 CommonNavigationParams common_params;
325 StartNavigationParams start_params; 325 StartNavigationParams start_params;
326 RequestNavigationParams request_params; 326 RequestNavigationParams request_params;
327 }; 327 };
328 328
329 } // namespace content 329 } // namespace content
330 330
331 #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