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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // We need to track the RenderViewHost routing_id because of downstream | 167 // We need to track the RenderViewHost routing_id because of downstream |
167 // dependencies (crbug.com/392171 DownloadRequestHandle, SaveFileManager, | 168 // dependencies (crbug.com/392171 DownloadRequestHandle, SaveFileManager, |
168 // ResourceDispatcherHostImpl, MediaStreamUIProxy, | 169 // ResourceDispatcherHostImpl, MediaStreamUIProxy, |
169 // SpeechRecognitionDispatcherHost and possibly others). They look up the view | 170 // SpeechRecognitionDispatcherHost and possibly others). They look up the view |
170 // based on the ID stored in the resource requests. Once those dependencies | 171 // based on the ID stored in the resource requests. Once those dependencies |
171 // are unwound or moved to RenderFrameHost (crbug.com/304341) we can move the | 172 // are unwound or moved to RenderFrameHost (crbug.com/304341) we can move the |
172 // client to be based on the routing_id of the RenderFrameHost. | 173 // client to be based on the routing_id of the RenderFrameHost. |
173 IPC_STRUCT_MEMBER(int, render_view_routing_id) | 174 IPC_STRUCT_MEMBER(int, render_view_routing_id) |
174 IPC_STRUCT_END() | 175 IPC_STRUCT_END() |
175 | 176 |
| 177 IPC_STRUCT_TRAITS_BEGIN(content::CommonNavigationParams) |
| 178 IPC_STRUCT_TRAITS_MEMBER(url) |
| 179 IPC_STRUCT_TRAITS_MEMBER(referrer) |
| 180 IPC_STRUCT_TRAITS_MEMBER(transition) |
| 181 IPC_STRUCT_TRAITS_MEMBER(navigation_type) |
| 182 IPC_STRUCT_TRAITS_MEMBER(allow_download) |
| 183 IPC_STRUCT_TRAITS_END() |
| 184 |
| 185 IPC_STRUCT_TRAITS_BEGIN(content::RequestNavigationParams) |
| 186 IPC_STRUCT_TRAITS_MEMBER(is_post) |
| 187 IPC_STRUCT_TRAITS_MEMBER(extra_headers) |
| 188 IPC_STRUCT_TRAITS_MEMBER(browser_initiated_post_data) |
| 189 IPC_STRUCT_TRAITS_END() |
| 190 |
| 191 IPC_STRUCT_TRAITS_BEGIN(content::CommitNavigationParams) |
| 192 IPC_STRUCT_TRAITS_MEMBER(page_state) |
| 193 IPC_STRUCT_TRAITS_MEMBER(is_overriding_user_agent) |
| 194 IPC_STRUCT_TRAITS_MEMBER(browser_navigation_start) |
| 195 IPC_STRUCT_TRAITS_END() |
| 196 |
176 IPC_STRUCT_BEGIN(FrameMsg_Navigate_Params) | 197 IPC_STRUCT_BEGIN(FrameMsg_Navigate_Params) |
| 198 // TODO(clamy): investigate which parameters are also needed in PlzNavigate |
| 199 // and move them to the appropriate NavigationParams struct. |
| 200 |
| 201 // These structs contain parameters shared by other navigation IPCs. |
| 202 IPC_STRUCT_MEMBER(content::CommonNavigationParams, common_params) |
| 203 IPC_STRUCT_MEMBER(content::RequestNavigationParams, request_params) |
| 204 IPC_STRUCT_MEMBER(content::CommitNavigationParams, commit_params) |
| 205 |
177 // The page_id for this navigation, or -1 if it is a new navigation. Back, | 206 // The page_id for this navigation, or -1 if it is a new navigation. Back, |
178 // Forward, and Reload navigations should have a valid page_id. If the load | 207 // Forward, and Reload navigations should have a valid page_id. If the load |
179 // succeeds, then this page_id will be reflected in the resultant | 208 // succeeds, then this page_id will be reflected in the resultant |
180 // FrameHostMsg_DidCommitProvisionalLoad message. | 209 // FrameHostMsg_DidCommitProvisionalLoad message. |
181 IPC_STRUCT_MEMBER(int32, page_id) | 210 IPC_STRUCT_MEMBER(int32, page_id) |
182 | 211 |
183 // If page_id is -1, then pending_history_list_offset will also be -1. | 212 // If page_id is -1, then pending_history_list_offset will also be -1. |
184 // Otherwise, it contains the offset into the history list corresponding to | 213 // Otherwise, it contains the offset into the history list corresponding to |
185 // the current navigation. | 214 // the current navigation. |
186 IPC_STRUCT_MEMBER(int, pending_history_list_offset) | 215 IPC_STRUCT_MEMBER(int, pending_history_list_offset) |
187 | 216 |
188 // Informs the RenderView of where its current page contents reside in | 217 // Informs the RenderView of where its current page contents reside in |
189 // session history and the total size of the session history list. | 218 // session history and the total size of the session history list. |
190 IPC_STRUCT_MEMBER(int, current_history_list_offset) | 219 IPC_STRUCT_MEMBER(int, current_history_list_offset) |
191 IPC_STRUCT_MEMBER(int, current_history_list_length) | 220 IPC_STRUCT_MEMBER(int, current_history_list_length) |
192 | 221 |
193 // Informs the RenderView the session history should be cleared. In that | 222 // Informs the RenderView the session history should be cleared. In that |
194 // case, the RenderView needs to notify the browser that the clearing was | 223 // case, the RenderView needs to notify the browser that the clearing was |
195 // succesful when the navigation commits. | 224 // succesful when the navigation commits. |
196 IPC_STRUCT_MEMBER(bool, should_clear_history_list) | 225 IPC_STRUCT_MEMBER(bool, should_clear_history_list) |
197 | 226 |
198 // The URL to load. | |
199 IPC_STRUCT_MEMBER(GURL, url) | |
200 | |
201 // Base URL for use in WebKit's SubstituteData. | 227 // Base URL for use in WebKit's SubstituteData. |
202 // Is only used with data: URLs. | 228 // Is only used with data: URLs. |
203 IPC_STRUCT_MEMBER(GURL, base_url_for_data_url) | 229 IPC_STRUCT_MEMBER(GURL, base_url_for_data_url) |
204 | 230 |
205 // History URL for use in WebKit's SubstituteData. | 231 // History URL for use in WebKit's SubstituteData. |
206 // Is only used with data: URLs. | 232 // Is only used with data: URLs. |
207 IPC_STRUCT_MEMBER(GURL, history_url_for_data_url) | 233 IPC_STRUCT_MEMBER(GURL, history_url_for_data_url) |
208 | 234 |
209 // The URL to send in the "Referer" header field. Can be empty if there is | |
210 // no referrer. | |
211 IPC_STRUCT_MEMBER(content::Referrer, referrer) | |
212 | |
213 // Any redirect URLs that occurred before |url|. Useful for cross-process | 235 // Any redirect URLs that occurred before |url|. Useful for cross-process |
214 // navigations; defaults to empty. | 236 // navigations; defaults to empty. |
215 IPC_STRUCT_MEMBER(std::vector<GURL>, redirects) | 237 IPC_STRUCT_MEMBER(std::vector<GURL>, redirects) |
216 | 238 |
217 // The type of transition. | |
218 IPC_STRUCT_MEMBER(ui::PageTransition, transition) | |
219 | |
220 // Informs the RenderView the pending navigation should replace the current | 239 // Informs the RenderView the pending navigation should replace the current |
221 // history entry when it commits. This is used for cross-process redirects so | 240 // history entry when it commits. This is used for cross-process redirects so |
222 // the transferred navigation can recover the navigation state. | 241 // the transferred navigation can recover the navigation state. |
223 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) | 242 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) |
224 | 243 |
225 // Opaque history state (received by ViewHostMsg_UpdateState). | |
226 IPC_STRUCT_MEMBER(content::PageState, page_state) | |
227 | |
228 // Type of navigation. | |
229 IPC_STRUCT_MEMBER(FrameMsg_Navigate_Type::Value, navigation_type) | |
230 | |
231 // The time the request was created. This is used by the old performance | 244 // The time the request was created. This is used by the old performance |
232 // infrastructure to set up DocumentState associated with the RenderView. | 245 // infrastructure to set up DocumentState associated with the RenderView. |
233 // TODO(ppi): make it go away. | 246 // TODO(ppi): make it go away. |
234 IPC_STRUCT_MEMBER(base::Time, request_time) | 247 IPC_STRUCT_MEMBER(base::Time, request_time) |
235 | 248 |
236 // Extra headers (separated by \n) to send during the request. | |
237 IPC_STRUCT_MEMBER(std::string, extra_headers) | |
238 | |
239 // The following two members identify a previous request that has been | 249 // The following two members identify a previous request that has been |
240 // created before this navigation is being transferred to a new render view. | 250 // created before this navigation is being transferred to a new render view. |
241 // This serves the purpose of recycling the old request. | 251 // This serves the purpose of recycling the old request. |
242 // Unless this refers to a transferred navigation, these values are -1 and -1. | 252 // Unless this refers to a transferred navigation, these values are -1 and -1. |
243 IPC_STRUCT_MEMBER(int, transferred_request_child_id) | 253 IPC_STRUCT_MEMBER(int, transferred_request_child_id) |
244 IPC_STRUCT_MEMBER(int, transferred_request_request_id) | 254 IPC_STRUCT_MEMBER(int, transferred_request_request_id) |
245 | 255 |
246 // Whether or not we should allow the url to download. | |
247 IPC_STRUCT_MEMBER(bool, allow_download) | |
248 | |
249 // Whether or not the user agent override string should be used. | |
250 IPC_STRUCT_MEMBER(bool, is_overriding_user_agent) | |
251 | |
252 // True if this was a post request. | |
253 IPC_STRUCT_MEMBER(bool, is_post) | |
254 | |
255 // If is_post is true, holds the post_data information from browser. Empty | |
256 // otherwise. | |
257 IPC_STRUCT_MEMBER(std::vector<unsigned char>, browser_initiated_post_data) | |
258 | |
259 // Whether or not this url should be allowed to access local file:// | 256 // Whether or not this url should be allowed to access local file:// |
260 // resources. | 257 // resources. |
261 IPC_STRUCT_MEMBER(bool, can_load_local_resources) | 258 IPC_STRUCT_MEMBER(bool, can_load_local_resources) |
262 | 259 |
263 // If not empty, which frame to navigate. | 260 // If not empty, which frame to navigate. |
264 IPC_STRUCT_MEMBER(std::string, frame_to_navigate) | 261 IPC_STRUCT_MEMBER(std::string, frame_to_navigate) |
265 | |
266 // The navigationStart time to expose through the Navigation Timing API to JS. | |
267 IPC_STRUCT_MEMBER(base::TimeTicks, browser_navigation_start) | |
268 IPC_STRUCT_END() | 262 IPC_STRUCT_END() |
269 | 263 |
270 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params) | 264 IPC_STRUCT_BEGIN(FrameHostMsg_OpenURL_Params) |
271 IPC_STRUCT_MEMBER(GURL, url) | 265 IPC_STRUCT_MEMBER(GURL, url) |
272 IPC_STRUCT_MEMBER(content::Referrer, referrer) | 266 IPC_STRUCT_MEMBER(content::Referrer, referrer) |
273 IPC_STRUCT_MEMBER(WindowOpenDisposition, disposition) | 267 IPC_STRUCT_MEMBER(WindowOpenDisposition, disposition) |
274 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) | 268 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) |
275 IPC_STRUCT_MEMBER(bool, user_gesture) | 269 IPC_STRUCT_MEMBER(bool, user_gesture) |
276 IPC_STRUCT_END() | 270 IPC_STRUCT_END() |
277 | 271 |
278 // PlzNavigate | 272 // PlzNavigate |
279 IPC_STRUCT_BEGIN(FrameHostMsg_BeginNavigation_Params) | 273 IPC_STRUCT_BEGIN(FrameHostMsg_BeginNavigation_Params) |
| 274 // TODO(clamy): See if it is possible to define a common struct between this |
| 275 // IPC and ResourceMsg_Request_Params. |
| 276 |
280 // The request method: GET, POST, etc. | 277 // The request method: GET, POST, etc. |
281 IPC_STRUCT_MEMBER(std::string, method) | 278 IPC_STRUCT_MEMBER(std::string, method) |
282 | 279 |
283 // The requested URL. | |
284 IPC_STRUCT_MEMBER(GURL, url) | |
285 | |
286 // The referrer to use (may be empty). | |
287 IPC_STRUCT_MEMBER(content::Referrer, referrer) | |
288 | |
289 // Additional HTTP request headers. | 280 // Additional HTTP request headers. |
290 IPC_STRUCT_MEMBER(std::string, headers) | 281 IPC_STRUCT_MEMBER(std::string, headers) |
291 | 282 |
292 // net::URLRequest load flags (net::LOAD_NORMAL) by default). | 283 // net::URLRequest load flags (net::LOAD_NORMAL) by default). |
293 IPC_STRUCT_MEMBER(int, load_flags) | 284 IPC_STRUCT_MEMBER(int, load_flags) |
294 | 285 |
295 // Optional resource request body (may be null). | 286 // Optional resource request body (may be null). |
296 IPC_STRUCT_MEMBER(scoped_refptr<content::ResourceRequestBody>, | 287 IPC_STRUCT_MEMBER(scoped_refptr<content::ResourceRequestBody>, |
297 request_body) | 288 request_body) |
298 | 289 |
299 // True if the request was user initiated. | 290 // True if the request was user initiated. |
300 IPC_STRUCT_MEMBER(bool, has_user_gesture) | 291 IPC_STRUCT_MEMBER(bool, has_user_gesture) |
301 | |
302 IPC_STRUCT_MEMBER(ui::PageTransition, transition_type) | |
303 | |
304 // Whether this navigation should replace the current session history entry on | |
305 // commit. | |
306 IPC_STRUCT_MEMBER(bool, should_replace_current_entry) | |
307 | |
308 // Whether or not we should allow the URL to download. | |
309 IPC_STRUCT_MEMBER(bool, allow_download) | |
310 IPC_STRUCT_END() | 292 IPC_STRUCT_END() |
311 | 293 |
312 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 294 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
313 // This message is used for supporting popup menus on Mac OS X and Android using | 295 // This message is used for supporting popup menus on Mac OS X and Android using |
314 // native controls. See the FrameHostMsg_ShowPopup message. | 296 // native controls. See the FrameHostMsg_ShowPopup message. |
315 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params) | 297 IPC_STRUCT_BEGIN(FrameHostMsg_ShowPopup_Params) |
316 // Position on the screen. | 298 // Position on the screen. |
317 IPC_STRUCT_MEMBER(gfx::Rect, bounds) | 299 IPC_STRUCT_MEMBER(gfx::Rect, bounds) |
318 | 300 |
319 // The height of each item in the menu. | 301 // The height of each item in the menu. |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 std::vector<int> /* selected indices */) | 457 std::vector<int> /* selected indices */) |
476 | 458 |
477 #elif defined(OS_MACOSX) | 459 #elif defined(OS_MACOSX) |
478 | 460 |
479 // External popup menus. | 461 // External popup menus. |
480 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem, | 462 IPC_MESSAGE_ROUTED1(FrameMsg_SelectPopupMenuItem, |
481 int /* selected index, -1 means no selection */) | 463 int /* selected index, -1 means no selection */) |
482 | 464 |
483 #endif | 465 #endif |
484 | 466 |
| 467 // PlzNavigate |
| 468 // Tells the renderer that a navigation is ready to commit. The renderer should |
| 469 // request |stream_url| to get access to the stream containing the body of the |
| 470 // response. |
| 471 IPC_MESSAGE_ROUTED3(FrameMsg_CommitNavigation, |
| 472 GURL, /* stream_url */ |
| 473 content::CommonNavigationParams, /* common_params */ |
| 474 content::CommitNavigationParams /* commit_params */) |
| 475 |
485 // ----------------------------------------------------------------------------- | 476 // ----------------------------------------------------------------------------- |
486 // Messages sent from the renderer to the browser. | 477 // Messages sent from the renderer to the browser. |
487 | 478 |
488 // Blink and JavaScript error messages to log to the console | 479 // Blink and JavaScript error messages to log to the console |
489 // or debugger UI. | 480 // or debugger UI. |
490 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole, | 481 IPC_MESSAGE_ROUTED4(FrameHostMsg_AddMessageToConsole, |
491 int32, /* log level */ | 482 int32, /* log level */ |
492 base::string16, /* msg */ | 483 base::string16, /* msg */ |
493 int32, /* line number */ | 484 int32, /* line number */ |
494 base::string16 /* source id */ ) | 485 base::string16 /* source id */ ) |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 size_t /* endOffset */) | 728 size_t /* endOffset */) |
738 | 729 |
739 // Notifies the browser that the renderer has a pending navigation transition. | 730 // Notifies the browser that the renderer has a pending navigation transition. |
740 // The string parameters are all UTF8. | 731 // The string parameters are all UTF8. |
741 IPC_MESSAGE_CONTROL4(FrameHostMsg_AddNavigationTransitionData, | 732 IPC_MESSAGE_CONTROL4(FrameHostMsg_AddNavigationTransitionData, |
742 int /* render_frame_id */, | 733 int /* render_frame_id */, |
743 std::string /* allowed_destination_host_pattern */, | 734 std::string /* allowed_destination_host_pattern */, |
744 std::string /* selector */, | 735 std::string /* selector */, |
745 std::string /* markup */) | 736 std::string /* markup */) |
746 | 737 |
| 738 // PlzNavigate |
747 // Tells the browser to perform a navigation. | 739 // Tells the browser to perform a navigation. |
748 IPC_MESSAGE_ROUTED1(FrameHostMsg_BeginNavigation, | 740 IPC_MESSAGE_ROUTED2(FrameHostMsg_BeginNavigation, |
749 FrameHostMsg_BeginNavigation_Params) | 741 FrameHostMsg_BeginNavigation_Params, |
| 742 content::CommonNavigationParams) |
750 | 743 |
751 // Sent once a paint happens after the first non empty layout. In other words | 744 // Sent once a paint happens after the first non empty layout. In other words |
752 // after the frame has painted something. | 745 // after the frame has painted something. |
753 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint) | 746 IPC_MESSAGE_ROUTED0(FrameHostMsg_DidFirstVisuallyNonEmptyPaint) |
754 | 747 |
755 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 748 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
756 | 749 |
757 // Message to show/hide a popup menu using native controls. | 750 // Message to show/hide a popup menu using native controls. |
758 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup, | 751 IPC_MESSAGE_ROUTED1(FrameHostMsg_ShowPopup, |
759 FrameHostMsg_ShowPopup_Params) | 752 FrameHostMsg_ShowPopup_Params) |
760 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup) | 753 IPC_MESSAGE_ROUTED0(FrameHostMsg_HidePopup) |
761 | 754 |
762 #endif | 755 #endif |
OLD | NEW |