65d390734a9a5e50e54b6f6eebecd52dab222bfc
[platform/framework/web/crosswalk.git] / src / content / common / frame_messages.h
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
3 // found in the LICENSE file.
4
5 // IPC messages for interacting with frames.
6 // Multiply-included message file, hence no include guard.
7
8 #include "content/common/content_export.h"
9 #include "content/common/frame_param.h"
10 #include "content/public/common/common_param_traits.h"
11 #include "ipc/ipc_message_macros.h"
12 #include "url/gurl.h"
13
14 #undef IPC_MESSAGE_EXPORT
15 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
16
17 #define IPC_MESSAGE_START FrameMsgStart
18
19 IPC_STRUCT_BEGIN(FrameHostMsg_DidFailProvisionalLoadWithError_Params)
20   // The frame ID for the failure report.
21   IPC_STRUCT_MEMBER(int64, frame_id)
22   // The WebFrame's uniqueName().
23   IPC_STRUCT_MEMBER(base::string16, frame_unique_name)
24   // True if this is the top-most frame.
25   IPC_STRUCT_MEMBER(bool, is_main_frame)
26   // Error code as reported in the DidFailProvisionalLoad callback.
27   IPC_STRUCT_MEMBER(int, error_code)
28   // An error message generated from the error_code. This can be an empty
29   // string if we were unable to find a meaningful description.
30   IPC_STRUCT_MEMBER(base::string16, error_description)
31   // The URL that the error is reported for.
32   IPC_STRUCT_MEMBER(GURL, url)
33   // True if the failure is the result of navigating to a POST again
34   // and we're going to show the POST interstitial.
35   IPC_STRUCT_MEMBER(bool, showing_repost_interstitial)
36 IPC_STRUCT_END()
37
38 // -----------------------------------------------------------------------------
39 // Messages sent from the browser to the renderer.
40
41 // When HW accelerated buffers are swapped in an out-of-process child frame
42 // renderer, the message is forwarded to the embedding frame to notify it of
43 // a new texture available for compositing. When the buffer has finished
44 // presenting, a FrameHostMsg_BuffersSwappedACK should be sent back to
45 // gpu host that produced this buffer.
46 //
47 // This is used in the non-ubercomp HW accelerated compositing path.
48 IPC_MESSAGE_ROUTED1(FrameMsg_BuffersSwapped,
49                     FrameMsg_BuffersSwapped_Params /* params */)
50
51 // Notifies the embedding frame that a new CompositorFrame is ready to be
52 // presented. When the frame finishes presenting, a matching
53 // FrameHostMsg_CompositorFrameSwappedACK should be sent back to the
54 // RenderViewHost that was produced the CompositorFrame.
55 //
56 // This is used in the ubercomp compositing path.
57 IPC_MESSAGE_ROUTED1(FrameMsg_CompositorFrameSwapped,
58                     FrameMsg_CompositorFrameSwapped_Params /* params */)
59
60 // -----------------------------------------------------------------------------
61 // Messages sent from the renderer to the browser.
62
63 // Sent by the renderer when a child frame is created in the renderer. The
64 // |parent_frame_id| and |frame_id| are NOT routing ids. They are
65 // renderer-allocated identifiers used for tracking a frame's creation.
66 //
67 // Each of these messages will have a corresponding FrameHostMsg_Detach message
68 // sent when the frame is detached from the DOM.
69 //
70 // TOOD(ajwong): replace parent_render_frame_id and frame_id with just the
71 // routing ids.
72 IPC_SYNC_MESSAGE_CONTROL4_1(FrameHostMsg_CreateChildFrame,
73                             int32 /* parent_render_frame_id */,
74                             int64 /* parent_frame_id */,
75                             int64 /* frame_id */,
76                             std::string /* frame_name */,
77                             int /* new_render_frame_id */)
78
79 // Sent by the renderer to the parent RenderFrameHost when a child frame is
80 // detached from the DOM.
81 IPC_MESSAGE_ROUTED2(FrameHostMsg_Detach,
82                     int64 /* parent_frame_id */,
83                     int64 /* frame_id */)
84
85 // Sent when the renderer starts a provisional load for a frame.
86 IPC_MESSAGE_ROUTED4(FrameHostMsg_DidStartProvisionalLoadForFrame,
87                     int64 /* frame_id */,
88                     int64 /* parent_frame_id */,
89                     bool /* true if it is the main frame */,
90                     GURL /* url */)
91
92 // Sent when the renderer fails a provisional load with an error.
93 IPC_MESSAGE_ROUTED1(FrameHostMsg_DidFailProvisionalLoadWithError,
94                     FrameHostMsg_DidFailProvisionalLoadWithError_Params)
95
96 // Sent when a provisional load on the main frame redirects.
97 IPC_MESSAGE_ROUTED3(FrameHostMsg_DidRedirectProvisionalLoad,
98                     int /* page_id */,
99                     GURL /* source_url*/,
100                     GURL /* target_url */)
101
102 // Sent to the browser when the renderer detects it is blocked on a pepper
103 // plugin message for too long. This is also sent when it becomes unhung
104 // (according to the value of is_hung). The browser can give the user the
105 // option of killing the plugin.
106 IPC_MESSAGE_ROUTED3(FrameHostMsg_PepperPluginHung,
107                     int /* plugin_child_id */,
108                     base::FilePath /* path */,
109                     bool /* is_hung */)
110
111 // Sent by the renderer process to indicate that a plugin instance has crashed.
112 // Note: |plugin_pid| should not be trusted. The corresponding process has
113 // probably died. Moreover, the ID may have been reused by a new process. Any
114 // usage other than displaying it in a prompt to the user is very likely to be
115 // wrong.
116 IPC_MESSAGE_ROUTED2(FrameHostMsg_PluginCrashed,
117                     base::FilePath /* plugin_path */,
118                     base::ProcessId /* plugin_pid */)
119
120 // Return information about a plugin for the given URL and MIME
121 // type. If there is no matching plugin, |found| is false.
122 // |actual_mime_type| is the actual mime type supported by the
123 // found plugin.
124 IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo,
125                             int /* render_frame_id */,
126                             GURL /* url */,
127                             GURL /* page_url */,
128                             std::string /* mime_type */,
129                             bool /* found */,
130                             content::WebPluginInfo /* plugin info */,
131                             std::string /* actual_mime_type */)
132
133 // A renderer sends this to the browser process when it wants to
134 // create a plugin.  The browser will create the plugin process if
135 // necessary, and will return a handle to the channel on success.
136 // On error an empty string is returned.
137 IPC_SYNC_MESSAGE_CONTROL4_2(FrameHostMsg_OpenChannelToPlugin,
138                             int /* render_frame_id */,
139                             GURL /* url */,
140                             GURL /* page_url */,
141                             std::string /* mime_type */,
142                             IPC::ChannelHandle /* channel_handle */,
143                             content::WebPluginInfo /* info */)
144
145 // Acknowledge that we presented a HW buffer and provide a sync point
146 // to specify the location in the command stream when the compositor
147 // is no longer using it.
148 //
149 // See FrameMsg_BuffersSwapped.
150 IPC_MESSAGE_ROUTED1(FrameHostMsg_BuffersSwappedACK,
151                     FrameHostMsg_BuffersSwappedACK_Params /* params */)
152
153 // Acknowledge that we presented an ubercomp frame.
154 //
155 // See FrameMsg_CompositorFrameSwapped
156 IPC_MESSAGE_ROUTED1(FrameHostMsg_CompositorFrameSwappedACK,
157                     FrameHostMsg_CompositorFrameSwappedACK_Params /* params */)
158
159 // Indicates that the current frame has swapped out, after a SwapOut message.
160 IPC_MESSAGE_ROUTED0(FrameHostMsg_SwapOut_ACK)
161
162 IPC_MESSAGE_ROUTED1(FrameHostMsg_ReclaimCompositorResources,
163                     FrameHostMsg_ReclaimCompositorResources_Params /* params */)
164
165 // Instructs the frame to swap out for a cross-site transition, including
166 // running the unload event handler. Expects a SwapOut_ACK message when
167 // finished.
168 IPC_MESSAGE_ROUTED0(FrameMsg_SwapOut)