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

Side by Side Diff: content/common/view_messages.h

Issue 10827078: Support frame tree propagation between renderers in the same browsing instance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another round of fixes based on Charlie's review. Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 page rendering. 5 // IPC messages for page rendering.
6 // Multiply-included message file, hence no include guard. 6 // Multiply-included message file, hence no include guard.
7 7
8 #include "base/process.h" 8 #include "base/process.h"
9 #include "base/shared_memory.h" 9 #include "base/shared_memory.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 // to convert them to pixels. 590 // to convert them to pixels.
591 IPC_STRUCT_MEMBER(float, scale_factor) 591 IPC_STRUCT_MEMBER(float, scale_factor)
592 IPC_STRUCT_END() 592 IPC_STRUCT_END()
593 593
594 IPC_STRUCT_BEGIN(ViewMsg_PostMessage_Params) 594 IPC_STRUCT_BEGIN(ViewMsg_PostMessage_Params)
595 // The serialized script value. 595 // The serialized script value.
596 IPC_STRUCT_MEMBER(string16, data) 596 IPC_STRUCT_MEMBER(string16, data)
597 597
598 // When sent to the browser, this is the routing ID of the source frame in 598 // When sent to the browser, this is the routing ID of the source frame in
599 // the source process. The browser replaces it with the routing ID of the 599 // the source process. The browser replaces it with the routing ID of the
600 // equivalent (swapped out) frame in the destination process. Set to 600 // equivalent (swapped out) frame in the destination process.
601 // MSG_ROUTING_NONE if the source frame isn't supported (e.g., subframes).
602 IPC_STRUCT_MEMBER(int, source_routing_id) 601 IPC_STRUCT_MEMBER(int, source_routing_id)
602 // The identifier of the source frame in the source process.
603 IPC_STRUCT_MEMBER(int, source_frame_id)
604
605 // The full set of identifiers to uniquely describe the target frame. See
606 // the comment on ViewMsg_FrameTreeUpdated for details.
607 IPC_STRUCT_MEMBER(int, target_process_id)
608 IPC_STRUCT_MEMBER(int, target_routing_id)
609 IPC_STRUCT_MEMBER(int, target_frame_id)
603 610
604 // The origin of the source frame. 611 // The origin of the source frame.
605 IPC_STRUCT_MEMBER(string16, source_origin) 612 IPC_STRUCT_MEMBER(string16, source_origin)
606 613
607 // The origin for the message's target. 614 // The origin for the message's target.
608 IPC_STRUCT_MEMBER(string16, target_origin) 615 IPC_STRUCT_MEMBER(string16, target_origin)
609 IPC_STRUCT_END() 616 IPC_STRUCT_END()
610 617
611 IPC_STRUCT_BEGIN(ViewHostMsg_DidFailProvisionalLoadWithError_Params) 618 IPC_STRUCT_BEGIN(ViewHostMsg_DidFailProvisionalLoadWithError_Params)
612 // The frame ID for the failure report. 619 // The frame ID for the failure report.
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 IPC_MESSAGE_ROUTED4(ViewMsg_ScriptEvalRequest, 1063 IPC_MESSAGE_ROUTED4(ViewMsg_ScriptEvalRequest,
1057 string16, /* frame_xpath */ 1064 string16, /* frame_xpath */
1058 string16, /* jscript_url */ 1065 string16, /* jscript_url */
1059 int, /* ID */ 1066 int, /* ID */
1060 bool /* If true, result is sent back. */) 1067 bool /* If true, result is sent back. */)
1061 1068
1062 // Posts a message from a frame in another process to the current renderer. 1069 // Posts a message from a frame in another process to the current renderer.
1063 IPC_MESSAGE_ROUTED1(ViewMsg_PostMessageEvent, 1070 IPC_MESSAGE_ROUTED1(ViewMsg_PostMessageEvent,
1064 ViewMsg_PostMessage_Params) 1071 ViewMsg_PostMessage_Params)
1065 1072
1073 // Sends a JSON serialized frame tree to RenderView along with the process id
1074 // and route id of the source renderer.
1075 //
1076 // This message must be sent to swapped out RenderViews every time the browser
1077 // receives a ViewHostMsg_FrameTreeUpdated message.
1078 IPC_MESSAGE_ROUTED3(ViewMsg_UpdateFrameTree,
1079 int, /* the child process id of the active renderer */
1080 int, /* route_id of the active renderer */
1081 std::string /* json encoded frame tree */)
1082
1066 // Request for the renderer to evaluate an xpath to a frame and insert css 1083 // Request for the renderer to evaluate an xpath to a frame and insert css
1067 // into that frame's document. See ViewMsg_ScriptEvalRequest for details on 1084 // into that frame's document. See ViewMsg_ScriptEvalRequest for details on
1068 // allowed xpath expressions. 1085 // allowed xpath expressions.
1069 IPC_MESSAGE_ROUTED2(ViewMsg_CSSInsertRequest, 1086 IPC_MESSAGE_ROUTED2(ViewMsg_CSSInsertRequest,
1070 string16, /* frame_xpath */ 1087 string16, /* frame_xpath */
1071 std::string /* css string */) 1088 std::string /* css string */)
1072 1089
1073 // External popup menus. 1090 // External popup menus.
1074 #if defined(OS_MACOSX) 1091 #if defined(OS_MACOSX)
1075 IPC_MESSAGE_ROUTED1(ViewMsg_SelectPopupMenuItem, 1092 IPC_MESSAGE_ROUTED1(ViewMsg_SelectPopupMenuItem,
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2225 // (according to the value of is_hung). The browser can give the user the 2242 // (according to the value of is_hung). The browser can give the user the
2226 // option of killing the plugin. 2243 // option of killing the plugin.
2227 IPC_MESSAGE_ROUTED3(ViewHostMsg_PepperPluginHung, 2244 IPC_MESSAGE_ROUTED3(ViewHostMsg_PepperPluginHung,
2228 int /* plugin_child_id */, 2245 int /* plugin_child_id */,
2229 FilePath /* path */, 2246 FilePath /* path */,
2230 bool /* is_hung */) 2247 bool /* is_hung */)
2231 2248
2232 // Screen was rotated. Dispatched to the onorientationchange javascript API. 2249 // Screen was rotated. Dispatched to the onorientationchange javascript API.
2233 IPC_MESSAGE_ROUTED1(ViewMsg_OrientationChangeEvent, 2250 IPC_MESSAGE_ROUTED1(ViewMsg_OrientationChangeEvent,
2234 int /* orientation */) 2251 int /* orientation */)
2252
2253 // Chrome allows JavaScript calls to be routed across process boundaries. To
2254 // achieve this, each active RenderView in the source process has a swapped out
2255 // "mirror" in the target process. The active RenderView and its mirror
2256 // need to have identical frame tree structure, so calls originating in and
2257 // targeting subframes can be routed properly. This is achieved by each active
2258 // RenderView sending a ViewHostMsg_FrameTreeUpdated message to the browser,
2259 // which in turn sends the update to the corresponding mirror RenderView(s)
2260 // through the ViewMsg_UpdateFrameTree. We use best effort to keep these
2261 // trees synchronized across processes.
2262 //
2263 // When routing JavaScript calls across processes, the target information
2264 // is kept in the renderer process instead of the browser process. This design
2265 // was chosen because frame ids are allocated by the renderer process. If the
2266 // browser was to keep a mapping of the frame ids across processes, it would
2267 // require an extra IPC message with the newly allocated frame ids, as a
2268 // response to this particular message.
2269 //
2270 // The frame tree for a RenderView is serialized to JSON, so it can be sent to
2271 // the browser process. Each node in the tree is an object with three
2272 // properties:
2273 // * id - (integer) the frame identifier in this RenderView
2274 // * name - (string) the name of the frame, if one has been assigned
2275 // * subtree - an array of the same type of objects for each frame that is a
2276 // direct child of the current frame. This property can be omitted if
2277 // there are no direct child frames, so less data is transferred.
2278 //
2279 // This message must be sent on any events that modify the tree structure or
2280 // the names of any frames.
2281 IPC_MESSAGE_ROUTED1(ViewHostMsg_FrameTreeUpdated,
2282 std::string /* json encoded frame tree */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698