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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: content/common/frame_messages.h
diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h
index aa9bd3f5bd2d38f6a49cd9f019b2c897b635c1c6..48673dff1c11deef9982aca7fe4823dd50f658dd 100644
--- a/content/common/frame_messages.h
+++ b/content/common/frame_messages.h
@@ -10,6 +10,7 @@
#include "content/common/frame_message_enums.h"
#include "content/common/frame_param.h"
#include "content/common/navigation_gesture.h"
+#include "content/common/navigation_params.h"
#include "content/common/resource_request_body.h"
#include "content/public/common/color_suggestion.h"
#include "content/public/common/common_param_traits.h"
@@ -169,30 +170,39 @@ IPC_STRUCT_BEGIN_WITH_PARENT(FrameHostMsg_DidCommitProvisionalLoad_Params,
IPC_STRUCT_MEMBER(int, render_view_routing_id)
IPC_STRUCT_END()
+IPC_STRUCT_TRAITS_BEGIN(content::CoreNavigationParams)
+ IPC_STRUCT_TRAITS_MEMBER(url)
+ IPC_STRUCT_TRAITS_MEMBER(referrer)
+ IPC_STRUCT_TRAITS_MEMBER(transition)
+ IPC_STRUCT_TRAITS_MEMBER(navigation_type)
+ IPC_STRUCT_TRAITS_MEMBER(allow_download)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(content::RequestNavigationParams)
+ IPC_STRUCT_TRAITS_MEMBER(is_post)
+ IPC_STRUCT_TRAITS_MEMBER(extra_headers)
+ IPC_STRUCT_TRAITS_MEMBER(browser_initiated_post_data)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(content::CommitNavigationParams)
+ IPC_STRUCT_TRAITS_MEMBER(page_id)
+ IPC_STRUCT_TRAITS_MEMBER(should_clear_history_list)
+ IPC_STRUCT_TRAITS_MEMBER(pending_history_list_offset)
+ IPC_STRUCT_TRAITS_MEMBER(current_history_list_offset)
+ IPC_STRUCT_TRAITS_MEMBER(current_history_list_length)
+ IPC_STRUCT_TRAITS_MEMBER(page_state)
+ IPC_STRUCT_TRAITS_MEMBER(is_overriding_user_agent)
+ IPC_STRUCT_TRAITS_MEMBER(browser_navigation_start)
+IPC_STRUCT_TRAITS_END()
+
IPC_STRUCT_BEGIN(FrameMsg_Navigate_Params)
- // The page_id for this navigation, or -1 if it is a new navigation. Back,
- // Forward, and Reload navigations should have a valid page_id. If the load
- // succeeds, then this page_id will be reflected in the resultant
- // FrameHostMsg_DidCommitProvisionalLoad message.
- IPC_STRUCT_MEMBER(int32, page_id)
-
- // If page_id is -1, then pending_history_list_offset will also be -1.
- // Otherwise, it contains the offset into the history list corresponding to
- // the current navigation.
- IPC_STRUCT_MEMBER(int, pending_history_list_offset)
-
- // Informs the RenderView of where its current page contents reside in
- // session history and the total size of the session history list.
- IPC_STRUCT_MEMBER(int, current_history_list_offset)
- IPC_STRUCT_MEMBER(int, current_history_list_length)
-
- // Informs the RenderView the session history should be cleared. In that
- // case, the RenderView needs to notify the browser that the clearing was
- // succesful when the navigation commits.
- IPC_STRUCT_MEMBER(bool, should_clear_history_list)
-
- // The URL to load.
- IPC_STRUCT_MEMBER(GURL, url)
+ // TODO(clamy): investigate which parameters are also needed in PlzNavigate
+ // and move them to the appropriate NavigationParams struct.
+
+ // These structs contain parameters shared by other navigation IPCs.
+ IPC_STRUCT_MEMBER(content::CoreNavigationParams, core_params)
+ IPC_STRUCT_MEMBER(content::RequestNavigationParams, request_params)
+ IPC_STRUCT_MEMBER(content::CommitNavigationParams, commit_params)
// Base URL for use in WebKit's SubstituteData.
// Is only used with data: URLs.
@@ -202,36 +212,20 @@ IPC_STRUCT_BEGIN(FrameMsg_Navigate_Params)
// Is only used with data: URLs.
IPC_STRUCT_MEMBER(GURL, history_url_for_data_url)
- // The URL to send in the "Referer" header field. Can be empty if there is
- // no referrer.
- IPC_STRUCT_MEMBER(content::Referrer, referrer)
-
// Any redirect URLs that occurred before |url|. Useful for cross-process
// navigations; defaults to empty.
IPC_STRUCT_MEMBER(std::vector<GURL>, redirects)
- // The type of transition.
- IPC_STRUCT_MEMBER(content::PageTransition, transition)
-
// Informs the RenderView the pending navigation should replace the current
// history entry when it commits. This is used for cross-process redirects so
// the transferred navigation can recover the navigation state.
IPC_STRUCT_MEMBER(bool, should_replace_current_entry)
- // Opaque history state (received by ViewHostMsg_UpdateState).
- IPC_STRUCT_MEMBER(content::PageState, page_state)
-
- // Type of navigation.
- IPC_STRUCT_MEMBER(FrameMsg_Navigate_Type::Value, navigation_type)
-
// The time the request was created. This is used by the old performance
// infrastructure to set up DocumentState associated with the RenderView.
// TODO(ppi): make it go away.
IPC_STRUCT_MEMBER(base::Time, request_time)
- // Extra headers (separated by \n) to send during the request.
- IPC_STRUCT_MEMBER(std::string, extra_headers)
-
// The following two members identify a previous request that has been
// created before this navigation is being transferred to a new render view.
// This serves the purpose of recycling the old request.
@@ -239,28 +233,12 @@ IPC_STRUCT_BEGIN(FrameMsg_Navigate_Params)
IPC_STRUCT_MEMBER(int, transferred_request_child_id)
IPC_STRUCT_MEMBER(int, transferred_request_request_id)
- // Whether or not we should allow the url to download.
- IPC_STRUCT_MEMBER(bool, allow_download)
-
- // Whether or not the user agent override string should be used.
- IPC_STRUCT_MEMBER(bool, is_overriding_user_agent)
-
- // True if this was a post request.
- IPC_STRUCT_MEMBER(bool, is_post)
-
- // If is_post is true, holds the post_data information from browser. Empty
- // otherwise.
- IPC_STRUCT_MEMBER(std::vector<unsigned char>, browser_initiated_post_data)
-
// Whether or not this url should be allowed to access local file://
// resources.
IPC_STRUCT_MEMBER(bool, can_load_local_resources)
// If not empty, which frame to navigate.
IPC_STRUCT_MEMBER(std::string, frame_to_navigate)
-
- // The navigationStart time to expose through the Navigation Timing API to JS.
- IPC_STRUCT_MEMBER(base::TimeTicks, browser_navigation_start)
IPC_STRUCT_END()
IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params)
@@ -273,15 +251,12 @@ IPC_STRUCT_END()
// PlzNavigate
IPC_STRUCT_BEGIN(FrameHostMsg_BeginNavigation_Params)
+ // 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.
+ // and ResourceMsg_Request_Params.
+
// The request method: GET, POST, etc.
IPC_STRUCT_MEMBER(std::string, method)
- // The requested URL.
- IPC_STRUCT_MEMBER(GURL, url)
-
- // The referrer to use (may be empty).
- IPC_STRUCT_MEMBER(content::Referrer, referrer)
-
// Additional HTTP request headers.
IPC_STRUCT_MEMBER(std::string, headers)
@@ -294,15 +269,6 @@ IPC_STRUCT_BEGIN(FrameHostMsg_BeginNavigation_Params)
// True if the request was user initiated.
IPC_STRUCT_MEMBER(bool, has_user_gesture)
-
- IPC_STRUCT_MEMBER(content::PageTransition, transition_type)
-
- // Whether this navigation should replace the current session history entry on
- // commit.
- IPC_STRUCT_MEMBER(bool, should_replace_current_entry)
-
- // Whether or not we should allow the URL to download.
- IPC_STRUCT_MEMBER(bool, allow_download)
IPC_STRUCT_END()
#if defined(OS_MACOSX) || defined(OS_ANDROID)
@@ -389,7 +355,7 @@ IPC_MESSAGE_CONTROL3(FrameMsg_NewFrameProxy,
// Tells the renderer to perform the specified navigation, interrupting any
// existing navigation.
-IPC_MESSAGE_ROUTED1(FrameMsg_Navigate, FrameMsg_Navigate_Params)
+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.
// Instructs the renderer to invoke the frame's beforeunload event handler.
// Expects the result to be returned via FrameHostMsg_BeforeUnload_ACK.
@@ -488,6 +454,15 @@ IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem,
#endif
+// PlzNavigate
+// Tells the renderer that a navigation is ready to commit.
+// 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.
+// the body of the response.
+IPC_MESSAGE_ROUTED3(FrameMsg_CommitNavigation,
+ 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.
+ content::CoreNavigationParams,
+ content::CommitNavigationParams)
+
// -----------------------------------------------------------------------------
// Messages sent from the renderer to the browser.
@@ -764,9 +739,11 @@ IPC_MESSAGE_CONTROL4(FrameHostMsg_AddNavigationTransitionData,
std::string /* selector */,
std::string /* markup */)
+// PlzNavigate
// Tells the browser to perform a navigation.
-IPC_MESSAGE_ROUTED1(FrameHostMsg_BeginNavigation,
- FrameHostMsg_BeginNavigation_Params)
+IPC_MESSAGE_ROUTED2(FrameHostMsg_BeginNavigation,
+ FrameHostMsg_BeginNavigation_Params,
+ content::CoreNavigationParams)
// Sent once a paint happens after the first non empty layout. In other words
// after the frame has painted something.

Powered by Google App Engine
This is Rietveld 408576698