Chromium Code Reviews| Index: content/common/navigation_params.h |
| diff --git a/content/common/navigation_params.h b/content/common/navigation_params.h |
| index 9b3fccf4ab78e61b656a68d5e077f0c0a1611989..413c03cb30f3a9ec48069085b6031b1bb97d0f73 100644 |
| --- a/content/common/navigation_params.h |
| +++ b/content/common/navigation_params.h |
| @@ -21,12 +21,13 @@ class RefCountedMemory; |
| } |
| namespace content { |
| -class NavigationEntry; |
| // The following structures hold parameters used during a navigation. In |
| // particular they are used by FrameMsg_Navigate, FrameMsg_CommitNavigation and |
| // FrameHostMsg_BeginNavigation. |
| +// Provided by the browser or the renderer ------------------------------------- |
| + |
| // Used by all navigation IPCs. |
| struct CONTENT_EXPORT CommonNavigationParams { |
| CommonNavigationParams(); |
| @@ -76,7 +77,15 @@ struct CONTENT_EXPORT CommonNavigationParams { |
| GURL history_url_for_data_url; |
| }; |
| -// PlzNavigate: parameters needed to start a navigation on the IO thread. |
| +// Provided by the renderer ---------------------------------------------------- |
| +// |
| +// This struct holds parameters sent by the renderer to the browser. It is only |
| +// used in PlzNavigate (since in the current architecture, the renderer does not |
| +// inform the browser of navigations until they commit). |
| + |
| +// This struct is not used outside of the PlzNavigate project. |
| +// PlzNavigate: parameters needed to start a navigation on the IO thread, |
| +// following a renderer-initiated navigation request. |
| struct CONTENT_EXPORT BeginNavigationParams { |
| // TODO(clamy): See if it is possible to reuse this in |
| // ResourceMsg_Request_Params. |
| @@ -99,17 +108,72 @@ struct CONTENT_EXPORT BeginNavigationParams { |
| bool has_user_gesture; |
| }; |
| -// Used by FrameMsg_Navigate. |
| -// PlzNavigate: sent to the renderer when the navigation is ready to commit. |
| -struct CONTENT_EXPORT CommitNavigationParams { |
| - CommitNavigationParams(); |
| - CommitNavigationParams(bool is_overriding_user_agent, |
| - base::TimeTicks navigation_start, |
| - const std::vector<GURL>& redirects, |
| - bool can_load_local_resources, |
| - const std::string& frame_to_navigate, |
| - base::Time request_time); |
| - ~CommitNavigationParams(); |
| +// Provided by the browser ----------------------------------------------------- |
| +// |
| +// These structs are sent by the browser to the renderer to start/commit a |
| +// navigation depending on whether browser-side navigation is enabled. |
| +// Parameters used both in the current architecture and PlzNavigate should be |
| +// put in RequestNavigationParams. Parameters only used by the current |
| +// architecture should go in StartNavigationParams. |
| + |
| +// Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to |
| +// start a browser-initiated navigation besides those in CommonNavigationParams. |
| +// The difference with the RequestNavigationParams below is that they are only |
| +// used in the current architecture of navigation, and will not be used by |
| +// PlzNavigate. |
| +// PlzNavigate: These are not used. |
| +struct CONTENT_EXPORT StartNavigationParams { |
| + StartNavigationParams(); |
| + StartNavigationParams( |
| + bool is_post, |
| + const std::string& extra_headers, |
| + const std::vector<unsigned char>& browser_initiated_post_data, |
| + bool should_replace_current_entry, |
| + int transferred_request_child_id, |
| + int transferred_request_request_id); |
| + ~StartNavigationParams(); |
| + |
| + // Whether the navigation is a POST request (as opposed to a GET). |
| + bool is_post; |
| + |
| + // Extra headers (separated by \n) to send during the request. |
| + std::string extra_headers; |
| + |
| + // If is_post is true, holds the post_data information from browser. Empty |
| + // otherwise. |
| + std::vector<unsigned char> browser_initiated_post_data; |
| + |
| + // 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. |
| + bool should_replace_current_entry; |
| + |
| + // 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. |
| + // Unless this refers to a transferred navigation, these values are -1 and -1. |
| + int transferred_request_child_id; |
| + int transferred_request_request_id; |
| +}; |
| + |
| +// Used by FrameMsg_Navigate. Holds the parameters needed by the renderer to |
| +// start a browser-initiated navigation besides those in CommonNavigationParams. |
| +// PlzNavigate: sent to the renderer to commit a navigation. |
|
Charlie Reis
2015/03/20 21:07:34
Please change this last sentence to:
PlzNavigate:
clamy
2015/03/24 13:33:38
Done.
|
| +struct CONTENT_EXPORT RequestNavigationParams { |
| + RequestNavigationParams(); |
| + RequestNavigationParams(bool is_overriding_user_agent, |
| + base::TimeTicks navigation_start, |
| + const std::vector<GURL>& redirects, |
| + bool can_load_local_resources, |
| + const std::string& frame_to_navigate, |
| + base::Time request_time, |
| + const PageState& page_state, |
| + int32 page_id, |
| + int pending_history_list_offset, |
| + int current_history_list_offset, |
| + int current_history_list_length, |
| + bool should_clear_history_list); |
| + ~RequestNavigationParams(); |
| // Whether or not the user agent override string should be used. |
| bool is_overriding_user_agent; |
| @@ -132,19 +196,6 @@ struct CONTENT_EXPORT CommitNavigationParams { |
| // infrastructure to set up DocumentState associated with the RenderView. |
| // TODO(ppi): make it go away. |
| base::Time request_time; |
| -}; |
| - |
| -// Used by FrameMsg_Navigate. |
| -// PlzNavigate: sent to the renderer when the navigation is ready to commit. |
| -struct CONTENT_EXPORT HistoryNavigationParams { |
| - HistoryNavigationParams(); |
| - HistoryNavigationParams(const PageState& page_state, |
| - int32 page_id, |
| - int pending_history_list_offset, |
| - int current_history_list_offset, |
| - int current_history_list_length, |
| - bool should_clear_history_list); |
| - ~HistoryNavigationParams(); |
| // Opaque history state (received by ViewHostMsg_UpdateState). |
| PageState page_state; |
| @@ -170,54 +221,19 @@ struct CONTENT_EXPORT HistoryNavigationParams { |
| bool should_clear_history_list; |
| }; |
| -// Parameters needed at the start of a navigation. Used by FrameMsg_Navigate. |
| -// PlzNavigate: these parameters are not used in navigation. |
| -struct CONTENT_EXPORT StartNavigationParams { |
| - StartNavigationParams(); |
| - StartNavigationParams( |
| - bool is_post, |
| - const std::string& extra_headers, |
| - const std::vector<unsigned char>& browser_initiated_post_data, |
| - bool should_replace_current_entry, |
| - int transferred_request_child_id, |
| - int transferred_request_request_id); |
| - ~StartNavigationParams(); |
| - |
| - // Whether the navigation is a POST request (as opposed to a GET). |
| - bool is_post; |
| - |
| - // Extra headers (separated by \n) to send during the request. |
| - std::string extra_headers; |
| - |
| - // If is_post is true, holds the post_data information from browser. Empty |
| - // otherwise. |
| - std::vector<unsigned char> browser_initiated_post_data; |
| - |
| - // 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. |
| - bool should_replace_current_entry; |
| - |
| - // 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. |
| - // Unless this refers to a transferred navigation, these values are -1 and -1. |
| - int transferred_request_child_id; |
| - int transferred_request_request_id; |
| -}; |
| - |
| +// Helper struct keeping track in one place of all the parameters the browser |
| +// needs to provide to the renderer. |
| struct NavigationParams { |
| NavigationParams(const CommonNavigationParams& common_params, |
| const StartNavigationParams& start_params, |
| - const CommitNavigationParams& commit_params, |
| - const HistoryNavigationParams& history_params); |
| + const RequestNavigationParams& request_params); |
| ~NavigationParams(); |
| CommonNavigationParams common_params; |
| StartNavigationParams start_params; |
| - CommitNavigationParams commit_params; |
| - HistoryNavigationParams history_params; |
| + RequestNavigationParams request_params; |
| }; |
| + |
| } // namespace content |
| #endif // CONTENT_COMMON_NAVIGATION_PARAMS_H_ |