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

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

Issue 483773002: PlzNavigate: implement CommitNavigation on the browser side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NavigationRequest has ownership of NavigationParams Created 6 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // IPC messages for interacting with frames. 5 // IPC messages for interacting with frames.
6 // Multiply-included message file, hence no include guard. 6 // Multiply-included message file, hence no include guard.
7 7
8 #include "content/common/content_export.h" 8 #include "content/common/content_export.h"
9 #include "content/common/content_param_traits.h" 9 #include "content/common/content_param_traits.h"
10 #include "content/common/frame_message_enums.h" 10 #include "content/common/frame_message_enums.h"
11 #include "content/common/frame_param.h" 11 #include "content/common/frame_param.h"
12 #include "content/common/navigation_gesture.h" 12 #include "content/common/navigation_gesture.h"
13 #include "content/common/navigation_params.h"
13 #include "content/common/resource_request_body.h" 14 #include "content/common/resource_request_body.h"
14 #include "content/public/common/color_suggestion.h" 15 #include "content/public/common/color_suggestion.h"
15 #include "content/public/common/common_param_traits.h" 16 #include "content/public/common/common_param_traits.h"
16 #include "content/public/common/context_menu_params.h" 17 #include "content/public/common/context_menu_params.h"
17 #include "content/public/common/frame_navigate_params.h" 18 #include "content/public/common/frame_navigate_params.h"
18 #include "content/public/common/javascript_message_type.h" 19 #include "content/public/common/javascript_message_type.h"
19 #include "content/public/common/page_state.h" 20 #include "content/public/common/page_state.h"
20 #include "ipc/ipc_message_macros.h" 21 #include "ipc/ipc_message_macros.h"
21 #include "ui/gfx/ipc/gfx_param_traits.h" 22 #include "ui/gfx/ipc/gfx_param_traits.h"
22 #include "url/gurl.h" 23 #include "url/gurl.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // We need to track the RenderViewHost routing_id because of downstream 163 // We need to track the RenderViewHost routing_id because of downstream
163 // dependencies (crbug.com/392171 DownloadRequestHandle, SaveFileManager, 164 // dependencies (crbug.com/392171 DownloadRequestHandle, SaveFileManager,
164 // ResourceDispatcherHostImpl, MediaStreamUIProxy, 165 // ResourceDispatcherHostImpl, MediaStreamUIProxy,
165 // SpeechRecognitionDispatcherHost and possibly others). They look up the view 166 // SpeechRecognitionDispatcherHost and possibly others). They look up the view
166 // based on the ID stored in the resource requests. Once those dependencies 167 // based on the ID stored in the resource requests. Once those dependencies
167 // are unwound or moved to RenderFrameHost (crbug.com/304341) we can move the 168 // are unwound or moved to RenderFrameHost (crbug.com/304341) we can move the
168 // client to be based on the routing_id of the RenderFrameHost. 169 // client to be based on the routing_id of the RenderFrameHost.
169 IPC_STRUCT_MEMBER(int, render_view_routing_id) 170 IPC_STRUCT_MEMBER(int, render_view_routing_id)
170 IPC_STRUCT_END() 171 IPC_STRUCT_END()
171 172
173 IPC_STRUCT_TRAITS_BEGIN(content::CoreNavigationParams)
174 IPC_STRUCT_TRAITS_MEMBER(url)
175 IPC_STRUCT_TRAITS_MEMBER(referrer)
176 IPC_STRUCT_TRAITS_MEMBER(transition)
177 IPC_STRUCT_TRAITS_MEMBER(navigation_type)
178 IPC_STRUCT_TRAITS_MEMBER(allow_download)
179 IPC_STRUCT_TRAITS_END()
180
181 IPC_STRUCT_TRAITS_BEGIN(content::RequestNavigationParams)
182 IPC_STRUCT_TRAITS_MEMBER(is_post)
183 IPC_STRUCT_TRAITS_MEMBER(extra_headers)
184 IPC_STRUCT_TRAITS_MEMBER(browser_initiated_post_data)
185 IPC_STRUCT_TRAITS_END()
186
187 IPC_STRUCT_TRAITS_BEGIN(content::CommitNavigationParams)
188 IPC_STRUCT_TRAITS_MEMBER(page_state)
189 IPC_STRUCT_TRAITS_MEMBER(is_overriding_user_agent)
190 IPC_STRUCT_TRAITS_MEMBER(browser_navigation_start)
191 IPC_STRUCT_TRAITS_END()
192
172 IPC_STRUCT_BEGIN(FrameMsg_Navigate_Params) 193 IPC_STRUCT_BEGIN(FrameMsg_Navigate_Params)
194 // TODO(clamy): investigate which parameters are also needed in PlzNavigate
195 // and move them to the appropriate NavigationParams struct.
196
197 // These structs contain parameters shared by other navigation IPCs.
198 IPC_STRUCT_MEMBER(content::CoreNavigationParams, core_params)
199 IPC_STRUCT_MEMBER(content::RequestNavigationParams, request_params)
200 IPC_STRUCT_MEMBER(content::CommitNavigationParams, commit_params)
201
173 // The page_id for this navigation, or -1 if it is a new navigation. Back, 202 // The page_id for this navigation, or -1 if it is a new navigation. Back,
174 // Forward, and Reload navigations should have a valid page_id. If the load 203 // Forward, and Reload navigations should have a valid page_id. If the load
175 // succeeds, then this page_id will be reflected in the resultant 204 // succeeds, then this page_id will be reflected in the resultant
176 // FrameHostMsg_DidCommitProvisionalLoad message. 205 // FrameHostMsg_DidCommitProvisionalLoad message.
177 IPC_STRUCT_MEMBER(int32, page_id) 206 IPC_STRUCT_MEMBER(int32, page_id)
178 207
179 // If page_id is -1, then pending_history_list_offset will also be -1. 208 // If page_id is -1, then pending_history_list_offset will also be -1.
180 // Otherwise, it contains the offset into the history list corresponding to 209 // Otherwise, it contains the offset into the history list corresponding to
181 // the current navigation. 210 // the current navigation.
182 IPC_STRUCT_MEMBER(int, pending_history_list_offset) 211 IPC_STRUCT_MEMBER(int, pending_history_list_offset)
183 212
184 // Informs the RenderView of where its current page contents reside in 213 // Informs the RenderView of where its current page contents reside in
185 // session history and the total size of the session history list. 214 // session history and the total size of the session history list.
186 IPC_STRUCT_MEMBER(int, current_history_list_offset) 215 IPC_STRUCT_MEMBER(int, current_history_list_offset)
187 IPC_STRUCT_MEMBER(int, current_history_list_length) 216 IPC_STRUCT_MEMBER(int, current_history_list_length)
188 217
189 // Informs the RenderView the session history should be cleared. In that 218 // Informs the RenderView the session history should be cleared. In that
190 // case, the RenderView needs to notify the browser that the clearing was 219 // case, the RenderView needs to notify the browser that the clearing was
191 // succesful when the navigation commits. 220 // succesful when the navigation commits.
192 IPC_STRUCT_MEMBER(bool, should_clear_history_list) 221 IPC_STRUCT_MEMBER(bool, should_clear_history_list)
193 222
194 // The URL to load.
195 IPC_STRUCT_MEMBER(GURL, url)
196
197 // Base URL for use in WebKit's SubstituteData. 223 // Base URL for use in WebKit's SubstituteData.
198 // Is only used with data: URLs. 224 // Is only used with data: URLs.
199 IPC_STRUCT_MEMBER(GURL, base_url_for_data_url) 225 IPC_STRUCT_MEMBER(GURL, base_url_for_data_url)
200 226
201 // History URL for use in WebKit's SubstituteData. 227 // History URL for use in WebKit's SubstituteData.
202 // Is only used with data: URLs. 228 // Is only used with data: URLs.
203 IPC_STRUCT_MEMBER(GURL, history_url_for_data_url) 229 IPC_STRUCT_MEMBER(GURL, history_url_for_data_url)
204 230
205 // The URL to send in the "Referer" header field. Can be empty if there is
206 // no referrer.
207 IPC_STRUCT_MEMBER(content::Referrer, referrer)
208
209 // Any redirect URLs that occurred before |url|. Useful for cross-process 231 // Any redirect URLs that occurred before |url|. Useful for cross-process
210 // navigations; defaults to empty. 232 // navigations; defaults to empty.
211 IPC_STRUCT_MEMBER(std::vector<GURL>, redirects) 233 IPC_STRUCT_MEMBER(std::vector<GURL>, redirects)
212 234
213 // The type of transition.
214 IPC_STRUCT_MEMBER(ui::PageTransition, transition)
215
216 // Informs the RenderView the pending navigation should replace the current 235 // Informs the RenderView the pending navigation should replace the current
217 // history entry when it commits. This is used for cross-process redirects so 236 // history entry when it commits. This is used for cross-process redirects so
218 // the transferred navigation can recover the navigation state. 237 // the transferred navigation can recover the navigation state.
219 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) 238 IPC_STRUCT_MEMBER(bool, should_replace_current_entry)
220 239
221 // Opaque history state (received by ViewHostMsg_UpdateState).
222 IPC_STRUCT_MEMBER(content::PageState, page_state)
223
224 // Type of navigation.
225 IPC_STRUCT_MEMBER(FrameMsg_Navigate_Type::Value, navigation_type)
226
227 // The time the request was created. This is used by the old performance 240 // The time the request was created. This is used by the old performance
228 // infrastructure to set up DocumentState associated with the RenderView. 241 // infrastructure to set up DocumentState associated with the RenderView.
229 // TODO(ppi): make it go away. 242 // TODO(ppi): make it go away.
230 IPC_STRUCT_MEMBER(base::Time, request_time) 243 IPC_STRUCT_MEMBER(base::Time, request_time)
231 244
232 // Extra headers (separated by \n) to send during the request.
233 IPC_STRUCT_MEMBER(std::string, extra_headers)
234
235 // The following two members identify a previous request that has been 245 // The following two members identify a previous request that has been
236 // created before this navigation is being transferred to a new render view. 246 // created before this navigation is being transferred to a new render view.
237 // This serves the purpose of recycling the old request. 247 // This serves the purpose of recycling the old request.
238 // Unless this refers to a transferred navigation, these values are -1 and -1. 248 // Unless this refers to a transferred navigation, these values are -1 and -1.
239 IPC_STRUCT_MEMBER(int, transferred_request_child_id) 249 IPC_STRUCT_MEMBER(int, transferred_request_child_id)
240 IPC_STRUCT_MEMBER(int, transferred_request_request_id) 250 IPC_STRUCT_MEMBER(int, transferred_request_request_id)
241 251
242 // Whether or not we should allow the url to download.
243 IPC_STRUCT_MEMBER(bool, allow_download)
244
245 // Whether or not the user agent override string should be used.
246 IPC_STRUCT_MEMBER(bool, is_overriding_user_agent)
247
248 // True if this was a post request.
249 IPC_STRUCT_MEMBER(bool, is_post)
250
251 // If is_post is true, holds the post_data information from browser. Empty
252 // otherwise.
253 IPC_STRUCT_MEMBER(std::vector<unsigned char>, browser_initiated_post_data)
254
255 // Whether or not this url should be allowed to access local file:// 252 // Whether or not this url should be allowed to access local file://
256 // resources. 253 // resources.
257 IPC_STRUCT_MEMBER(bool, can_load_local_resources) 254 IPC_STRUCT_MEMBER(bool, can_load_local_resources)
258 255
259 // If not empty, which frame to navigate. 256 // If not empty, which frame to navigate.
260 IPC_STRUCT_MEMBER(std::string, frame_to_navigate) 257 IPC_STRUCT_MEMBER(std::string, frame_to_navigate)
261
262 // The navigationStart time to expose through the Navigation Timing API to JS.
263 IPC_STRUCT_MEMBER(base::TimeTicks, browser_navigation_start)
264 IPC_STRUCT_END() 258 IPC_STRUCT_END()
265 259
266 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params) 260 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params)
267 IPC_STRUCT_MEMBER(GURL, url) 261 IPC_STRUCT_MEMBER(GURL, url)
268 IPC_STRUCT_MEMBER(content::Referrer, referrer) 262 IPC_STRUCT_MEMBER(content::Referrer, referrer)
269 IPC_STRUCT_MEMBER(WindowOpenDisposition, disposition) 263 IPC_STRUCT_MEMBER(WindowOpenDisposition, disposition)
270 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) 264 IPC_STRUCT_MEMBER(bool, should_replace_current_entry)
271 IPC_STRUCT_MEMBER(bool, user_gesture) 265 IPC_STRUCT_MEMBER(bool, user_gesture)
272 IPC_STRUCT_END() 266 IPC_STRUCT_END()
273 267
274 // PlzNavigate 268 // PlzNavigate
275 IPC_STRUCT_BEGIN(FrameHostMsg_BeginNavigation_Params) 269 IPC_STRUCT_BEGIN(FrameHostMsg_BeginNavigation_Params)
270 // TODO(clamy): See if it is possible to define a common struct between this
271 // IPC and ResourceMsg_Request_Params.
272
276 // The request method: GET, POST, etc. 273 // The request method: GET, POST, etc.
277 IPC_STRUCT_MEMBER(std::string, method) 274 IPC_STRUCT_MEMBER(std::string, method)
278 275
279 // The requested URL.
280 IPC_STRUCT_MEMBER(GURL, url)
281
282 // The referrer to use (may be empty).
283 IPC_STRUCT_MEMBER(content::Referrer, referrer)
284
285 // Additional HTTP request headers. 276 // Additional HTTP request headers.
286 IPC_STRUCT_MEMBER(std::string, headers) 277 IPC_STRUCT_MEMBER(std::string, headers)
287 278
288 // net::URLRequest load flags (net::LOAD_NORMAL) by default). 279 // net::URLRequest load flags (net::LOAD_NORMAL) by default).
289 IPC_STRUCT_MEMBER(int, load_flags) 280 IPC_STRUCT_MEMBER(int, load_flags)
290 281
291 // Optional resource request body (may be null). 282 // Optional resource request body (may be null).
292 IPC_STRUCT_MEMBER(scoped_refptr<content::ResourceRequestBody>, 283 IPC_STRUCT_MEMBER(scoped_refptr<content::ResourceRequestBody>,
293 request_body) 284 request_body)
294 285
295 // True if the request was user initiated. 286 // True if the request was user initiated.
296 IPC_STRUCT_MEMBER(bool, has_user_gesture) 287 IPC_STRUCT_MEMBER(bool, has_user_gesture)
297
298 IPC_STRUCT_MEMBER(ui::PageTransition, transition_type)
299
300 // Whether this navigation should replace the current session history entry on
301 // commit.
302 IPC_STRUCT_MEMBER(bool, should_replace_current_entry)
303
304 // Whether or not we should allow the URL to download.
305 IPC_STRUCT_MEMBER(bool, allow_download)
306 IPC_STRUCT_END() 288 IPC_STRUCT_END()
307 289
308 #if defined(OS_MACOSX) || defined(OS_ANDROID) 290 #if defined(OS_MACOSX) || defined(OS_ANDROID)
309 // This message is used for supporting popup menus on Mac OS X and Android using 291 // This message is used for supporting popup menus on Mac OS X and Android using
310 // native controls. See the FrameHostMsg_ShowPopup message. 292 // native controls. See the FrameHostMsg_ShowPopup message.
311 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params) 293 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params)
312 // Position on the screen. 294 // Position on the screen.
313 IPC_STRUCT_MEMBER(gfx::Rect, bounds) 295 IPC_STRUCT_MEMBER(gfx::Rect, bounds)
314 296
315 // The height of each item in the menu. 297 // The height of each item in the menu.
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 std::vector<int> /* selected indices */) 453 std::vector<int> /* selected indices */)
472 454
473 #elif defined(OS_MACOSX) 455 #elif defined(OS_MACOSX)
474 456
475 // External popup menus. 457 // External popup menus.
476 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem, 458 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem,
477 int /* selected index, -1 means no selection */) 459 int /* selected index, -1 means no selection */)
478 460
479 #endif 461 #endif
480 462
463 // PlzNavigate
464 // Tells the renderer that a navigation is ready to commit. The renderer should
465 // request |stream_url| to get access to the stream containing the body of the
466 // response.
467 IPC_MESSAGE_ROUTED3(FrameMsg_CommitNavigation,
nasko 2014/09/24 22:42:15 How are we going to pass the response headers down
clamy 2014/09/26 17:22:32 I plan on adding another member to that IPC. If Da
nasko 2014/09/26 22:16:43 This goes along with the comment I made about Comm
468 GURL, /* stream_url */
469 content::CoreNavigationParams, /* core_params */
470 content::CommitNavigationParams /* commit_params */)
471
481 // ----------------------------------------------------------------------------- 472 // -----------------------------------------------------------------------------
482 // Messages sent from the renderer to the browser. 473 // Messages sent from the renderer to the browser.
483 474
484 // Blink and JavaScript error messages to log to the console 475 // Blink and JavaScript error messages to log to the console
485 // or debugger UI. 476 // or debugger UI.
486 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole, 477 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole,
487 int32, /* log level */ 478 int32, /* log level */
488 base::string16, /* msg */ 479 base::string16, /* msg */
489 int32, /* line number */ 480 int32, /* line number */
490 base::string16 /* source id */ ) 481 base::string16 /* source id */ )
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 size_t /* endOffset */) 730 size_t /* endOffset */)
740 731
741 // Notifies the browser that the renderer has a pending navigation transition. 732 // Notifies the browser that the renderer has a pending navigation transition.
742 // The string parameters are all UTF8. 733 // The string parameters are all UTF8.
743 IPC_MESSAGE_CONTROL4(FrameHostMsg_AddNavigationTransitionData, 734 IPC_MESSAGE_CONTROL4(FrameHostMsg_AddNavigationTransitionData,
744 int /* render_frame_id */, 735 int /* render_frame_id */,
745 std::string /* allowed_destination_host_pattern */, 736 std::string /* allowed_destination_host_pattern */,
746 std::string /* selector */, 737 std::string /* selector */,
747 std::string /* markup */) 738 std::string /* markup */)
748 739
740 // PlzNavigate
749 // Tells the browser to perform a navigation. 741 // Tells the browser to perform a navigation.
750 IPC_MESSAGE_ROUTED1(FrameHostMsg_BeginNavigation, 742 IPC_MESSAGE_ROUTED2(FrameHostMsg_BeginNavigation,
751 FrameHostMsg_BeginNavigation_Params) 743 FrameHostMsg_BeginNavigation_Params,
744 content::CoreNavigationParams)
752 745
753 // Sent once a paint happens after the first non empty layout. In other words 746 // Sent once a paint happens after the first non empty layout. In other words
754 // after the frame has painted something. 747 // after the frame has painted something.
755 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint) 748 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint)
756 749
757 #if defined(OS_MACOSX) || defined(OS_ANDROID) 750 #if defined(OS_MACOSX) || defined(OS_ANDROID)
758 751
759 // Message to show/hide a popup menu using native controls. 752 // Message to show/hide a popup menu using native controls.
760 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup, 753 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup,
761 FrameHostMsg_ShowPopup_Params) 754 FrameHostMsg_ShowPopup_Params)
762 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup) 755 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup)
763 756
764 #endif 757 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698