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

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: Using non-inherited structs 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_id)
189 IPC_STRUCT_TRAITS_MEMBER(should_clear_history_list)
190 IPC_STRUCT_TRAITS_MEMBER(pending_history_list_offset)
191 IPC_STRUCT_TRAITS_MEMBER(current_history_list_offset)
192 IPC_STRUCT_TRAITS_MEMBER(current_history_list_length)
193 IPC_STRUCT_TRAITS_MEMBER(page_state)
194 IPC_STRUCT_TRAITS_MEMBER(is_overriding_user_agent)
195 IPC_STRUCT_TRAITS_MEMBER(browser_navigation_start)
196 IPC_STRUCT_TRAITS_END()
197
172 IPC_STRUCT_BEGIN(FrameMsg_Navigate_Params) 198 IPC_STRUCT_BEGIN(FrameMsg_Navigate_Params)
173 // The page_id for this navigation, or -1 if it is a new navigation. Back, 199 // TODO(clamy): investigate which parameters are also needed in PlzNavigate
174 // Forward, and Reload navigations should have a valid page_id. If the load 200 // and move them to the appropriate NavigationParams struct.
175 // succeeds, then this page_id will be reflected in the resultant
176 // FrameHostMsg_DidCommitProvisionalLoad message.
177 IPC_STRUCT_MEMBER(int32, page_id)
178 201
179 // If page_id is -1, then pending_history_list_offset will also be -1. 202 // These structs contain parameters shared by other navigation IPCs.
180 // Otherwise, it contains the offset into the history list corresponding to 203 IPC_STRUCT_MEMBER(content::CoreNavigationParams, core_params)
181 // the current navigation. 204 IPC_STRUCT_MEMBER(content::RequestNavigationParams, request_params)
182 IPC_STRUCT_MEMBER(int, pending_history_list_offset) 205 IPC_STRUCT_MEMBER(content::CommitNavigationParams, commit_params)
183
184 // Informs the RenderView of where its current page contents reside in
185 // session history and the total size of the session history list.
186 IPC_STRUCT_MEMBER(int, current_history_list_offset)
187 IPC_STRUCT_MEMBER(int, current_history_list_length)
188
189 // Informs the RenderView the session history should be cleared. In that
190 // case, the RenderView needs to notify the browser that the clearing was
191 // succesful when the navigation commits.
192 IPC_STRUCT_MEMBER(bool, should_clear_history_list)
193
194 // The URL to load.
195 IPC_STRUCT_MEMBER(GURL, url)
196 206
197 // Base URL for use in WebKit's SubstituteData. 207 // Base URL for use in WebKit's SubstituteData.
198 // Is only used with data: URLs. 208 // Is only used with data: URLs.
199 IPC_STRUCT_MEMBER(GURL, base_url_for_data_url) 209 IPC_STRUCT_MEMBER(GURL, base_url_for_data_url)
200 210
201 // History URL for use in WebKit's SubstituteData. 211 // History URL for use in WebKit's SubstituteData.
202 // Is only used with data: URLs. 212 // Is only used with data: URLs.
203 IPC_STRUCT_MEMBER(GURL, history_url_for_data_url) 213 IPC_STRUCT_MEMBER(GURL, history_url_for_data_url)
204 214
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 215 // Any redirect URLs that occurred before |url|. Useful for cross-process
210 // navigations; defaults to empty. 216 // navigations; defaults to empty.
211 IPC_STRUCT_MEMBER(std::vector<GURL>, redirects) 217 IPC_STRUCT_MEMBER(std::vector<GURL>, redirects)
212 218
213 // The type of transition.
214 IPC_STRUCT_MEMBER(content::PageTransition, transition)
215
216 // Informs the RenderView the pending navigation should replace the current 219 // Informs the RenderView the pending navigation should replace the current
217 // history entry when it commits. This is used for cross-process redirects so 220 // history entry when it commits. This is used for cross-process redirects so
218 // the transferred navigation can recover the navigation state. 221 // the transferred navigation can recover the navigation state.
219 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) 222 IPC_STRUCT_MEMBER(bool, should_replace_current_entry)
220 223
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 224 // The time the request was created. This is used by the old performance
228 // infrastructure to set up DocumentState associated with the RenderView. 225 // infrastructure to set up DocumentState associated with the RenderView.
229 // TODO(ppi): make it go away. 226 // TODO(ppi): make it go away.
230 IPC_STRUCT_MEMBER(base::Time, request_time) 227 IPC_STRUCT_MEMBER(base::Time, request_time)
231 228
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 229 // The following two members identify a previous request that has been
236 // created before this navigation is being transferred to a new render view. 230 // created before this navigation is being transferred to a new render view.
237 // This serves the purpose of recycling the old request. 231 // This serves the purpose of recycling the old request.
238 // Unless this refers to a transferred navigation, these values are -1 and -1. 232 // Unless this refers to a transferred navigation, these values are -1 and -1.
239 IPC_STRUCT_MEMBER(int, transferred_request_child_id) 233 IPC_STRUCT_MEMBER(int, transferred_request_child_id)
240 IPC_STRUCT_MEMBER(int, transferred_request_request_id) 234 IPC_STRUCT_MEMBER(int, transferred_request_request_id)
241 235
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:// 236 // Whether or not this url should be allowed to access local file://
256 // resources. 237 // resources.
257 IPC_STRUCT_MEMBER(bool, can_load_local_resources) 238 IPC_STRUCT_MEMBER(bool, can_load_local_resources)
258 239
259 // If not empty, which frame to navigate. 240 // If not empty, which frame to navigate.
260 IPC_STRUCT_MEMBER(std::string, frame_to_navigate) 241 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() 242 IPC_STRUCT_END()
265 243
266 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params) 244 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params)
267 IPC_STRUCT_MEMBER(GURL, url) 245 IPC_STRUCT_MEMBER(GURL, url)
268 IPC_STRUCT_MEMBER(content::Referrer, referrer) 246 IPC_STRUCT_MEMBER(content::Referrer, referrer)
269 IPC_STRUCT_MEMBER(WindowOpenDisposition, disposition) 247 IPC_STRUCT_MEMBER(WindowOpenDisposition, disposition)
270 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) 248 IPC_STRUCT_MEMBER(bool, should_replace_current_entry)
271 IPC_STRUCT_MEMBER(bool, user_gesture) 249 IPC_STRUCT_MEMBER(bool, user_gesture)
272 IPC_STRUCT_END() 250 IPC_STRUCT_END()
273 251
274 // PlzNavigate 252 // PlzNavigate
275 IPC_STRUCT_BEGIN(FrameHostMsg_BeginNavigation_Params) 253 IPC_STRUCT_BEGIN(FrameHostMsg_BeginNavigation_Params)
254 // TODO(clamy): See if it possible to define acommon struct between this IPC
Charlie Reis 2014/09/19 23:12:32 nits: it is, a common
clamy 2014/09/23 21:13:26 Done.
255 // and ResourceMsg_Request_Params.
256
276 // The request method: GET, POST, etc. 257 // The request method: GET, POST, etc.
277 IPC_STRUCT_MEMBER(std::string, method) 258 IPC_STRUCT_MEMBER(std::string, method)
278 259
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. 260 // Additional HTTP request headers.
286 IPC_STRUCT_MEMBER(std::string, headers) 261 IPC_STRUCT_MEMBER(std::string, headers)
287 262
288 // net::URLRequest load flags (net::LOAD_NORMAL) by default). 263 // net::URLRequest load flags (net::LOAD_NORMAL) by default).
289 IPC_STRUCT_MEMBER(int, load_flags) 264 IPC_STRUCT_MEMBER(int, load_flags)
290 265
291 // Optional resource request body (may be null). 266 // Optional resource request body (may be null).
292 IPC_STRUCT_MEMBER(scoped_refptr<content::ResourceRequestBody>, 267 IPC_STRUCT_MEMBER(scoped_refptr<content::ResourceRequestBody>,
293 request_body) 268 request_body)
294 269
295 // True if the request was user initiated. 270 // True if the request was user initiated.
296 IPC_STRUCT_MEMBER(bool, has_user_gesture) 271 IPC_STRUCT_MEMBER(bool, has_user_gesture)
297
298 IPC_STRUCT_MEMBER(content::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() 272 IPC_STRUCT_END()
307 273
308 #if defined(OS_MACOSX) || defined(OS_ANDROID) 274 #if defined(OS_MACOSX) || defined(OS_ANDROID)
309 // This message is used for supporting popup menus on Mac OS X and Android using 275 // This message is used for supporting popup menus on Mac OS X and Android using
310 // native controls. See the FrameHostMsg_ShowPopup message. 276 // native controls. See the FrameHostMsg_ShowPopup message.
311 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params) 277 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params)
312 // Position on the screen. 278 // Position on the screen.
313 IPC_STRUCT_MEMBER(gfx::Rect, bounds) 279 IPC_STRUCT_MEMBER(gfx::Rect, bounds)
314 280
315 // The height of each item in the menu. 281 // The height of each item in the menu.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 // |routing_id|. The new proxy should be created as a child of the object 348 // |routing_id|. The new proxy should be created as a child of the object
383 // identified by |parent_routing_id| or as top level if that is 349 // identified by |parent_routing_id| or as top level if that is
384 // MSG_ROUTING_NONE. 350 // MSG_ROUTING_NONE.
385 IPC_MESSAGE_CONTROL3(FrameMsg_NewFrameProxy, 351 IPC_MESSAGE_CONTROL3(FrameMsg_NewFrameProxy,
386 int /* routing_id */, 352 int /* routing_id */,
387 int /* parent_routing_id */, 353 int /* parent_routing_id */,
388 int /* render_view_routing_id */) 354 int /* render_view_routing_id */)
389 355
390 // Tells the renderer to perform the specified navigation, interrupting any 356 // Tells the renderer to perform the specified navigation, interrupting any
391 // existing navigation. 357 // existing navigation.
392 IPC_MESSAGE_ROUTED1(FrameMsg_Navigate, FrameMsg_Navigate_Params) 358 IPC_MESSAGE_ROUTED1(FrameMsg_Navigate , FrameMsg_Navigate_Params)
nasko 2014/09/22 23:13:03 nit: extra space before the comma
clamy 2014/09/23 21:13:26 Done.
393 359
394 // Instructs the renderer to invoke the frame's beforeunload event handler. 360 // Instructs the renderer to invoke the frame's beforeunload event handler.
395 // Expects the result to be returned via FrameHostMsg_BeforeUnload_ACK. 361 // Expects the result to be returned via FrameHostMsg_BeforeUnload_ACK.
396 IPC_MESSAGE_ROUTED0(FrameMsg_BeforeUnload) 362 IPC_MESSAGE_ROUTED0(FrameMsg_BeforeUnload)
397 363
398 // Instructs the frame to swap out for a cross-site transition, including 364 // Instructs the frame to swap out for a cross-site transition, including
399 // running the unload event handler and creating a RenderFrameProxy with the 365 // running the unload event handler and creating a RenderFrameProxy with the
400 // given |proxy_routing_id|. Expects a SwapOut_ACK message when finished. 366 // given |proxy_routing_id|. Expects a SwapOut_ACK message when finished.
401 IPC_MESSAGE_ROUTED1(FrameMsg_SwapOut, 367 IPC_MESSAGE_ROUTED1(FrameMsg_SwapOut,
402 int /* proxy_routing_id */) 368 int /* proxy_routing_id */)
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 std::vector<int> /* selected indices */) 447 std::vector<int> /* selected indices */)
482 448
483 #elif defined(OS_MACOSX) 449 #elif defined(OS_MACOSX)
484 450
485 // External popup menus. 451 // External popup menus.
486 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem, 452 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem,
487 int /* selected index, -1 means no selection */) 453 int /* selected index, -1 means no selection */)
488 454
489 #endif 455 #endif
490 456
457 // PlzNavigate
458 // Tells the renderer that a navigation is ready to commit.
459 // The renderer should request the url to get access to the stream containing
Charlie Reis 2014/09/19 23:12:32 should request |stream_url| to get
clamy 2014/09/23 21:13:26 Done.
460 // the body of the response.
461 IPC_MESSAGE_ROUTED3(FrameMsg_CommitNavigation,
462 GURL,
Charlie Reis 2014/09/19 23:12:32 Please name these params, as in the other messages
clamy 2014/09/23 21:13:26 Done.
463 content::CoreNavigationParams,
464 content::CommitNavigationParams)
465
491 // ----------------------------------------------------------------------------- 466 // -----------------------------------------------------------------------------
492 // Messages sent from the renderer to the browser. 467 // Messages sent from the renderer to the browser.
493 468
494 // Blink and JavaScript error messages to log to the console 469 // Blink and JavaScript error messages to log to the console
495 // or debugger UI. 470 // or debugger UI.
496 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole, 471 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole,
497 int32, /* log level */ 472 int32, /* log level */
498 base::string16, /* msg */ 473 base::string16, /* msg */
499 int32, /* line number */ 474 int32, /* line number */
500 base::string16 /* source id */ ) 475 base::string16 /* source id */ )
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 size_t /* endOffset */) 732 size_t /* endOffset */)
758 733
759 // Notifies the browser that the renderer has a pending navigation transition. 734 // Notifies the browser that the renderer has a pending navigation transition.
760 // The string parameters are all UTF8. 735 // The string parameters are all UTF8.
761 IPC_MESSAGE_CONTROL4(FrameHostMsg_AddNavigationTransitionData, 736 IPC_MESSAGE_CONTROL4(FrameHostMsg_AddNavigationTransitionData,
762 int /* render_frame_id */, 737 int /* render_frame_id */,
763 std::string /* allowed_destination_host_pattern */, 738 std::string /* allowed_destination_host_pattern */,
764 std::string /* selector */, 739 std::string /* selector */,
765 std::string /* markup */) 740 std::string /* markup */)
766 741
742 // PlzNavigate
767 // Tells the browser to perform a navigation. 743 // Tells the browser to perform a navigation.
768 IPC_MESSAGE_ROUTED1(FrameHostMsg_BeginNavigation, 744 IPC_MESSAGE_ROUTED2(FrameHostMsg_BeginNavigation,
769 FrameHostMsg_BeginNavigation_Params) 745 FrameHostMsg_BeginNavigation_Params,
746 content::CoreNavigationParams)
770 747
771 // Sent once a paint happens after the first non empty layout. In other words 748 // Sent once a paint happens after the first non empty layout. In other words
772 // after the frame has painted something. 749 // after the frame has painted something.
773 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint) 750 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint)
774 751
775 #if defined(OS_MACOSX) || defined(OS_ANDROID) 752 #if defined(OS_MACOSX) || defined(OS_ANDROID)
776 753
777 // Message to show/hide a popup menu using native controls. 754 // Message to show/hide a popup menu using native controls.
778 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup, 755 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup,
779 FrameHostMsg_ShowPopup_Params) 756 FrameHostMsg_ShowPopup_Params)
780 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup) 757 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup)
781 758
782 #endif 759 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698