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

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: Fixes based on more comments from Albert. Created 8 years, 4 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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 // to convert them to pixels. 565 // to convert them to pixels.
566 IPC_STRUCT_MEMBER(float, scale_factor) 566 IPC_STRUCT_MEMBER(float, scale_factor)
567 IPC_STRUCT_END() 567 IPC_STRUCT_END()
568 568
569 IPC_STRUCT_BEGIN(ViewMsg_PostMessage_Params) 569 IPC_STRUCT_BEGIN(ViewMsg_PostMessage_Params)
570 // The serialized script value. 570 // The serialized script value.
571 IPC_STRUCT_MEMBER(string16, data) 571 IPC_STRUCT_MEMBER(string16, data)
572 572
573 // When sent to the browser, this is the routing ID of the source frame in 573 // When sent to the browser, this is the routing ID of the source frame in
574 // the source process. The browser replaces it with the routing ID of the 574 // the source process. The browser replaces it with the routing ID of the
575 // equivalent (swapped out) frame in the destination process. Set to 575 // equivalent (swapped out) frame in the destination process.
576 // MSG_ROUTING_NONE if the source frame isn't supported (e.g., subframes).
577 IPC_STRUCT_MEMBER(int, source_routing_id) 576 IPC_STRUCT_MEMBER(int, source_routing_id)
577 // The identifier of the source frame in the source process.
578 IPC_STRUCT_MEMBER(int, source_frame_id)
579
580 // The full set of identifiers to uniquely descirbe the target frame. See
Charlie Reis 2012/08/22 22:08:34 nit: describe
nasko 2012/08/23 21:55:53 Done.
581 // the comment on ViewMsg_FrameTreeUpdated for details.
582 IPC_STRUCT_MEMBER(int, target_process_id)
583 IPC_STRUCT_MEMBER(int, target_routing_id)
584 IPC_STRUCT_MEMBER(int, target_frame_id)
578 585
579 // The origin of the source frame. 586 // The origin of the source frame.
580 IPC_STRUCT_MEMBER(string16, source_origin) 587 IPC_STRUCT_MEMBER(string16, source_origin)
581 588
582 // The origin for the message's target. 589 // The origin for the message's target.
583 IPC_STRUCT_MEMBER(string16, target_origin) 590 IPC_STRUCT_MEMBER(string16, target_origin)
584 IPC_STRUCT_END() 591 IPC_STRUCT_END()
585 592
586 IPC_STRUCT_BEGIN(ViewHostMsg_DidFailProvisionalLoadWithError_Params) 593 IPC_STRUCT_BEGIN(ViewHostMsg_DidFailProvisionalLoadWithError_Params)
587 // The frame ID for the failure report. 594 // The frame ID for the failure report.
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 IPC_MESSAGE_ROUTED4(ViewMsg_ScriptEvalRequest, 1038 IPC_MESSAGE_ROUTED4(ViewMsg_ScriptEvalRequest,
1032 string16, /* frame_xpath */ 1039 string16, /* frame_xpath */
1033 string16, /* jscript_url */ 1040 string16, /* jscript_url */
1034 int, /* ID */ 1041 int, /* ID */
1035 bool /* If true, result is sent back. */) 1042 bool /* If true, result is sent back. */)
1036 1043
1037 // Posts a message from a frame in another process to the current renderer. 1044 // Posts a message from a frame in another process to the current renderer.
1038 IPC_MESSAGE_ROUTED1(ViewMsg_PostMessageEvent, 1045 IPC_MESSAGE_ROUTED1(ViewMsg_PostMessageEvent,
1039 ViewMsg_PostMessage_Params) 1046 ViewMsg_PostMessage_Params)
1040 1047
1048 // Sends a JSON serialized frame tree to render processes along with the
1049 // process id and route id of the source renderer.
1050 //
1051 // This message must be send to swapped out renderers every time the browser
Charlie Reis 2012/08/22 22:08:34 nit: send -> sent
nasko 2012/08/23 21:55:53 Done.
1052 // receives a ViewHostMsg_FrameTreeUpdated message.
1053 //
1054
1055
Charlie Reis 2012/08/22 22:08:34 nit: Remove blank lines.
nasko 2012/08/23 21:55:53 Done.
1056 IPC_MESSAGE_ROUTED3(ViewMsg_UpdateFrameTree,
1057 int, /* the child process id of the active renderer */
1058 int, /* route_id of the active renderer */
1059 std::string /* json encoded frame tree */)
1060
1041 // Request for the renderer to evaluate an xpath to a frame and insert css 1061 // Request for the renderer to evaluate an xpath to a frame and insert css
1042 // into that frame's document. See ViewMsg_ScriptEvalRequest for details on 1062 // into that frame's document. See ViewMsg_ScriptEvalRequest for details on
1043 // allowed xpath expressions. 1063 // allowed xpath expressions.
1044 IPC_MESSAGE_ROUTED2(ViewMsg_CSSInsertRequest, 1064 IPC_MESSAGE_ROUTED2(ViewMsg_CSSInsertRequest,
1045 string16, /* frame_xpath */ 1065 string16, /* frame_xpath */
1046 std::string /* css string */) 1066 std::string /* css string */)
1047 1067
1048 // External popup menus. 1068 // External popup menus.
1049 #if defined(OS_MACOSX) 1069 #if defined(OS_MACOSX)
1050 IPC_MESSAGE_ROUTED1(ViewMsg_SelectPopupMenuItem, 1070 IPC_MESSAGE_ROUTED1(ViewMsg_SelectPopupMenuItem,
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
2185 // (according to the value of is_hung). The browser can give the user the 2205 // (according to the value of is_hung). The browser can give the user the
2186 // option of killing the plugin. 2206 // option of killing the plugin.
2187 IPC_MESSAGE_ROUTED3(ViewHostMsg_PepperPluginHung, 2207 IPC_MESSAGE_ROUTED3(ViewHostMsg_PepperPluginHung,
2188 int /* plugin_child_id */, 2208 int /* plugin_child_id */,
2189 FilePath /* path */, 2209 FilePath /* path */,
2190 bool /* is_hung */) 2210 bool /* is_hung */)
2191 2211
2192 // Screen was rotated. Dispatched to the onorientationchange javascript API. 2212 // Screen was rotated. Dispatched to the onorientationchange javascript API.
2193 IPC_MESSAGE_ROUTED1(ViewMsg_OrientationChangeEvent, 2213 IPC_MESSAGE_ROUTED1(ViewMsg_OrientationChangeEvent,
2194 int /* orientation */) 2214 int /* orientation */)
2215
2216 // Chrome allows JavaScript calls to be routed across process boundaries. To
2217 // achive this, each active renderer in the source process has a swapped out
Charlie Reis 2012/08/22 22:08:34 nit: achieve nit: renderer -> RenderView (Same bel
nasko 2012/08/23 21:55:53 Done.
2218 // mirror in the destination process. The active renderer and its mirror need to
Charlie Reis 2012/08/22 22:08:34 Hmm, we haven't been using this "mirror" term befo
nasko 2012/08/23 21:55:53 Done.
2219 // have identical frame tree structure, so calls originating and targeting
2220 // subframes can be routed properly. This is achieved by each active renderer
2221 // sending a ViewHostMsg_FrameTreeUpdated message to the browser, which in turn
2222 // sends the update to the corresponding mirror renderers through the
2223 // ViewMsg_UpdateFrameTree.
Charlie Reis 2012/08/22 22:08:34 This is a great explanation. Since we say they "n
nasko 2012/08/23 21:55:53 Done.
2224 //
2225 // When routing JavaScript calls across processes, the destination information
2226 // is kept in the renderer process instead of the browser process. This design
2227 // was chosen because frame ids are allocated by the renderer process. If the
2228 // browser was to keep a mapping of the frame ids across processes, it will
Charlie Reis 2012/08/22 22:08:34 nit: will -> would
nasko 2012/08/23 21:55:53 Done.
2229 // require an extra IPC message with the newly allocated frame ids, as a
2230 // response to this particular message.
2231 //
2232 // The frame tree for a renderer is serialized to JSON, so it can be sent to
2233 // the browser process. Each node in the tree is a DictionaryValue with three
2234 // properties:
awong 2012/08/22 22:25:47 Since this is JSON, I'd define this in terms of JS
nasko 2012/08/23 21:55:53 Done.
2235 // * id - the frame identifier in this renderer
2236 // * name - the name of the frame, if one has been assigned
2237 // * subtree - a list of DictionaryValue objects for each frame that is
Charlie Reis 2012/08/22 22:08:34 nit: that is a direct child
nasko 2012/08/23 21:55:53 Done.
2238 // direct child of the current frame. This property can be omitted if
2239 // there are no direct child frames, so less data is transferred.
2240 //
2241 // This message must be sent on any events that modify the tree structure or
2242 // the names of any frames.
2243 IPC_MESSAGE_ROUTED1(ViewHostMsg_FrameTreeUpdated,
2244 std::string /* json encoded frame tree */)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698