OLD | NEW |
---|---|
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 IPC_STRUCT_TRAITS_MEMBER(referrer_policy) | 74 IPC_STRUCT_TRAITS_MEMBER(referrer_policy) |
74 IPC_STRUCT_TRAITS_MEMBER(custom_context) | 75 IPC_STRUCT_TRAITS_MEMBER(custom_context) |
75 IPC_STRUCT_TRAITS_MEMBER(custom_items) | 76 IPC_STRUCT_TRAITS_MEMBER(custom_items) |
76 IPC_STRUCT_TRAITS_MEMBER(source_type) | 77 IPC_STRUCT_TRAITS_MEMBER(source_type) |
77 #if defined(OS_ANDROID) | 78 #if defined(OS_ANDROID) |
78 IPC_STRUCT_TRAITS_MEMBER(selection_start) | 79 IPC_STRUCT_TRAITS_MEMBER(selection_start) |
79 IPC_STRUCT_TRAITS_MEMBER(selection_end) | 80 IPC_STRUCT_TRAITS_MEMBER(selection_end) |
80 #endif | 81 #endif |
81 IPC_STRUCT_TRAITS_END() | 82 IPC_STRUCT_TRAITS_END() |
82 | 83 |
84 IPC_STRUCT_TRAITS_BEGIN(content::NavigationParamsWithRequestAndCommitInfo) | |
85 IPC_STRUCT_TRAITS_PARENT(content::NavigationParamsWithCommitInfo) | |
86 IPC_STRUCT_TRAITS_MEMBER(is_post) | |
87 IPC_STRUCT_TRAITS_MEMBER(allow_download) | |
88 IPC_STRUCT_TRAITS_END() | |
89 | |
90 IPC_STRUCT_TRAITS_BEGIN(content::NavigationParamsWithCommitInfo) | |
91 IPC_STRUCT_TRAITS_PARENT(content::CoreNavigationParams) | |
92 IPC_STRUCT_TRAITS_MEMBER(page_id) | |
93 IPC_STRUCT_TRAITS_MEMBER(should_clear_history_list) | |
94 IPC_STRUCT_TRAITS_MEMBER(pending_history_list_offset) | |
95 IPC_STRUCT_TRAITS_MEMBER(current_history_list_offset) | |
96 IPC_STRUCT_TRAITS_MEMBER(current_history_list_length) | |
97 IPC_STRUCT_TRAITS_MEMBER(page_state) | |
98 IPC_STRUCT_TRAITS_MEMBER(navigation_type) | |
99 IPC_STRUCT_TRAITS_MEMBER(is_overriding_user_agent) | |
100 IPC_STRUCT_TRAITS_MEMBER(browser_navigation_start) | |
101 IPC_STRUCT_TRAITS_END() | |
102 | |
103 IPC_STRUCT_TRAITS_BEGIN(content::CoreNavigationParams) | |
Charlie Reis
2014/09/15 21:19:40
Why are these defined in reverse order? Is that a
| |
104 IPC_STRUCT_TRAITS_MEMBER(url) | |
105 IPC_STRUCT_TRAITS_MEMBER(referrer) | |
106 IPC_STRUCT_TRAITS_MEMBER(transition) | |
107 IPC_STRUCT_TRAITS_END() | |
108 | |
83 IPC_STRUCT_TRAITS_BEGIN(content::CustomContextMenuContext) | 109 IPC_STRUCT_TRAITS_BEGIN(content::CustomContextMenuContext) |
84 IPC_STRUCT_TRAITS_MEMBER(is_pepper_menu) | 110 IPC_STRUCT_TRAITS_MEMBER(is_pepper_menu) |
85 IPC_STRUCT_TRAITS_MEMBER(request_id) | 111 IPC_STRUCT_TRAITS_MEMBER(request_id) |
86 IPC_STRUCT_TRAITS_MEMBER(render_widget_id) | 112 IPC_STRUCT_TRAITS_MEMBER(render_widget_id) |
87 IPC_STRUCT_TRAITS_MEMBER(link_followed) | 113 IPC_STRUCT_TRAITS_MEMBER(link_followed) |
88 IPC_STRUCT_TRAITS_END() | 114 IPC_STRUCT_TRAITS_END() |
89 | 115 |
90 IPC_STRUCT_BEGIN(FrameHostMsg_DidFailProvisionalLoadWithError_Params) | 116 IPC_STRUCT_BEGIN(FrameHostMsg_DidFailProvisionalLoadWithError_Params) |
91 // Error code as reported in the DidFailProvisionalLoad callback. | 117 // Error code as reported in the DidFailProvisionalLoad callback. |
92 IPC_STRUCT_MEMBER(int, error_code) | 118 IPC_STRUCT_MEMBER(int, error_code) |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 // We need to track the RenderViewHost routing_id because of downstream | 188 // We need to track the RenderViewHost routing_id because of downstream |
163 // dependencies (crbug.com/392171 DownloadRequestHandle, SaveFileManager, | 189 // dependencies (crbug.com/392171 DownloadRequestHandle, SaveFileManager, |
164 // ResourceDispatcherHostImpl, MediaStreamUIProxy, | 190 // ResourceDispatcherHostImpl, MediaStreamUIProxy, |
165 // SpeechRecognitionDispatcherHost and possibly others). They look up the view | 191 // SpeechRecognitionDispatcherHost and possibly others). They look up the view |
166 // based on the ID stored in the resource requests. Once those dependencies | 192 // 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 | 193 // 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. | 194 // client to be based on the routing_id of the RenderFrameHost. |
169 IPC_STRUCT_MEMBER(int, render_view_routing_id) | 195 IPC_STRUCT_MEMBER(int, render_view_routing_id) |
170 IPC_STRUCT_END() | 196 IPC_STRUCT_END() |
171 | 197 |
172 IPC_STRUCT_BEGIN(FrameMsg_Navigate_Params) | 198 IPC_STRUCT_BEGIN_WITH_PARENT(FrameMsg_Navigate_Params, |
173 // The page_id for this navigation, or -1 if it is a new navigation. Back, | 199 content::NavigationParamsWithRequestAndCommitInfo) |
174 // Forward, and Reload navigations should have a valid page_id. If the load | 200 IPC_STRUCT_TRAITS_PARENT(content::NavigationParamsWithRequestAndCommitInfo) |
175 // succeeds, then this page_id will be reflected in the resultant | |
176 // FrameHostMsg_DidCommitProvisionalLoad message. | |
177 IPC_STRUCT_MEMBER(int32, page_id) | |
178 | |
179 // 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 | |
181 // the current navigation. | |
182 IPC_STRUCT_MEMBER(int, pending_history_list_offset) | |
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 | |
197 // Base URL for use in WebKit's SubstituteData. | 201 // Base URL for use in WebKit's SubstituteData. |
198 // Is only used with data: URLs. | 202 // Is only used with data: URLs. |
199 IPC_STRUCT_MEMBER(GURL, base_url_for_data_url) | 203 IPC_STRUCT_MEMBER(GURL, base_url_for_data_url) |
Charlie Reis
2014/09/15 21:19:40
Are the rest of these going to get migrated to the
| |
200 | 204 |
201 // History URL for use in WebKit's SubstituteData. | 205 // History URL for use in WebKit's SubstituteData. |
202 // Is only used with data: URLs. | 206 // Is only used with data: URLs. |
203 IPC_STRUCT_MEMBER(GURL, history_url_for_data_url) | 207 IPC_STRUCT_MEMBER(GURL, history_url_for_data_url) |
204 | 208 |
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 | 209 // Any redirect URLs that occurred before |url|. Useful for cross-process |
210 // navigations; defaults to empty. | 210 // navigations; defaults to empty. |
211 IPC_STRUCT_MEMBER(std::vector<GURL>, redirects) | 211 IPC_STRUCT_MEMBER(std::vector<GURL>, redirects) |
212 | 212 |
213 // The type of transition. | |
214 IPC_STRUCT_MEMBER(content::PageTransition, transition) | |
215 | |
216 // Informs the RenderView the pending navigation should replace the current | 213 // Informs the RenderView the pending navigation should replace the current |
217 // history entry when it commits. This is used for cross-process redirects so | 214 // history entry when it commits. This is used for cross-process redirects so |
218 // the transferred navigation can recover the navigation state. | 215 // the transferred navigation can recover the navigation state. |
219 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) | 216 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) |
220 | 217 |
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 | 218 // The time the request was created. This is used by the old performance |
228 // infrastructure to set up DocumentState associated with the RenderView. | 219 // infrastructure to set up DocumentState associated with the RenderView. |
229 // TODO(ppi): make it go away. | 220 // TODO(ppi): make it go away. |
230 IPC_STRUCT_MEMBER(base::Time, request_time) | 221 IPC_STRUCT_MEMBER(base::Time, request_time) |
231 | 222 |
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 | 223 // The following two members identify a previous request that has been |
236 // created before this navigation is being transferred to a new render view. | 224 // created before this navigation is being transferred to a new render view. |
237 // This serves the purpose of recycling the old request. | 225 // This serves the purpose of recycling the old request. |
238 // Unless this refers to a transferred navigation, these values are -1 and -1. | 226 // Unless this refers to a transferred navigation, these values are -1 and -1. |
239 IPC_STRUCT_MEMBER(int, transferred_request_child_id) | 227 IPC_STRUCT_MEMBER(int, transferred_request_child_id) |
240 IPC_STRUCT_MEMBER(int, transferred_request_request_id) | 228 IPC_STRUCT_MEMBER(int, transferred_request_request_id) |
241 | 229 |
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:// | 230 // Whether or not this url should be allowed to access local file:// |
256 // resources. | 231 // resources. |
257 IPC_STRUCT_MEMBER(bool, can_load_local_resources) | 232 IPC_STRUCT_MEMBER(bool, can_load_local_resources) |
258 | 233 |
259 // If not empty, which frame to navigate. | 234 // If not empty, which frame to navigate. |
260 IPC_STRUCT_MEMBER(std::string, frame_to_navigate) | 235 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() | 236 IPC_STRUCT_END() |
265 | 237 |
266 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params) | 238 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params) |
267 IPC_STRUCT_MEMBER(GURL, url) | 239 IPC_STRUCT_MEMBER(GURL, url) |
268 IPC_STRUCT_MEMBER(content::Referrer, referrer) | 240 IPC_STRUCT_MEMBER(content::Referrer, referrer) |
269 IPC_STRUCT_MEMBER(WindowOpenDisposition, disposition) | 241 IPC_STRUCT_MEMBER(WindowOpenDisposition, disposition) |
270 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) | 242 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) |
271 IPC_STRUCT_MEMBER(bool, user_gesture) | 243 IPC_STRUCT_MEMBER(bool, user_gesture) |
272 IPC_STRUCT_END() | 244 IPC_STRUCT_END() |
273 | 245 |
274 // PlzNavigate | 246 // PlzNavigate |
275 IPC_STRUCT_BEGIN(FrameHostMsg_BeginNavigation_Params) | 247 IPC_STRUCT_BEGIN_WITH_PARENT(FrameHostMsg_BeginNavigation_Params, |
248 content::CoreNavigationParams) | |
249 IPC_STRUCT_TRAITS_PARENT(content::CoreNavigationParams) | |
276 // The request method: GET, POST, etc. | 250 // The request method: GET, POST, etc. |
277 IPC_STRUCT_MEMBER(std::string, method) | 251 IPC_STRUCT_MEMBER(std::string, method) |
Charlie Reis
2014/09/15 21:19:40
Same question.
| |
278 | 252 |
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. | 253 // Additional HTTP request headers. |
286 IPC_STRUCT_MEMBER(std::string, headers) | 254 IPC_STRUCT_MEMBER(std::string, headers) |
287 | 255 |
288 // net::URLRequest load flags (net::LOAD_NORMAL) by default). | 256 // net::URLRequest load flags (net::LOAD_NORMAL) by default). |
289 IPC_STRUCT_MEMBER(int, load_flags) | 257 IPC_STRUCT_MEMBER(int, load_flags) |
290 | 258 |
291 // Optional resource request body (may be null). | 259 // Optional resource request body (may be null). |
292 IPC_STRUCT_MEMBER(scoped_refptr<content::ResourceRequestBody>, | 260 IPC_STRUCT_MEMBER(scoped_refptr<content::ResourceRequestBody>, |
293 request_body) | 261 request_body) |
294 | 262 |
295 // True if the request was user initiated. | 263 // True if the request was user initiated. |
296 IPC_STRUCT_MEMBER(bool, has_user_gesture) | 264 IPC_STRUCT_MEMBER(bool, has_user_gesture) |
265 IPC_STRUCT_END() | |
297 | 266 |
298 IPC_STRUCT_MEMBER(content::PageTransition, transition_type) | 267 // PlzNavigate |
299 | 268 IPC_STRUCT_BEGIN_WITH_PARENT(FrameMsg_CommitNavigation_Params, |
300 // Whether this navigation should replace the current session history entry on | 269 content::NavigationParamsWithCommitInfo) |
301 // commit. | 270 IPC_STRUCT_TRAITS_PARENT(content::NavigationParamsWithCommitInfo) |
302 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) | 271 // The URL to request to the browser to get access to the stream of data. |
303 | 272 IPC_STRUCT_MEMBER(GURL, stream_url) |
304 // Whether or not we should allow the URL to download. | 273 // TODO(clamy): Add timing values relevant to the Navigation Timing API. |
305 IPC_STRUCT_MEMBER(bool, allow_download) | |
306 IPC_STRUCT_END() | 274 IPC_STRUCT_END() |
307 | 275 |
308 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 276 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
309 // This message is used for supporting popup menus on Mac OS X and Android using | 277 // This message is used for supporting popup menus on Mac OS X and Android using |
310 // native controls. See the FrameHostMsg_ShowPopup message. | 278 // native controls. See the FrameHostMsg_ShowPopup message. |
311 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params) | 279 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params) |
312 // Position on the screen. | 280 // Position on the screen. |
313 IPC_STRUCT_MEMBER(gfx::Rect, bounds) | 281 IPC_STRUCT_MEMBER(gfx::Rect, bounds) |
314 | 282 |
315 // The height of each item in the menu. | 283 // The height of each item in the menu. |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
481 std::vector<int> /* selected indices */) | 449 std::vector<int> /* selected indices */) |
482 | 450 |
483 #elif defined(OS_MACOSX) | 451 #elif defined(OS_MACOSX) |
484 | 452 |
485 // External popup menus. | 453 // External popup menus. |
486 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem, | 454 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem, |
487 int /* selected index, -1 means no selection */) | 455 int /* selected index, -1 means no selection */) |
488 | 456 |
489 #endif | 457 #endif |
490 | 458 |
459 // PlzNavigate | |
460 // Tells the renderer that a navigation is ready to commit. | |
461 IPC_MESSAGE_ROUTED1(FrameMsg_CommitNavigation, FrameMsg_CommitNavigation_Params) | |
462 | |
491 // ----------------------------------------------------------------------------- | 463 // ----------------------------------------------------------------------------- |
492 // Messages sent from the renderer to the browser. | 464 // Messages sent from the renderer to the browser. |
493 | 465 |
494 // Blink and JavaScript error messages to log to the console | 466 // Blink and JavaScript error messages to log to the console |
495 // or debugger UI. | 467 // or debugger UI. |
496 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole, | 468 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole, |
497 int32, /* log level */ | 469 int32, /* log level */ |
498 base::string16, /* msg */ | 470 base::string16, /* msg */ |
499 int32, /* line number */ | 471 int32, /* line number */ |
500 base::string16 /* source id */ ) | 472 base::string16 /* source id */ ) |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
753 size_t /* endOffset */) | 725 size_t /* endOffset */) |
754 | 726 |
755 // Notifies the browser that the renderer has a pending navigation transition. | 727 // Notifies the browser that the renderer has a pending navigation transition. |
756 // The string parameters are all UTF8. | 728 // The string parameters are all UTF8. |
757 IPC_MESSAGE_CONTROL4(FrameHostMsg_AddNavigationTransitionData, | 729 IPC_MESSAGE_CONTROL4(FrameHostMsg_AddNavigationTransitionData, |
758 int /* render_frame_id */, | 730 int /* render_frame_id */, |
759 std::string /* allowed_destination_host_pattern */, | 731 std::string /* allowed_destination_host_pattern */, |
760 std::string /* selector */, | 732 std::string /* selector */, |
761 std::string /* markup */) | 733 std::string /* markup */) |
762 | 734 |
735 // PlzNavigate | |
763 // Tells the browser to perform a navigation. | 736 // Tells the browser to perform a navigation. |
764 IPC_MESSAGE_ROUTED1(FrameHostMsg_BeginNavigation, | 737 IPC_MESSAGE_ROUTED1(FrameHostMsg_BeginNavigation, |
765 FrameHostMsg_BeginNavigation_Params) | 738 FrameHostMsg_BeginNavigation_Params) |
766 | 739 |
767 // Sent once a paint happens after the first non empty layout. In other words | 740 // Sent once a paint happens after the first non empty layout. In other words |
768 // after the frame has painted something. | 741 // after the frame has painted something. |
769 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint) | 742 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint) |
770 | 743 |
771 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 744 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
772 | 745 |
773 // Message to show/hide a popup menu using native controls. | 746 // Message to show/hide a popup menu using native controls. |
774 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup, | 747 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup, |
775 FrameHostMsg_ShowPopup_Params) | 748 FrameHostMsg_ShowPopup_Params) |
776 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup) | 749 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup) |
777 | 750 |
778 #endif | 751 #endif |
OLD | NEW |