diff options
Diffstat (limited to 'content/common')
-rw-r--r-- | content/common/frame_message_enums.h | 40 | ||||
-rw-r--r-- | content/common/frame_messages.h | 99 | ||||
-rw-r--r-- | content/common/view_message_enums.h | 27 | ||||
-rw-r--r-- | content/common/view_messages.h | 97 |
4 files changed, 139 insertions, 124 deletions
diff --git a/content/common/frame_message_enums.h b/content/common/frame_message_enums.h new file mode 100644 index 0000000..d2f9d8a --- /dev/null +++ b/content/common/frame_message_enums.h @@ -0,0 +1,40 @@ +// Copyright 2014 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CONTENT_COMMON_FRAME_MESSAGES_ENUMS_H_ +#define CONTENT_COMMON_FRAME_MESSAGES_ENUMS_H_ + +#include "ipc/ipc_message_macros.h" + +struct FrameMsg_Navigate_Type { + public: + enum Value { + // Reload the page. + RELOAD, + + // Reload the page, ignoring any cache entries. + RELOAD_IGNORING_CACHE, + + // Reload the page using the original request URL. + RELOAD_ORIGINAL_REQUEST_URL, + + // The navigation is the result of session restore and should honor the + // page's cache policy while restoring form state. This is set to true if + // restoring a tab/session from the previous session and the previous + // session did not crash. If this is not set and the page was restored then + // the page's cache policy is ignored and we load from the cache. + RESTORE, + + // Like RESTORE, except that the navigation contains POST data. + RESTORE_WITH_POST, + + // Navigation type not categorized by the other types. + NORMAL, + + // Last guard value, so we can use it for validity checks. + NAVIGATE_TYPE_LAST = NORMAL, + }; +}; + +#endif // CONTENT_COMMON_FRAME_MESSAGES_ENUMS_H_ diff --git a/content/common/frame_messages.h b/content/common/frame_messages.h index f292d3c..0347170 100644 --- a/content/common/frame_messages.h +++ b/content/common/frame_messages.h @@ -7,6 +7,7 @@ #include "content/common/content_export.h" #include "content/common/content_param_traits.h" +#include "content/common/frame_message_enums.h" #include "content/common/frame_param.h" #include "content/common/navigation_gesture.h" #include "content/public/common/common_param_traits.h" @@ -21,6 +22,8 @@ #define IPC_MESSAGE_START FrameMsgStart +IPC_ENUM_TRAITS_MAX_VALUE(FrameMsg_Navigate_Type::Value, + FrameMsg_Navigate_Type::NAVIGATE_TYPE_LAST) IPC_ENUM_TRAITS_MAX_VALUE(blink::WebContextMenuData::MediaType, blink::WebContextMenuData::MediaTypeLast) @@ -154,6 +157,98 @@ IPC_STRUCT_BEGIN_WITH_PARENT(FrameHostMsg_DidCommitProvisionalLoad_Params, IPC_STRUCT_MEMBER(bool, history_list_was_cleared) IPC_STRUCT_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) + + // Base URL for use in WebKit's SubstituteData. + // Is only used with data: URLs. + IPC_STRUCT_MEMBER(GURL, base_url_for_data_url) + + // History URL for use in WebKit's SubstituteData. + // 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 + 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. + // Unless this refers to a transferred navigation, these values are -1 and -1. + 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 to JS for this navigation. + IPC_STRUCT_MEMBER(base::TimeTicks, browser_navigation_start) +IPC_STRUCT_END() + // ----------------------------------------------------------------------------- // Messages sent from the browser to the renderer. @@ -190,6 +285,10 @@ IPC_MESSAGE_ROUTED2(FrameMsg_CustomContextMenuAction, content::CustomContextMenuContext /* custom_context */, unsigned /* action */) +// Tells the renderer to perform the specified navigation, interrupting any +// existing navigation. +IPC_MESSAGE_ROUTED1(FrameMsg_Navigate, FrameMsg_Navigate_Params) + // ----------------------------------------------------------------------------- // Messages sent from the renderer to the browser. diff --git a/content/common/view_message_enums.h b/content/common/view_message_enums.h index eb75de5..c45d5bf 100644 --- a/content/common/view_message_enums.h +++ b/content/common/view_message_enums.h @@ -26,33 +26,6 @@ struct ViewHostMsg_UpdateRect_Flags { } }; -struct ViewMsg_Navigate_Type { - public: - enum Value { - // Reload the page. - RELOAD, - - // Reload the page, ignoring any cache entries. - RELOAD_IGNORING_CACHE, - - // Reload the page using the original request URL. - RELOAD_ORIGINAL_REQUEST_URL, - - // The navigation is the result of session restore and should honor the - // page's cache policy while restoring form state. This is set to true if - // restoring a tab/session from the previous session and the previous - // session did not crash. If this is not set and the page was restored then - // the page's cache policy is ignored and we load from the cache. - RESTORE, - - // Like RESTORE, except that the navigation contains POST data. - RESTORE_WITH_POST, - - // Navigation type not categorized by the other types. - NORMAL - }; -}; - enum AccessibilityModeFlag { // Accessibility updates are processed to create platform trees and events are // passed to platform APIs in the browser. diff --git a/content/common/view_messages.h b/content/common/view_messages.h index 1e81893..00befab 100644 --- a/content/common/view_messages.h +++ b/content/common/view_messages.h @@ -71,7 +71,6 @@ #define IPC_MESSAGE_START ViewMsgStart IPC_ENUM_TRAITS(AccessibilityMode) -IPC_ENUM_TRAITS(ViewMsg_Navigate_Type::Value) IPC_ENUM_TRAITS(blink::WebMediaPlayerAction::Type) IPC_ENUM_TRAITS(blink::WebPluginAction::Type) IPC_ENUM_TRAITS(blink::WebPopupType) @@ -478,98 +477,6 @@ IPC_STRUCT_BEGIN(ViewHostMsg_UpdateRect_Params) IPC_STRUCT_MEMBER(std::vector<ui::LatencyInfo>, latency_info) IPC_STRUCT_END() -IPC_STRUCT_BEGIN(ViewMsg_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) - - // Base URL for use in WebKit's SubstituteData. - // Is only used with data: URLs. - IPC_STRUCT_MEMBER(GURL, base_url_for_data_url) - - // History URL for use in WebKit's SubstituteData. - // 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(ViewMsg_Navigate_Type::Value, navigation_type) - - // The time the request was created - 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. - // Unless this refers to a transferred navigation, these values are -1 and -1. - 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 to JS for this navigation. - IPC_STRUCT_MEMBER(base::TimeTicks, browser_navigation_start) -IPC_STRUCT_END() - IPC_STRUCT_BEGIN(ViewMsg_New_Params) // Renderer-wide preferences. IPC_STRUCT_MEMBER(content::RendererPreferences, renderer_preferences) @@ -775,10 +682,6 @@ IPC_MESSAGE_ROUTED1(ViewMsg_SetInitialFocus, IPC_MESSAGE_ROUTED1(ViewMsg_ShowContextMenu, gfx::Point /* location where menu should be shown */) -// Tells the renderer to perform the specified navigation, interrupting any -// existing navigation. -IPC_MESSAGE_ROUTED1(ViewMsg_Navigate, ViewMsg_Navigate_Params) - IPC_MESSAGE_ROUTED0(ViewMsg_Stop) // Tells the renderer to reload the current focused frame |