ppapi_messages.h revision 4e180b6a0b4720a9b8e9e959a882386f690f08ff
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
3// found in the LICENSE file.
4
5// Multiply-included message header, no traditional include guard.
6#include <string>
7#include <vector>
8
9#include "base/basictypes.h"
10#include "base/files/file_path.h"
11#include "base/memory/shared_memory.h"
12#include "base/process/process.h"
13#include "base/strings/string16.h"
14#include "base/sync_socket.h"
15#include "base/values.h"
16#include "gpu/command_buffer/common/command_buffer.h"
17#include "gpu/ipc/gpu_command_buffer_traits.h"
18#include "ipc/ipc_channel_handle.h"
19#include "ipc/ipc_message_macros.h"
20#include "ipc/ipc_message_utils.h"
21#include "ipc/ipc_platform_file.h"
22#include "ppapi/c/dev/pp_video_capture_dev.h"
23#include "ppapi/c/dev/pp_video_dev.h"
24#include "ppapi/c/dev/ppb_truetype_font_dev.h"
25#include "ppapi/c/dev/ppb_url_util_dev.h"
26#include "ppapi/c/dev/ppp_printing_dev.h"
27#include "ppapi/c/pp_bool.h"
28#include "ppapi/c/pp_file_info.h"
29#include "ppapi/c/pp_instance.h"
30#include "ppapi/c/pp_module.h"
31#include "ppapi/c/pp_point.h"
32#include "ppapi/c/pp_rect.h"
33#include "ppapi/c/pp_resource.h"
34#include "ppapi/c/pp_size.h"
35#include "ppapi/c/pp_time.h"
36#include "ppapi/c/ppb_audio_config.h"
37#include "ppapi/c/ppb_image_data.h"
38#include "ppapi/c/ppb_tcp_socket.h"
39#include "ppapi/c/ppb_text_input_controller.h"
40#include "ppapi/c/ppb_udp_socket.h"
41#include "ppapi/c/private/pp_content_decryptor.h"
42#include "ppapi/c/private/pp_private_font_charset.h"
43#include "ppapi/c/private/ppb_flash.h"
44#include "ppapi/c/private/ppb_host_resolver_private.h"
45#include "ppapi/c/private/ppb_net_address_private.h"
46#include "ppapi/c/private/ppb_pdf.h"
47#include "ppapi/c/private/ppb_talk_private.h"
48#include "ppapi/c/private/ppp_flash_browser_operations.h"
49#include "ppapi/proxy/host_resolver_private_resource.h"
50#include "ppapi/proxy/network_list_resource.h"
51#include "ppapi/proxy/ppapi_param_traits.h"
52#include "ppapi/proxy/ppapi_proxy_export.h"
53#include "ppapi/proxy/resource_message_params.h"
54#include "ppapi/proxy/serialized_flash_menu.h"
55#include "ppapi/proxy/serialized_handle.h"
56#include "ppapi/proxy/serialized_structs.h"
57#include "ppapi/proxy/serialized_var.h"
58#include "ppapi/shared_impl/dir_contents.h"
59#include "ppapi/shared_impl/file_path.h"
60#include "ppapi/shared_impl/file_ref_create_info.h"
61#include "ppapi/shared_impl/ppapi_nacl_channel_args.h"
62#include "ppapi/shared_impl/ppapi_preferences.h"
63#include "ppapi/shared_impl/ppb_device_ref_shared.h"
64#include "ppapi/shared_impl/ppb_input_event_shared.h"
65#include "ppapi/shared_impl/ppb_tcp_socket_shared.h"
66#include "ppapi/shared_impl/ppb_view_shared.h"
67#include "ppapi/shared_impl/ppp_flash_browser_operations_shared.h"
68#include "ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h"
69#include "ppapi/shared_impl/socket_option_data.h"
70#include "ppapi/shared_impl/url_request_info_data.h"
71#include "ppapi/shared_impl/url_response_info_data.h"
72
73#undef IPC_MESSAGE_EXPORT
74#define IPC_MESSAGE_EXPORT PPAPI_PROXY_EXPORT
75
76#define IPC_MESSAGE_START PpapiMsgStart
77
78IPC_ENUM_TRAITS_MAX_VALUE(ppapi::TCPSocketVersion,
79                          ppapi::TCP_SOCKET_VERSION_1_1_OR_ABOVE)
80IPC_ENUM_TRAITS(PP_AudioSampleRate)
81IPC_ENUM_TRAITS(PP_DeviceType_Dev)
82IPC_ENUM_TRAITS(PP_DecryptorStreamType)
83IPC_ENUM_TRAITS(PP_FileSystemType)
84IPC_ENUM_TRAITS(PP_FileType)
85IPC_ENUM_TRAITS(PP_Flash_BrowserOperations_Permission)
86IPC_ENUM_TRAITS(PP_Flash_BrowserOperations_SettingType)
87IPC_ENUM_TRAITS(PP_FlashSetting)
88IPC_ENUM_TRAITS(PP_ImageDataFormat)
89IPC_ENUM_TRAITS(PP_InputEvent_MouseButton)
90IPC_ENUM_TRAITS(PP_InputEvent_Type)
91IPC_ENUM_TRAITS_MAX_VALUE(PP_NetAddressFamily_Private,
92                          PP_NETADDRESSFAMILY_PRIVATE_IPV6)
93IPC_ENUM_TRAITS_MAX_VALUE(PP_NetworkList_State, PP_NETWORKLIST_STATE_UP)
94IPC_ENUM_TRAITS_MAX_VALUE(PP_NetworkList_Type, PP_NETWORKLIST_TYPE_CELLULAR)
95IPC_ENUM_TRAITS(PP_PrintOrientation_Dev)
96IPC_ENUM_TRAITS(PP_PrintOutputFormat_Dev)
97IPC_ENUM_TRAITS(PP_PrintScalingOption_Dev)
98IPC_ENUM_TRAITS(PP_PrivateFontCharset)
99IPC_ENUM_TRAITS(PP_ResourceImage)
100IPC_ENUM_TRAITS(PP_ResourceString)
101IPC_ENUM_TRAITS_MAX_VALUE(PP_TalkEvent, PP_TALKEVENT_NUM_EVENTS - 1)
102IPC_ENUM_TRAITS_MAX_VALUE(PP_TalkPermission,
103                          PP_TALKPERMISSION_NUM_PERMISSIONS - 1)
104IPC_ENUM_TRAITS_MAX_VALUE(PP_TCPSocket_Option,
105                          PP_TCPSOCKET_OPTION_RECV_BUFFER_SIZE)
106IPC_ENUM_TRAITS(PP_TextInput_Type)
107IPC_ENUM_TRAITS(PP_TrueTypeFontFamily_Dev)
108IPC_ENUM_TRAITS(PP_TrueTypeFontStyle_Dev)
109IPC_ENUM_TRAITS(PP_TrueTypeFontWeight_Dev)
110IPC_ENUM_TRAITS(PP_TrueTypeFontWidth_Dev)
111IPC_ENUM_TRAITS(PP_TrueTypeFontCharset_Dev)
112IPC_ENUM_TRAITS_MAX_VALUE(PP_UDPSocket_Option,
113                          PP_UDPSOCKET_OPTION_RECV_BUFFER_SIZE)
114IPC_ENUM_TRAITS(PP_VideoDecodeError_Dev)
115IPC_ENUM_TRAITS(PP_VideoDecoder_Profile)
116
117IPC_STRUCT_TRAITS_BEGIN(PP_Point)
118  IPC_STRUCT_TRAITS_MEMBER(x)
119  IPC_STRUCT_TRAITS_MEMBER(y)
120IPC_STRUCT_TRAITS_END()
121
122IPC_STRUCT_TRAITS_BEGIN(PP_FloatPoint)
123  IPC_STRUCT_TRAITS_MEMBER(x)
124  IPC_STRUCT_TRAITS_MEMBER(y)
125IPC_STRUCT_TRAITS_END()
126
127IPC_STRUCT_TRAITS_BEGIN(PP_Size)
128  IPC_STRUCT_TRAITS_MEMBER(height)
129  IPC_STRUCT_TRAITS_MEMBER(width)
130IPC_STRUCT_TRAITS_END()
131
132IPC_STRUCT_TRAITS_BEGIN(PP_Rect)
133  IPC_STRUCT_TRAITS_MEMBER(point)
134  IPC_STRUCT_TRAITS_MEMBER(size)
135IPC_STRUCT_TRAITS_END()
136
137IPC_STRUCT_TRAITS_BEGIN(PP_ImageDataDesc)
138  IPC_STRUCT_TRAITS_MEMBER(format)
139  IPC_STRUCT_TRAITS_MEMBER(size)
140  IPC_STRUCT_TRAITS_MEMBER(stride)
141IPC_STRUCT_TRAITS_END()
142
143IPC_STRUCT_TRAITS_BEGIN(PP_PictureBuffer_Dev)
144  IPC_STRUCT_TRAITS_MEMBER(id)
145  IPC_STRUCT_TRAITS_MEMBER(size)
146  IPC_STRUCT_TRAITS_MEMBER(texture_id)
147IPC_STRUCT_TRAITS_END()
148
149IPC_STRUCT_TRAITS_BEGIN(PP_Picture_Dev)
150  IPC_STRUCT_TRAITS_MEMBER(picture_buffer_id)
151  IPC_STRUCT_TRAITS_MEMBER(bitstream_buffer_id)
152IPC_STRUCT_TRAITS_END()
153
154IPC_STRUCT_TRAITS_BEGIN(PP_PrintPageNumberRange_Dev)
155  IPC_STRUCT_TRAITS_MEMBER(first_page_number)
156  IPC_STRUCT_TRAITS_MEMBER(last_page_number)
157IPC_STRUCT_TRAITS_END()
158
159IPC_STRUCT_TRAITS_BEGIN(PP_VideoCaptureDeviceInfo_Dev)
160  IPC_STRUCT_TRAITS_MEMBER(width)
161  IPC_STRUCT_TRAITS_MEMBER(height)
162  IPC_STRUCT_TRAITS_MEMBER(frames_per_second)
163IPC_STRUCT_TRAITS_END()
164
165IPC_STRUCT_TRAITS_BEGIN(PP_HostResolver_Private_Hint)
166  IPC_STRUCT_TRAITS_MEMBER(family)
167  IPC_STRUCT_TRAITS_MEMBER(flags)
168IPC_STRUCT_TRAITS_END()
169
170IPC_STRUCT_TRAITS_BEGIN(PP_PrintSettings_Dev)
171  IPC_STRUCT_TRAITS_MEMBER(printable_area)
172  IPC_STRUCT_TRAITS_MEMBER(content_area)
173  IPC_STRUCT_TRAITS_MEMBER(paper_size)
174  IPC_STRUCT_TRAITS_MEMBER(dpi)
175  IPC_STRUCT_TRAITS_MEMBER(orientation)
176  IPC_STRUCT_TRAITS_MEMBER(print_scaling_option)
177  IPC_STRUCT_TRAITS_MEMBER(grayscale)
178  IPC_STRUCT_TRAITS_MEMBER(format)
179IPC_STRUCT_TRAITS_END()
180
181IPC_STRUCT_TRAITS_BEGIN(PP_URLComponent_Dev)
182  IPC_STRUCT_TRAITS_MEMBER(begin)
183  IPC_STRUCT_TRAITS_MEMBER(len)
184IPC_STRUCT_TRAITS_END()
185
186IPC_STRUCT_TRAITS_BEGIN(PP_URLComponents_Dev)
187  IPC_STRUCT_TRAITS_MEMBER(scheme)
188  IPC_STRUCT_TRAITS_MEMBER(username)
189  IPC_STRUCT_TRAITS_MEMBER(password)
190  IPC_STRUCT_TRAITS_MEMBER(host)
191  IPC_STRUCT_TRAITS_MEMBER(port)
192  IPC_STRUCT_TRAITS_MEMBER(path)
193  IPC_STRUCT_TRAITS_MEMBER(query)
194  IPC_STRUCT_TRAITS_MEMBER(ref)
195IPC_STRUCT_TRAITS_END()
196
197IPC_STRUCT_TRAITS_BEGIN(ppapi::DeviceRefData)
198  IPC_STRUCT_TRAITS_MEMBER(type)
199  IPC_STRUCT_TRAITS_MEMBER(name)
200  IPC_STRUCT_TRAITS_MEMBER(id)
201IPC_STRUCT_TRAITS_END()
202
203IPC_STRUCT_TRAITS_BEGIN(ppapi::DirEntry)
204  IPC_STRUCT_TRAITS_MEMBER(name)
205  IPC_STRUCT_TRAITS_MEMBER(is_dir)
206IPC_STRUCT_TRAITS_END()
207
208IPC_STRUCT_TRAITS_BEGIN(ppapi::FileRefCreateInfo)
209  IPC_STRUCT_TRAITS_MEMBER(file_system_type)
210  IPC_STRUCT_TRAITS_MEMBER(internal_path)
211  IPC_STRUCT_TRAITS_MEMBER(display_name)
212  IPC_STRUCT_TRAITS_MEMBER(browser_pending_host_resource_id)
213  IPC_STRUCT_TRAITS_MEMBER(renderer_pending_host_resource_id)
214  IPC_STRUCT_TRAITS_MEMBER(file_system_plugin_resource)
215IPC_STRUCT_TRAITS_END()
216
217IPC_STRUCT_TRAITS_BEGIN(ppapi::FlashSiteSetting)
218  IPC_STRUCT_TRAITS_MEMBER(site)
219  IPC_STRUCT_TRAITS_MEMBER(permission)
220IPC_STRUCT_TRAITS_END()
221
222IPC_STRUCT_TRAITS_BEGIN(ppapi::ViewData)
223  IPC_STRUCT_TRAITS_MEMBER(rect)
224  IPC_STRUCT_TRAITS_MEMBER(is_fullscreen)
225  IPC_STRUCT_TRAITS_MEMBER(is_page_visible)
226  IPC_STRUCT_TRAITS_MEMBER(clip_rect)
227  IPC_STRUCT_TRAITS_MEMBER(device_scale)
228  IPC_STRUCT_TRAITS_MEMBER(css_scale)
229IPC_STRUCT_TRAITS_END()
230
231IPC_STRUCT_TRAITS_BEGIN(PP_TouchPoint)
232  IPC_STRUCT_TRAITS_MEMBER(id)
233  IPC_STRUCT_TRAITS_MEMBER(position)
234  IPC_STRUCT_TRAITS_MEMBER(radius)
235  IPC_STRUCT_TRAITS_MEMBER(rotation_angle)
236  IPC_STRUCT_TRAITS_MEMBER(pressure)
237IPC_STRUCT_TRAITS_END()
238
239IPC_STRUCT_TRAITS_BEGIN(ppapi::Preferences)
240  IPC_STRUCT_TRAITS_MEMBER(standard_font_family_map)
241  IPC_STRUCT_TRAITS_MEMBER(fixed_font_family_map)
242  IPC_STRUCT_TRAITS_MEMBER(serif_font_family_map)
243  IPC_STRUCT_TRAITS_MEMBER(sans_serif_font_family_map)
244  IPC_STRUCT_TRAITS_MEMBER(default_font_size)
245  IPC_STRUCT_TRAITS_MEMBER(default_fixed_font_size)
246  IPC_STRUCT_TRAITS_MEMBER(number_of_cpu_cores)
247  IPC_STRUCT_TRAITS_MEMBER(is_3d_supported)
248  IPC_STRUCT_TRAITS_MEMBER(is_stage3d_supported)
249  IPC_STRUCT_TRAITS_MEMBER(is_stage3d_baseline_supported)
250IPC_STRUCT_TRAITS_END()
251
252IPC_STRUCT_TRAITS_BEGIN(ppapi::InputEventData)
253  IPC_STRUCT_TRAITS_MEMBER(is_filtered)
254  IPC_STRUCT_TRAITS_MEMBER(event_type)
255  IPC_STRUCT_TRAITS_MEMBER(event_time_stamp)
256  IPC_STRUCT_TRAITS_MEMBER(event_modifiers)
257  IPC_STRUCT_TRAITS_MEMBER(mouse_button)
258  IPC_STRUCT_TRAITS_MEMBER(mouse_position)
259  IPC_STRUCT_TRAITS_MEMBER(mouse_click_count)
260  IPC_STRUCT_TRAITS_MEMBER(mouse_movement)
261  IPC_STRUCT_TRAITS_MEMBER(wheel_delta)
262  IPC_STRUCT_TRAITS_MEMBER(wheel_ticks)
263  IPC_STRUCT_TRAITS_MEMBER(wheel_scroll_by_page)
264  IPC_STRUCT_TRAITS_MEMBER(key_code)
265  IPC_STRUCT_TRAITS_MEMBER(usb_key_code)
266  IPC_STRUCT_TRAITS_MEMBER(code)
267  IPC_STRUCT_TRAITS_MEMBER(character_text)
268  IPC_STRUCT_TRAITS_MEMBER(composition_segment_offsets)
269  IPC_STRUCT_TRAITS_MEMBER(composition_target_segment)
270  IPC_STRUCT_TRAITS_MEMBER(composition_selection_start)
271  IPC_STRUCT_TRAITS_MEMBER(composition_selection_end)
272  IPC_STRUCT_TRAITS_MEMBER(touches)
273  IPC_STRUCT_TRAITS_MEMBER(changed_touches)
274  IPC_STRUCT_TRAITS_MEMBER(target_touches)
275IPC_STRUCT_TRAITS_END()
276
277IPC_STRUCT_TRAITS_BEGIN(ppapi::HostPortPair)
278  IPC_STRUCT_TRAITS_MEMBER(host)
279  IPC_STRUCT_TRAITS_MEMBER(port)
280IPC_STRUCT_TRAITS_END()
281
282IPC_STRUCT_TRAITS_BEGIN(ppapi::URLRequestInfoData)
283  IPC_STRUCT_TRAITS_MEMBER(url)
284  IPC_STRUCT_TRAITS_MEMBER(method)
285  IPC_STRUCT_TRAITS_MEMBER(headers)
286  IPC_STRUCT_TRAITS_MEMBER(stream_to_file)
287  IPC_STRUCT_TRAITS_MEMBER(follow_redirects)
288  IPC_STRUCT_TRAITS_MEMBER(record_download_progress)
289  IPC_STRUCT_TRAITS_MEMBER(record_upload_progress)
290  IPC_STRUCT_TRAITS_MEMBER(has_custom_referrer_url)
291  IPC_STRUCT_TRAITS_MEMBER(custom_referrer_url)
292  IPC_STRUCT_TRAITS_MEMBER(allow_cross_origin_requests)
293  IPC_STRUCT_TRAITS_MEMBER(allow_credentials)
294  IPC_STRUCT_TRAITS_MEMBER(has_custom_content_transfer_encoding)
295  IPC_STRUCT_TRAITS_MEMBER(custom_content_transfer_encoding)
296  IPC_STRUCT_TRAITS_MEMBER(prefetch_buffer_upper_threshold)
297  IPC_STRUCT_TRAITS_MEMBER(prefetch_buffer_lower_threshold)
298  IPC_STRUCT_TRAITS_MEMBER(has_custom_user_agent)
299  IPC_STRUCT_TRAITS_MEMBER(custom_user_agent)
300  IPC_STRUCT_TRAITS_MEMBER(body)
301IPC_STRUCT_TRAITS_END()
302
303IPC_STRUCT_TRAITS_BEGIN(ppapi::URLRequestInfoData::BodyItem)
304  IPC_STRUCT_TRAITS_MEMBER(is_file)
305  IPC_STRUCT_TRAITS_MEMBER(data)
306  IPC_STRUCT_TRAITS_MEMBER(file_ref_pp_resource)
307  IPC_STRUCT_TRAITS_MEMBER(start_offset)
308  IPC_STRUCT_TRAITS_MEMBER(number_of_bytes)
309  IPC_STRUCT_TRAITS_MEMBER(expected_last_modified_time)
310IPC_STRUCT_TRAITS_END()
311
312IPC_STRUCT_TRAITS_BEGIN(ppapi::URLResponseInfoData)
313  IPC_STRUCT_TRAITS_MEMBER(url)
314  IPC_STRUCT_TRAITS_MEMBER(headers)
315  IPC_STRUCT_TRAITS_MEMBER(status_code)
316  IPC_STRUCT_TRAITS_MEMBER(status_text)
317  IPC_STRUCT_TRAITS_MEMBER(redirect_url)
318  IPC_STRUCT_TRAITS_MEMBER(body_as_file_ref)
319IPC_STRUCT_TRAITS_END()
320
321IPC_STRUCT_TRAITS_BEGIN(ppapi::proxy::SerializedNetworkInfo)
322  IPC_STRUCT_TRAITS_MEMBER(name)
323  IPC_STRUCT_TRAITS_MEMBER(type)
324  IPC_STRUCT_TRAITS_MEMBER(state)
325  IPC_STRUCT_TRAITS_MEMBER(addresses)
326  IPC_STRUCT_TRAITS_MEMBER(display_name)
327  IPC_STRUCT_TRAITS_MEMBER(mtu)
328IPC_STRUCT_TRAITS_END()
329
330// Only whitelisted switches passed through NaClChannelArgs.
331// The list of switches can be found in:
332//   chrome/browser/nacl_host/nacl_process_host.cc
333IPC_STRUCT_TRAITS_BEGIN(ppapi::PpapiNaClChannelArgs)
334  IPC_STRUCT_TRAITS_MEMBER(off_the_record)
335  IPC_STRUCT_TRAITS_MEMBER(permissions)
336  IPC_STRUCT_TRAITS_MEMBER(switch_names)
337  IPC_STRUCT_TRAITS_MEMBER(switch_values)
338IPC_STRUCT_TRAITS_END()
339
340#if !defined(OS_NACL) && !defined(NACL_WIN64)
341
342IPC_STRUCT_TRAITS_BEGIN(ppapi::proxy::PPPDecryptor_Buffer)
343  IPC_STRUCT_TRAITS_MEMBER(resource)
344  IPC_STRUCT_TRAITS_MEMBER(handle)
345  IPC_STRUCT_TRAITS_MEMBER(size)
346IPC_STRUCT_TRAITS_END()
347
348#endif  // !defined(OS_NACL) && !defined(NACL_WIN64)
349
350// These are from the browser to the plugin.
351// Loads the given plugin.
352IPC_MESSAGE_CONTROL2(PpapiMsg_LoadPlugin,
353                     base::FilePath /* path */,
354                     ppapi::PpapiPermissions /* permissions */)
355
356// Creates a channel to talk to a renderer. The plugin will respond with
357// PpapiHostMsg_ChannelCreated.
358IPC_MESSAGE_CONTROL3(PpapiMsg_CreateChannel,
359                     base::ProcessId /* renderer_pid */,
360                     int /* renderer_child_id */,
361                     bool /* incognito */)
362
363// Creates a channel to talk to a renderer. This message is only used by the
364// NaCl IPC proxy. It is intercepted by NaClIPCAdapter, which creates the
365// actual channel and rewrites the message for the untrusted side.
366IPC_MESSAGE_CONTROL3(PpapiMsg_CreateNaClChannel,
367                     int /* renderer_id */,
368                     ppapi::PpapiNaClChannelArgs /* args */,
369                     ppapi::proxy::SerializedHandle /* channel_handle */)
370
371// Instructs the plugin process to crash.
372IPC_MESSAGE_CONTROL0(PpapiMsg_Crash)
373
374// Instructs the plugin process to hang.
375IPC_MESSAGE_CONTROL0(PpapiMsg_Hang)
376
377// Each plugin may be referenced by multiple renderers. We need the instance
378// IDs to be unique within a plugin, despite coming from different renderers,
379// and unique within a renderer, despite going to different plugins. This means
380// that neither the renderer nor the plugin can generate instance IDs without
381// consulting the other.
382//
383// We resolve this by having the renderer generate a unique instance ID inside
384// its process. It then asks the plugin to reserve that ID by sending this sync
385// message. If the plugin has not yet seen this ID, it will remember it as used
386// (to prevent a race condition if another renderer tries to then use the same
387// instance), and set usable as true.
388//
389// If the plugin has already seen the instance ID, it will set usable as false
390// and the renderer must retry a new instance ID.
391IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_ReserveInstanceId,
392                            PP_Instance /* instance */,
393                            bool /* usable */)
394
395// Passes the WebKit preferences to the plugin.
396IPC_MESSAGE_CONTROL1(PpapiMsg_SetPreferences,
397                     ppapi::Preferences)
398
399// Sent in both directions to see if the other side supports the given
400// interface.
401IPC_SYNC_MESSAGE_CONTROL1_1(PpapiMsg_SupportsInterface,
402                            std::string /* interface_name */,
403                            bool /* result */)
404
405#if !defined(OS_NACL) && !defined(NACL_WIN64)
406// Network state notification from the browser for implementing
407// PPP_NetworkState_Dev.
408IPC_MESSAGE_CONTROL1(PpapiMsg_SetNetworkState,
409                     bool /* online */)
410
411// Requests a list of sites that have data stored from the plugin. The plugin
412// process will respond with PpapiHostMsg_GetSitesWithDataResult. This is used
413// for Flash.
414IPC_MESSAGE_CONTROL2(PpapiMsg_GetSitesWithData,
415                     uint32 /* request_id */,
416                     base::FilePath /* plugin_data_path */)
417IPC_MESSAGE_CONTROL2(PpapiHostMsg_GetSitesWithDataResult,
418                     uint32 /* request_id */,
419                     std::vector<std::string> /* sites */)
420
421// Instructs the plugin to clear data for the given site & time. The plugin
422// process will respond with PpapiHostMsg_ClearSiteDataResult. This is used
423// for Flash.
424IPC_MESSAGE_CONTROL5(PpapiMsg_ClearSiteData,
425                     uint32 /* request_id */,
426                     base::FilePath /* plugin_data_path */,
427                     std::string /* site */,
428                     uint64 /* flags */,
429                     uint64 /* max_age */)
430IPC_MESSAGE_CONTROL2(PpapiHostMsg_ClearSiteDataResult,
431                     uint32 /* request_id */,
432                     bool /* success */)
433
434IPC_MESSAGE_CONTROL2(PpapiMsg_DeauthorizeContentLicenses,
435                     uint32 /* request_id */,
436                     base::FilePath /* plugin_data_path */)
437IPC_MESSAGE_CONTROL2(PpapiHostMsg_DeauthorizeContentLicensesResult,
438                     uint32 /* request_id */,
439                     bool /* success */)
440
441IPC_MESSAGE_CONTROL3(PpapiMsg_GetPermissionSettings,
442                     uint32 /* request_id */,
443                     base::FilePath /* plugin_data_path */,
444                     PP_Flash_BrowserOperations_SettingType /* setting_type */)
445IPC_MESSAGE_CONTROL4(
446    PpapiHostMsg_GetPermissionSettingsResult,
447    uint32 /* request_id */,
448    bool /* success */,
449    PP_Flash_BrowserOperations_Permission /* default_permission */,
450    ppapi::FlashSiteSettings /* sites */)
451
452IPC_MESSAGE_CONTROL5(PpapiMsg_SetDefaultPermission,
453                     uint32 /* request_id */,
454                     base::FilePath /* plugin_data_path */,
455                     PP_Flash_BrowserOperations_SettingType /* setting_type */,
456                     PP_Flash_BrowserOperations_Permission /* permission */,
457                     bool /* clear_site_specific */)
458IPC_MESSAGE_CONTROL2(PpapiHostMsg_SetDefaultPermissionResult,
459                     uint32 /* request_id */,
460                     bool /* success */)
461
462IPC_MESSAGE_CONTROL4(PpapiMsg_SetSitePermission,
463                     uint32 /* request_id */,
464                     base::FilePath /* plugin_data_path */,
465                     PP_Flash_BrowserOperations_SettingType /* setting_type */,
466                     ppapi::FlashSiteSettings /* sites */)
467IPC_MESSAGE_CONTROL2(PpapiHostMsg_SetSitePermissionResult,
468                     uint32 /* request_id */,
469                     bool /* success */)
470
471// Broker Process.
472IPC_SYNC_MESSAGE_CONTROL2_1(PpapiMsg_ConnectToPlugin,
473                            PP_Instance /* instance */,
474                            IPC::PlatformFileForTransit /* handle */,
475                            int32_t /* result */)
476#endif  // !defined(OS_NACL) && !defined(NACL_WIN64)
477
478// PPB_Audio.
479
480// Notifies the result of the audio stream create call. This is called in
481// both error cases and in the normal success case. These cases are
482// differentiated by the result code, which is one of the standard PPAPI
483// result codes.
484//
485// The handler of this message should always close all of the handles passed
486// in, since some could be valid even in the error case.
487IPC_MESSAGE_ROUTED4(PpapiMsg_PPBAudio_NotifyAudioStreamCreated,
488                    ppapi::HostResource /* audio_id */,
489                    int32_t /* result_code (will be != PP_OK on failure) */,
490                    ppapi::proxy::SerializedHandle /* socket_handle */,
491                    ppapi::proxy::SerializedHandle /* handle */)
492
493// PPB_Graphics3D.
494IPC_MESSAGE_ROUTED2(PpapiMsg_PPBGraphics3D_SwapBuffersACK,
495                    ppapi::HostResource /* graphics_3d */,
496                    int32_t /* pp_error */)
497
498// PPB_ImageData.
499IPC_MESSAGE_ROUTED1(PpapiMsg_PPBImageData_NotifyUnusedImageData,
500                    ppapi::HostResource /* old_image_data */)
501
502// PPB_Instance.
503IPC_MESSAGE_ROUTED2(PpapiMsg_PPBInstance_MouseLockComplete,
504                    PP_Instance /* instance */,
505                    int32_t /* result */)
506
507// PPP_Class.
508IPC_SYNC_MESSAGE_ROUTED3_2(PpapiMsg_PPPClass_HasProperty,
509                           int64 /* ppp_class */,
510                           int64 /* object */,
511                           ppapi::proxy::SerializedVar /* property */,
512                           ppapi::proxy::SerializedVar /* out_exception */,
513                           bool /* result */)
514IPC_SYNC_MESSAGE_ROUTED3_2(PpapiMsg_PPPClass_HasMethod,
515                           int64 /* ppp_class */,
516                           int64 /* object */,
517                           ppapi::proxy::SerializedVar /* method */,
518                           ppapi::proxy::SerializedVar /* out_exception */,
519                           bool /* result */)
520IPC_SYNC_MESSAGE_ROUTED3_2(PpapiMsg_PPPClass_GetProperty,
521                           int64 /* ppp_class */,
522                           int64 /* object */,
523                           ppapi::proxy::SerializedVar /* property */,
524                           ppapi::proxy::SerializedVar /* out_exception */,
525                           ppapi::proxy::SerializedVar /* result */)
526IPC_SYNC_MESSAGE_ROUTED2_2(PpapiMsg_PPPClass_EnumerateProperties,
527                           int64 /* ppp_class */,
528                           int64 /* object */,
529                           std::vector<ppapi::proxy::SerializedVar> /* props */,
530                           ppapi::proxy::SerializedVar /* out_exception */)
531IPC_SYNC_MESSAGE_ROUTED4_1(PpapiMsg_PPPClass_SetProperty,
532                           int64 /* ppp_class */,
533                           int64 /* object */,
534                           ppapi::proxy::SerializedVar /* name */,
535                           ppapi::proxy::SerializedVar /* value */,
536                           ppapi::proxy::SerializedVar /* out_exception */)
537IPC_SYNC_MESSAGE_ROUTED3_1(PpapiMsg_PPPClass_RemoveProperty,
538                           int64 /* ppp_class */,
539                           int64 /* object */,
540                           ppapi::proxy::SerializedVar /* property */,
541                           ppapi::proxy::SerializedVar /* out_exception */)
542IPC_SYNC_MESSAGE_ROUTED4_2(PpapiMsg_PPPClass_Call,
543                           int64 /* ppp_class */,
544                           int64 /* object */,
545                           ppapi::proxy::SerializedVar /* method_name */,
546                           std::vector<ppapi::proxy::SerializedVar> /* args */,
547                           ppapi::proxy::SerializedVar /* out_exception */,
548                           ppapi::proxy::SerializedVar /* result */)
549IPC_SYNC_MESSAGE_ROUTED3_2(PpapiMsg_PPPClass_Construct,
550                           int64 /* ppp_class */,
551                           int64 /* object */,
552                           std::vector<ppapi::proxy::SerializedVar> /* args */,
553                           ppapi::proxy::SerializedVar /* out_exception */,
554                           ppapi::proxy::SerializedVar /* result */)
555IPC_MESSAGE_ROUTED2(PpapiMsg_PPPClass_Deallocate,
556                    int64 /* ppp_class */,
557                    int64 /* object */)
558
559// PPP_Graphics3D_Dev.
560IPC_MESSAGE_ROUTED1(PpapiMsg_PPPGraphics3D_ContextLost,
561                    PP_Instance /* instance */)
562
563// PPP_InputEvent.
564IPC_MESSAGE_ROUTED2(PpapiMsg_PPPInputEvent_HandleInputEvent,
565                    PP_Instance /* instance */,
566                    ppapi::InputEventData /* data */)
567IPC_SYNC_MESSAGE_ROUTED2_1(PpapiMsg_PPPInputEvent_HandleFilteredInputEvent,
568                           PP_Instance /* instance */,
569                           ppapi::InputEventData /* data */,
570                           PP_Bool /* result */)
571
572// PPP_Instance.
573IPC_SYNC_MESSAGE_ROUTED3_1(PpapiMsg_PPPInstance_DidCreate,
574                           PP_Instance /* instance */,
575                           std::vector<std::string> /* argn */,
576                           std::vector<std::string> /* argv */,
577                           PP_Bool /* result */)
578IPC_SYNC_MESSAGE_ROUTED1_0(PpapiMsg_PPPInstance_DidDestroy,
579                           PP_Instance /* instance */)
580IPC_MESSAGE_ROUTED3(PpapiMsg_PPPInstance_DidChangeView,
581                    PP_Instance /* instance */,
582                    ppapi::ViewData /* new_data */,
583                    PP_Bool /* flash_fullscreen */)
584IPC_MESSAGE_ROUTED2(PpapiMsg_PPPInstance_DidChangeFocus,
585                    PP_Instance /* instance */,
586                    PP_Bool /* has_focus */)
587IPC_MESSAGE_ROUTED3(PpapiMsg_PPPInstance_HandleDocumentLoad,
588    PP_Instance /* instance */,
589    int /* pending_loader_host_id */,
590    ppapi::URLResponseInfoData /* response */)
591
592// PPP_Messaging.
593IPC_MESSAGE_ROUTED2(PpapiMsg_PPPMessaging_HandleMessage,
594                    PP_Instance /* instance */,
595                    ppapi::proxy::SerializedVar /* message */)
596
597// PPP_MouseLock.
598IPC_MESSAGE_ROUTED1(PpapiMsg_PPPMouseLock_MouseLockLost,
599                    PP_Instance /* instance */)
600
601// PPP_Printing
602IPC_SYNC_MESSAGE_ROUTED1_1(PpapiMsg_PPPPrinting_QuerySupportedFormats,
603                           PP_Instance /* instance */,
604                           uint32_t /* result */)
605IPC_SYNC_MESSAGE_ROUTED2_1(PpapiMsg_PPPPrinting_Begin,
606                           PP_Instance /* instance */,
607                           std::string /* settings_string */,
608                           int32_t /* result */)
609IPC_SYNC_MESSAGE_ROUTED2_1(PpapiMsg_PPPPrinting_PrintPages,
610                           PP_Instance /* instance */,
611                           std::vector<PP_PrintPageNumberRange_Dev> /* pages */,
612                           ppapi::HostResource /* result */)
613IPC_MESSAGE_ROUTED1(PpapiMsg_PPPPrinting_End,
614                    PP_Instance /* instance */)
615IPC_SYNC_MESSAGE_ROUTED1_1(PpapiMsg_PPPPrinting_IsScalingDisabled,
616                           PP_Instance /* instance */,
617                           bool /* result */)
618
619// PPP_TextInput.
620IPC_MESSAGE_ROUTED2(PpapiMsg_PPPTextInput_RequestSurroundingText,
621                   PP_Instance /* instance */,
622                   uint32_t /* desired_number_of_characters */)
623
624#if !defined(OS_NACL) && !defined(NACL_WIN64)
625// PPB_Broker.
626IPC_MESSAGE_ROUTED3(
627    PpapiMsg_PPBBroker_ConnectComplete,
628    ppapi::HostResource /* broker */,
629    IPC::PlatformFileForTransit /* handle */,
630    int32_t /* result */)
631
632// PPP_ContentDecryptor_Dev
633IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_Initialize,
634                    PP_Instance /* instance */,
635                    ppapi::proxy::SerializedVar /* key_system, String */,
636                    bool /* can_challenge_platform */)
637IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_GenerateKeyRequest,
638                    PP_Instance /* instance */,
639                    ppapi::proxy::SerializedVar /* type, String */,
640                    ppapi::proxy::SerializedVar /* init_data, ArrayBuffer */)
641IPC_MESSAGE_ROUTED4(PpapiMsg_PPPContentDecryptor_AddKey,
642                    PP_Instance /* instance */,
643                    ppapi::proxy::SerializedVar /* session_id, String */,
644                    ppapi::proxy::SerializedVar /* key, ArrayBuffer */,
645                    ppapi::proxy::SerializedVar /* init_data, ArrayBuffer */)
646IPC_MESSAGE_ROUTED2(PpapiMsg_PPPContentDecryptor_CancelKeyRequest,
647                    PP_Instance /* instance */,
648                    ppapi::proxy::SerializedVar /* session_id, String */)
649IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_Decrypt,
650                    PP_Instance /* instance */,
651                    ppapi::proxy::PPPDecryptor_Buffer /* buffer */,
652                    std::string /* serialized_block_info */)
653IPC_MESSAGE_ROUTED3(
654    PpapiMsg_PPPContentDecryptor_InitializeAudioDecoder,
655    PP_Instance /* instance */,
656    std::string /* serialized_decoder_config */,
657    ppapi::proxy::PPPDecryptor_Buffer /* extra_data_buffer */)
658IPC_MESSAGE_ROUTED3(
659    PpapiMsg_PPPContentDecryptor_InitializeVideoDecoder,
660    PP_Instance /* instance */,
661    std::string /* serialized_decoder_config */,
662    ppapi::proxy::PPPDecryptor_Buffer /* extra_data_buffer. */)
663IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_DeinitializeDecoder,
664                    PP_Instance /* instance */,
665                    PP_DecryptorStreamType /* decoder_type */,
666                    uint32_t /* request_id */)
667IPC_MESSAGE_ROUTED3(PpapiMsg_PPPContentDecryptor_ResetDecoder,
668                    PP_Instance /* instance */,
669                    PP_DecryptorStreamType /* decoder_type */,
670                    uint32_t /* request_id */)
671IPC_MESSAGE_ROUTED4(PpapiMsg_PPPContentDecryptor_DecryptAndDecode,
672                    PP_Instance /* instance */,
673                    PP_DecryptorStreamType /* decoder_type */,
674                    ppapi::proxy::PPPDecryptor_Buffer /* buffer */,
675                    std::string /* serialized_block_info */)
676#endif  // !defined(OS_NACL) && !defined(NACL_WIN64)
677
678#if !defined(OS_NACL) && !defined(NACL_WIN64)
679// PPP_Instance_Private.
680IPC_SYNC_MESSAGE_ROUTED1_1(PpapiMsg_PPPInstancePrivate_GetInstanceObject,
681                           PP_Instance /* instance */,
682                           ppapi::proxy::SerializedVar /* result */)
683
684// PPB_VideoDecoder_Dev.
685// (Messages from renderer to plugin to notify it to run callbacks.)
686IPC_MESSAGE_ROUTED3(PpapiMsg_PPBVideoDecoder_EndOfBitstreamACK,
687                    ppapi::HostResource /* video_decoder */,
688                    int32_t /* bitstream buffer id */,
689                    int32_t /* PP_CompletionCallback result */)
690IPC_MESSAGE_ROUTED2(PpapiMsg_PPBVideoDecoder_FlushACK,
691                    ppapi::HostResource /* video_decoder */,
692                    int32_t /* PP_CompletionCallback result  */)
693IPC_MESSAGE_ROUTED2(PpapiMsg_PPBVideoDecoder_ResetACK,
694                    ppapi::HostResource /* video_decoder */,
695                    int32_t /* PP_CompletionCallback result */)
696
697// PPP_VideoDecoder_Dev.
698IPC_MESSAGE_ROUTED4(PpapiMsg_PPPVideoDecoder_ProvidePictureBuffers,
699                    ppapi::HostResource /* video_decoder */,
700                    uint32_t /* requested number of buffers */,
701                    PP_Size /* dimensions of buffers */,
702                    uint32_t /* texture_target */)
703IPC_MESSAGE_ROUTED2(PpapiMsg_PPPVideoDecoder_DismissPictureBuffer,
704                    ppapi::HostResource /* video_decoder */,
705                    int32_t /* picture buffer id */)
706IPC_MESSAGE_ROUTED2(PpapiMsg_PPPVideoDecoder_PictureReady,
707                    ppapi::HostResource /* video_decoder */,
708                    PP_Picture_Dev /* output picture */)
709IPC_MESSAGE_ROUTED2(PpapiMsg_PPPVideoDecoder_NotifyError,
710                    ppapi::HostResource /* video_decoder */,
711                    PP_VideoDecodeError_Dev /* error */)
712#endif  // !defined(OS_NACL) && !defined(NACL_WIN64)
713
714// -----------------------------------------------------------------------------
715// These are from the plugin to the renderer.
716
717// Reply to PpapiMsg_CreateChannel. The handle will be NULL if the channel
718// could not be established. This could be because the IPC could not be created
719// for some weird reason, but more likely that the plugin failed to load or
720// initialize properly.
721IPC_MESSAGE_CONTROL1(PpapiHostMsg_ChannelCreated,
722                     IPC::ChannelHandle /* handle */)
723
724// Logs the given message to the console of all instances.
725IPC_MESSAGE_CONTROL4(PpapiHostMsg_LogWithSource,
726                     PP_Instance /* instance */,
727                     int /* log_level */,
728                     std::string /* source */,
729                     std::string /* value */)
730
731// PPB_Audio.
732IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBAudio_Create,
733                           PP_Instance /* instance_id */,
734                           int32_t /* sample_rate */,
735                           uint32_t /* sample_frame_count */,
736                           ppapi::HostResource /* result */)
737IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBAudio_StartOrStop,
738                    ppapi::HostResource /* audio_id */,
739                    bool /* play */)
740
741// PPB_Core.
742IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBCore_AddRefResource,
743                    ppapi::HostResource)
744IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBCore_ReleaseResource,
745                    ppapi::HostResource)
746
747// PPB_Graphics3D.
748IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBGraphics3D_Create,
749                           PP_Instance /* instance */,
750                           ppapi::HostResource /* share_context */,
751                           std::vector<int32_t> /* attrib_list */,
752                           ppapi::HostResource /* result */)
753IPC_SYNC_MESSAGE_ROUTED2_0(PpapiHostMsg_PPBGraphics3D_SetGetBuffer,
754                           ppapi::HostResource /* context */,
755                           int32 /* transfer_buffer_id */)
756IPC_SYNC_MESSAGE_ROUTED1_2(PpapiHostMsg_PPBGraphics3D_GetState,
757                           ppapi::HostResource /* context */,
758                           gpu::CommandBuffer::State /* state */,
759                           bool /* success */)
760IPC_SYNC_MESSAGE_ROUTED3_2(PpapiHostMsg_PPBGraphics3D_Flush,
761                           ppapi::HostResource /* context */,
762                           int32 /* put_offset */,
763                           int32 /* last_known_get */,
764                           gpu::CommandBuffer::State /* state */,
765                           bool /* success */)
766IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBGraphics3D_AsyncFlush,
767                    ppapi::HostResource /* context */,
768                    int32 /* put_offset */)
769IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBGraphics3D_CreateTransferBuffer,
770                           ppapi::HostResource /* context */,
771                           uint32 /* size */,
772                           int32 /* id */)
773IPC_SYNC_MESSAGE_ROUTED2_0(PpapiHostMsg_PPBGraphics3D_DestroyTransferBuffer,
774                           ppapi::HostResource /* context */,
775                           int32 /* id */)
776IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBGraphics3D_GetTransferBuffer,
777                           ppapi::HostResource /* context */,
778                           int32 /* id */,
779                           ppapi::proxy::SerializedHandle /* transfer_buffer */)
780IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBGraphics3D_SwapBuffers,
781                    ppapi::HostResource /* graphics_3d */)
782IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBGraphics3D_InsertSyncPoint,
783                           ppapi::HostResource /* context */,
784                           uint32 /* sync_point */)
785
786// PPB_ImageData.
787IPC_SYNC_MESSAGE_ROUTED4_3(PpapiHostMsg_PPBImageData_CreatePlatform,
788                           PP_Instance /* instance */,
789                           int32 /* format */,
790                           PP_Size /* size */,
791                           PP_Bool /* init_to_zero */,
792                           ppapi::HostResource /* result_resource */,
793                           PP_ImageDataDesc /* image_data_desc */,
794                           ppapi::proxy::ImageHandle /* result */)
795IPC_SYNC_MESSAGE_ROUTED4_3(PpapiHostMsg_PPBImageData_CreateSimple,
796                           PP_Instance /* instance */,
797                           int32 /* format */,
798                           PP_Size /* size */,
799                           PP_Bool /* init_to_zero */,
800                           ppapi::HostResource /* result_resource */,
801                           PP_ImageDataDesc /* image_data_desc */,
802                           ppapi::proxy::SerializedHandle /* result */)
803
804// PPB_Instance.
805IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_GetWindowObject,
806                           PP_Instance /* instance */,
807                           ppapi::proxy::SerializedVar /* result */)
808IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_GetOwnerElementObject,
809                           PP_Instance /* instance */,
810                           ppapi::proxy::SerializedVar /* result */)
811IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBInstance_BindGraphics,
812                    PP_Instance /* instance */,
813                    PP_Resource /* device */)
814IPC_SYNC_MESSAGE_ROUTED1_1(
815    PpapiHostMsg_PPBInstance_GetAudioHardwareOutputSampleRate,
816                           PP_Instance /* instance */,
817                           uint32_t /* result */)
818IPC_SYNC_MESSAGE_ROUTED1_1(
819    PpapiHostMsg_PPBInstance_GetAudioHardwareOutputBufferSize,
820                           PP_Instance /* instance */,
821                           uint32_t /* result */)
822IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_IsFullFrame,
823                           PP_Instance /* instance */,
824                           PP_Bool /* result */)
825IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBInstance_ExecuteScript,
826                           PP_Instance /* instance */,
827                           ppapi::proxy::SerializedVar /* script */,
828                           ppapi::proxy::SerializedVar /* out_exception */,
829                           ppapi::proxy::SerializedVar /* result */)
830IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_GetDefaultCharSet,
831                           PP_Instance /* instance */,
832                           ppapi::proxy::SerializedVar /* result */)
833IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBInstance_SetFullscreen,
834                           PP_Instance /* instance */,
835                           PP_Bool /* fullscreen */,
836                           PP_Bool /* result */)
837IPC_SYNC_MESSAGE_ROUTED1_2(PpapiHostMsg_PPBInstance_GetScreenSize,
838                           PP_Instance /* instance */,
839                           PP_Bool /* result */,
840                           PP_Size /* size */)
841IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_RequestInputEvents,
842                    PP_Instance /* instance */,
843                    bool /* is_filtering */,
844                    uint32_t /* event_classes */)
845IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBInstance_ClearInputEvents,
846                    PP_Instance /* instance */,
847                    uint32_t /* event_classes */)
848IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBInstance_PostMessage,
849                    PP_Instance /* instance */,
850                    ppapi::proxy::SerializedVar /* message */)
851IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBInstance_LockMouse,
852                    PP_Instance /* instance */)
853IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBInstance_UnlockMouse,
854                    PP_Instance /* instance */)
855IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBInstance_ResolveRelativeToDocument,
856                           PP_Instance /* instance */,
857                           ppapi::proxy::SerializedVar /* relative */,
858                           ppapi::proxy::SerializedVar /* result */)
859IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBInstance_DocumentCanRequest,
860                           PP_Instance /* instance */,
861                           ppapi::proxy::SerializedVar /* relative */,
862                           PP_Bool /* result */)
863IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBInstance_DocumentCanAccessDocument,
864                           PP_Instance /* active */,
865                           PP_Instance /* target */,
866                           PP_Bool /* result */)
867IPC_SYNC_MESSAGE_ROUTED1_2(PpapiHostMsg_PPBInstance_GetDocumentURL,
868                           PP_Instance /* active */,
869                           PP_URLComponents_Dev /* components */,
870                           ppapi::proxy::SerializedVar /* result */)
871IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_GetPluginInstanceURL,
872                           PP_Instance /* active */,
873                           ppapi::proxy::SerializedVar /* result */)
874IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBInstance_GetPluginReferrerURL,
875                           PP_Instance /* instance */,
876                           ppapi::proxy::SerializedVar /* result */)
877IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBInstance_SetCursor,
878                    PP_Instance /* instance */,
879                    int32_t /* type */,
880                    ppapi::HostResource /* custom_image */,
881                    PP_Point /* hot_spot */)
882IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBInstance_SetTextInputType,
883                    PP_Instance /* instance */,
884                    PP_TextInput_Type /* type */)
885IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_UpdateCaretPosition,
886                    PP_Instance /* instance */,
887                    PP_Rect /* caret */,
888                    PP_Rect /* bounding_box */)
889IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBInstance_CancelCompositionText,
890                    PP_Instance /* instance */)
891IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBInstance_UpdateSurroundingText,
892                    PP_Instance /* instance */,
893                    std::string /* text */,
894                    uint32_t /* caret */,
895                    uint32_t /* anchor */)
896
897// PPB_Var.
898IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBVar_AddRefObject,
899                           int64 /* object_id */,
900                           int /* unused - need a return value for sync msgs */)
901IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBVar_ReleaseObject,
902                    int64 /* object_id */)
903IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_HasProperty,
904                           ppapi::proxy::SerializedVar /* object */,
905                           ppapi::proxy::SerializedVar /* property */,
906                           ppapi::proxy::SerializedVar /* out_exception */,
907                           PP_Bool /* result */)
908IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_HasMethodDeprecated,
909                           ppapi::proxy::SerializedVar /* object */,
910                           ppapi::proxy::SerializedVar /* method */,
911                           ppapi::proxy::SerializedVar /* out_exception */,
912                           PP_Bool /* result */)
913IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_GetProperty,
914                           ppapi::proxy::SerializedVar /* object */,
915                           ppapi::proxy::SerializedVar /* property */,
916                           ppapi::proxy::SerializedVar /* out_exception */,
917                           ppapi::proxy::SerializedVar /* result */)
918IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_DeleteProperty,
919                           ppapi::proxy::SerializedVar /* object */,
920                           ppapi::proxy::SerializedVar /* property */,
921                           ppapi::proxy::SerializedVar /* out_exception */,
922                           PP_Bool /* result */)
923IPC_SYNC_MESSAGE_ROUTED1_2(PpapiHostMsg_PPBVar_EnumerateProperties,
924                           ppapi::proxy::SerializedVar /* object */,
925                           std::vector<ppapi::proxy::SerializedVar> /* props */,
926                           ppapi::proxy::SerializedVar /* out_exception */)
927IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBVar_SetPropertyDeprecated,
928                           ppapi::proxy::SerializedVar /* object */,
929                           ppapi::proxy::SerializedVar /* name */,
930                           ppapi::proxy::SerializedVar /* value */,
931                           ppapi::proxy::SerializedVar /* out_exception */)
932IPC_SYNC_MESSAGE_ROUTED3_2(PpapiHostMsg_PPBVar_CallDeprecated,
933                           ppapi::proxy::SerializedVar /* object */,
934                           ppapi::proxy::SerializedVar /* method_name */,
935                           std::vector<ppapi::proxy::SerializedVar> /* args */,
936                           ppapi::proxy::SerializedVar /* out_exception */,
937                           ppapi::proxy::SerializedVar /* result */)
938IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_Construct,
939                           ppapi::proxy::SerializedVar /* object */,
940                           std::vector<ppapi::proxy::SerializedVar> /* args */,
941                           ppapi::proxy::SerializedVar /* out_exception */,
942                           ppapi::proxy::SerializedVar /* result */)
943IPC_SYNC_MESSAGE_ROUTED2_2(PpapiHostMsg_PPBVar_IsInstanceOfDeprecated,
944                           ppapi::proxy::SerializedVar /* var */,
945                           int64 /* object_class */,
946                           int64 /* object-data */,
947                           PP_Bool /* result */)
948IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBVar_CreateObjectDeprecated,
949                           PP_Instance /* instance */,
950                           int64 /* object_class */,
951                           int64 /* object_data */,
952                           ppapi::proxy::SerializedVar /* result */)
953
954#if !defined(OS_NACL) && !defined(NACL_WIN64)
955// PPB_Broker.
956IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBBroker_Create,
957                           PP_Instance /* instance */,
958                           ppapi::HostResource /* result_resource */)
959IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBBroker_Connect,
960                    ppapi::HostResource /* broker */)
961
962// PPB_Buffer.
963IPC_SYNC_MESSAGE_ROUTED2_2(
964    PpapiHostMsg_PPBBuffer_Create,
965    PP_Instance /* instance */,
966    uint32_t /* size */,
967    ppapi::HostResource /* result_resource */,
968    ppapi::proxy::SerializedHandle /* result_shm_handle */)
969
970// PPB_ContentDecryptor_Dev messages handled in PPB_Instance_Proxy.
971IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_KeyAdded,
972                    PP_Instance /* instance */,
973                    ppapi::proxy::SerializedVar /* key_system, String */,
974                    ppapi::proxy::SerializedVar /* session_id, String */)
975IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBInstance_KeyMessage,
976                    PP_Instance /* instance */,
977                    ppapi::proxy::SerializedVar /* key_system, String */,
978                    ppapi::proxy::SerializedVar /* session_id, String */,
979                    ppapi::proxy::SerializedVar /* message, ArrayBuffer */,
980                    ppapi::proxy::SerializedVar /* default_url, String */)
981IPC_MESSAGE_ROUTED5(PpapiHostMsg_PPBInstance_KeyError,
982                    PP_Instance /* instance */,
983                    ppapi::proxy::SerializedVar /* key_system, String */,
984                    ppapi::proxy::SerializedVar /* session_id, String */,
985                    int32_t /* media_error */,
986                    int32_t /* system_code */)
987IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_DeliverBlock,
988                    PP_Instance /* instance */,
989                    PP_Resource /* decrypted_block, PPB_Buffer_Dev */,
990                    std::string /* serialized_block_info */)
991IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBInstance_DecoderInitializeDone,
992                    PP_Instance /* instance */,
993                    PP_DecryptorStreamType /* decoder_type */,
994                    uint32_t /* request_id */,
995                    PP_Bool /* success */)
996IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_DecoderDeinitializeDone,
997                    PP_Instance /* instance */,
998                    PP_DecryptorStreamType /* decoder_type */,
999                    uint32_t /* request_id */)
1000IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_DecoderResetDone,
1001                    PP_Instance /* instance */,
1002                    PP_DecryptorStreamType /* decoder_type */,
1003                    uint32_t /* request_id */)
1004IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_DeliverFrame,
1005                    PP_Instance /* instance */,
1006                    PP_Resource /* decrypted_frame, PPB_Buffer_Dev */,
1007                    std::string /* serialized_block_info */)
1008IPC_MESSAGE_ROUTED3(PpapiHostMsg_PPBInstance_DeliverSamples,
1009                    PP_Instance /* instance */,
1010                    PP_Resource /* audio_frames, PPB_Buffer_Dev */,
1011                    std::string /* serialized_block_info */)
1012#endif  // !defined(OS_NACL) && !defined(NACL_WIN64)
1013
1014// PPB_Testing.
1015IPC_SYNC_MESSAGE_ROUTED3_1(
1016    PpapiHostMsg_PPBTesting_ReadImageData,
1017    ppapi::HostResource /* device_context_2d */,
1018    ppapi::HostResource /* image */,
1019    PP_Point /* top_left */,
1020    PP_Bool /* result */)
1021IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBTesting_GetLiveObjectsForInstance,
1022                           PP_Instance /* instance */,
1023                           uint32 /* result */)
1024IPC_SYNC_MESSAGE_ROUTED2_0(PpapiHostMsg_PPBTesting_SimulateInputEvent,
1025                           PP_Instance /* instance */,
1026                           ppapi::InputEventData /* input_event */)
1027IPC_SYNC_MESSAGE_ROUTED1_0(
1028    PpapiHostMsg_PPBTesting_SetMinimumArrayBufferSizeForShmem,
1029    uint32_t /* threshold */)
1030
1031#if !defined(OS_NACL) && !defined(NACL_WIN64)
1032
1033// PPB_VideoDecoder.
1034IPC_SYNC_MESSAGE_ROUTED3_1(PpapiHostMsg_PPBVideoDecoder_Create,
1035                           PP_Instance /* instance */,
1036                           ppapi::HostResource /* context */,
1037                           PP_VideoDecoder_Profile /* profile */,
1038                           ppapi::HostResource /* result */)
1039IPC_MESSAGE_ROUTED4(PpapiHostMsg_PPBVideoDecoder_Decode,
1040                    ppapi::HostResource /* video_decoder */,
1041                    ppapi::HostResource /* bitstream buffer */,
1042                    int32 /* bitstream buffer id */,
1043                    uint32 /* size of buffer */)
1044IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBVideoDecoder_AssignPictureBuffers,
1045                    ppapi::HostResource /* video_decoder */,
1046                    std::vector<PP_PictureBuffer_Dev> /* picture buffers */)
1047IPC_MESSAGE_ROUTED2(PpapiHostMsg_PPBVideoDecoder_ReusePictureBuffer,
1048                    ppapi::HostResource /* video_decoder */,
1049                    int32_t /* picture buffer id */)
1050IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBVideoDecoder_Flush,
1051                    ppapi::HostResource /* video_decoder */)
1052IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBVideoDecoder_Reset,
1053                    ppapi::HostResource /* video_decoder */)
1054IPC_SYNC_MESSAGE_ROUTED1_0(PpapiHostMsg_PPBVideoDecoder_Destroy,
1055                           ppapi::HostResource /* video_decoder */)
1056
1057// PPB_Flash_MessageLoop.
1058IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBFlashMessageLoop_Create,
1059                           PP_Instance /* instance */,
1060                           ppapi::HostResource /* result */)
1061IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBFlashMessageLoop_Run,
1062                           ppapi::HostResource /* flash_message_loop */,
1063                           int32_t /* result */)
1064IPC_SYNC_MESSAGE_ROUTED1_0(PpapiHostMsg_PPBFlashMessageLoop_Quit,
1065                           ppapi::HostResource /* flash_message_loop */)
1066#endif  // !defined(OS_NACL) && !defined(NACL_WIN64)
1067
1068// PPB_X509Certificate_Private
1069IPC_SYNC_MESSAGE_CONTROL1_2(PpapiHostMsg_PPBX509Certificate_ParseDER,
1070                            std::vector<char> /* der */,
1071                            bool /* succeeded */,
1072                            ppapi::PPB_X509Certificate_Fields /* result */)
1073
1074//-----------------------------------------------------------------------------
1075// Resource call/reply messages.
1076//
1077// These are the new-style resource implementations where the resource is only
1078// implemented in the proxy and "resource messages" are sent between this and a
1079// host object. Resource messages are a wrapper around some general routing
1080// information and a separate message of a type defined by the specific resource
1081// sending/receiving it. The extra paremeters allow the nested message to be
1082// routed automatically to the correct resource.
1083
1084// Notification that a resource has been created in the plugin. The nested
1085// message will be resource-type-specific.
1086IPC_MESSAGE_CONTROL3(PpapiHostMsg_ResourceCreated,
1087                     ppapi::proxy::ResourceMessageCallParams /* call_params */,
1088                     PP_Instance  /* instance */,
1089                     IPC::Message /* nested_msg */)
1090
1091// Notification that a resource has been destroyed in the plugin.
1092IPC_MESSAGE_CONTROL1(PpapiHostMsg_ResourceDestroyed,
1093                     PP_Resource /* resource */)
1094
1095// Most resources are created by the plugin, which then sends a ResourceCreated
1096// message to create a corresponding ResourceHost in the renderer or browser
1097// host process. However, some resources are first created in the host and
1098// "pushed" or returned to the plugin.
1099//
1100// In this case, the host will create a "pending" ResourceHost object which
1101// is identified by an ID. The ID is sent to the plugin process and the
1102// PluginResource object is created. This message is sent from the plugin to
1103// the host process to connect the PluginResource and the pending ResourceHost
1104// (at which point, it's no longer pending).
1105IPC_MESSAGE_CONTROL2(PpapiHostMsg_AttachToPendingHost,
1106                     PP_Resource /* resource */,
1107                     int /* pending_host_id */)
1108
1109// A resource call is a request from the plugin to the host. It may or may not
1110// require a reply, depending on the params. The nested message will be
1111// resource-type-specific.
1112IPC_MESSAGE_CONTROL2(PpapiHostMsg_ResourceCall,
1113                     ppapi::proxy::ResourceMessageCallParams /* call_params */,
1114                     IPC::Message /* nested_msg */)
1115IPC_MESSAGE_CONTROL3(PpapiHostMsg_InProcessResourceCall,
1116                     int /* routing_id */,
1117                     ppapi::proxy::ResourceMessageCallParams /* call_params */,
1118                     IPC::Message /* nested_msg */)
1119
1120// A resource reply is a response to a ResourceCall from a host to the
1121// plugin. The resource ID + sequence number in the params will correspond to
1122// that of the previous ResourceCall.
1123IPC_MESSAGE_CONTROL2(
1124    PpapiPluginMsg_ResourceReply,
1125    ppapi::proxy::ResourceMessageReplyParams /* reply_params */,
1126    IPC::Message /* nested_msg */)
1127IPC_MESSAGE_ROUTED2(
1128    PpapiHostMsg_InProcessResourceReply,
1129    ppapi::proxy::ResourceMessageReplyParams /* reply_params */,
1130    IPC::Message /* nested_msg */)
1131
1132IPC_SYNC_MESSAGE_CONTROL2_2(PpapiHostMsg_ResourceSyncCall,
1133    ppapi::proxy::ResourceMessageCallParams /* call_params */,
1134    IPC::Message /* nested_msg */,
1135    ppapi::proxy::ResourceMessageReplyParams /* reply_params */,
1136    IPC::Message /* reply_msg */)
1137
1138// This message is sent from the renderer to the browser when it wants to create
1139// ResourceHosts in the browser. It contains the process ID of the plugin and
1140// the instance of the plugin for which to create the resource for. params
1141// contains the sequence number for the message to track the response.
1142// The nested messages are ResourceHost creation messages.
1143IPC_MESSAGE_CONTROL5(
1144    PpapiHostMsg_CreateResourceHostsFromHost,
1145    int /* routing_id */,
1146    int /* child_process_id */,
1147    ppapi::proxy::ResourceMessageCallParams /* params */,
1148    PP_Instance /* instance */,
1149    std::vector<IPC::Message> /* nested_msgs */)
1150
1151// This message is sent from the browser to the renderer when it has created
1152// ResourceHosts for the renderer. It contains the sequence number that was sent
1153// in the request and the IDs of the pending ResourceHosts which were created in
1154// the browser. These IDs are only useful for the plugin which can attach to the
1155// ResourceHosts in the browser.
1156IPC_MESSAGE_ROUTED2(
1157    PpapiHostMsg_CreateResourceHostsFromHostReply,
1158    int32_t /* sequence */,
1159    std::vector<int> /* pending_host_ids */)
1160
1161//-----------------------------------------------------------------------------
1162// Messages for resources using call/reply above.
1163
1164// Broker ----------------------------------------------------------------------
1165IPC_MESSAGE_CONTROL0(PpapiHostMsg_Broker_Create)
1166
1167// Queries whether the plugin has permission to connect to the Pepper broker.
1168// The response is contained in the error value of the
1169// ResourceMessageReplyParams in the reply message.
1170IPC_MESSAGE_CONTROL0(PpapiHostMsg_Broker_IsAllowed)
1171
1172// Extensions common -----------------------------------------------------------
1173IPC_MESSAGE_CONTROL0(PpapiHostMsg_ExtensionsCommon_Create)
1174
1175// Starts an extension API request which doesn't expect a response.
1176// |request_name| is an API function name. |args| is a list of input arguments.
1177IPC_MESSAGE_CONTROL2(PpapiHostMsg_ExtensionsCommon_Post,
1178                     std::string /* request_name */,
1179                     base::ListValue /* args */)
1180
1181// Starts an extension API request which expects a response sent back using a
1182// PpapiPluginMsg_ExtensionsCommon_CallReply message.
1183// |request_name| is an API function name. |args| is a list of input arguments.
1184// |output| is a list of output results.
1185IPC_MESSAGE_CONTROL2(PpapiHostMsg_ExtensionsCommon_Call,
1186                     std::string /* request_name */,
1187                     base::ListValue /* args */)
1188IPC_MESSAGE_CONTROL1(PpapiPluginMsg_ExtensionsCommon_CallReply,
1189                     base::ListValue /* output */)
1190
1191// Ext_CrxFileSystem
1192IPC_MESSAGE_CONTROL0(PpapiHostMsg_Ext_CrxFileSystem_Create)
1193IPC_MESSAGE_CONTROL0(PpapiHostMsg_Ext_CrxFileSystem_BrowserOpen)
1194IPC_MESSAGE_CONTROL1(PpapiPluginMsg_Ext_CrxFileSystem_BrowserOpenReply,
1195                     std::string /* fsid */)
1196
1197// File chooser.
1198IPC_MESSAGE_CONTROL0(PpapiHostMsg_FileChooser_Create)
1199IPC_MESSAGE_CONTROL4(PpapiHostMsg_FileChooser_Show,
1200                     bool /* save_as */,
1201                     bool /* open_multiple */,
1202                     std::string /* suggested_file_name */,
1203                     std::vector<std::string> /* accept_mime_types */)
1204IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FileChooser_ShowReply,
1205                     std::vector<ppapi::FileRefCreateInfo> /* files */)
1206
1207// FileIO
1208IPC_MESSAGE_CONTROL0(PpapiHostMsg_FileIO_Create)
1209IPC_MESSAGE_CONTROL2(PpapiHostMsg_FileIO_Open,
1210                     PP_Resource /* file_ref_resource */,
1211                     int32_t /* open_flags */)
1212IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileIO_OpenReply)
1213IPC_MESSAGE_CONTROL0(PpapiHostMsg_FileIO_Close)
1214IPC_MESSAGE_CONTROL2(PpapiHostMsg_FileIO_Touch,
1215                     PP_Time /* last_access_time */,
1216                     PP_Time /* last_modified_time */)
1217IPC_MESSAGE_CONTROL2(PpapiHostMsg_FileIO_Write,
1218                     int64_t /* offset */,
1219                     std::string /* data */)
1220IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileIO_SetLength,
1221                     int64_t /* length */)
1222IPC_MESSAGE_CONTROL0(PpapiHostMsg_FileIO_Flush)
1223IPC_MESSAGE_CONTROL0(PpapiHostMsg_FileIO_RequestOSFileHandle)
1224IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileIO_RequestOSFileHandleReply)
1225IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileIO_GeneralReply)
1226
1227// FileRef
1228// Creates a FileRef to a path on an external file system. This message may
1229// only be sent from the renderer.
1230IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileRef_CreateExternal,
1231                     base::FilePath /* external_path */)
1232
1233// Creates a FileRef to a path on an internal file system. This message may
1234// be sent from the renderer or the plugin.
1235IPC_MESSAGE_CONTROL2(PpapiHostMsg_FileRef_CreateInternal,
1236                     PP_Resource /* file_system */,
1237                     std::string /* internal_path */)
1238
1239// Requests that the browser create a directory at the location indicated by
1240// the FileRef.
1241IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileRef_MakeDirectory,
1242                     bool /* make_ancestors */)
1243IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileRef_MakeDirectoryReply)
1244
1245// Requests that the browser update the last accessed and last modified times
1246// at the location indicated by the FileRef.
1247IPC_MESSAGE_CONTROL2(PpapiHostMsg_FileRef_Touch,
1248                     PP_Time /* last_accessed */,
1249                     PP_Time /* last_modified */)
1250IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileRef_TouchReply)
1251
1252// Requests that the browser delete a file or directory at the location
1253// indicated by the FileRef.
1254IPC_MESSAGE_CONTROL0(PpapiHostMsg_FileRef_Delete)
1255IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileRef_DeleteReply)
1256
1257// Requests that the browser rename a file or directory at the location
1258// indicated by the FileRef.
1259IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileRef_Rename,
1260                     PP_Resource /* new_file_ref */)
1261IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileRef_RenameReply)
1262
1263// Requests that the browser retrieve metadata information for a file or
1264// directory at the location indicated by the FileRef.
1265IPC_MESSAGE_CONTROL0(PpapiHostMsg_FileRef_Query)
1266IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FileRef_QueryReply,
1267                     PP_FileInfo /* file_info */)
1268
1269// Requests that the browser retrieve then entries in a directory at the
1270// location indicated by the FileRef.
1271IPC_MESSAGE_CONTROL0(PpapiHostMsg_FileRef_ReadDirectoryEntries)
1272
1273// FileRefCreateInfo does not provide file type information, so two
1274// corresponding vectors are returned.
1275IPC_MESSAGE_CONTROL2(PpapiPluginMsg_FileRef_ReadDirectoryEntriesReply,
1276                     std::vector<ppapi::FileRefCreateInfo> /* files */,
1277                     std::vector<PP_FileType> /* file_types */)
1278
1279// Requests that the browser reply with the absolute path to the indicated
1280// file.
1281IPC_MESSAGE_CONTROL0(PpapiHostMsg_FileRef_GetAbsolutePath)
1282IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FileRef_GetAbsolutePathReply,
1283                     std::string /* absolute_path */)
1284
1285// FileSystem
1286IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileSystem_Create,
1287                     PP_FileSystemType /* type */)
1288IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileSystem_Open,
1289                     int64_t /* expected_size */)
1290IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileSystem_OpenReply)
1291IPC_MESSAGE_CONTROL1(PpapiHostMsg_FileSystem_InitIsolatedFileSystem,
1292                     std::string /* fsid */)
1293IPC_MESSAGE_CONTROL0(PpapiPluginMsg_FileSystem_InitIsolatedFileSystemReply)
1294
1295// Flash DRM ------------------------------------------------------------------
1296IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashDRM_Create)
1297
1298// Requests the device ID.
1299IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashDRM_GetDeviceID)
1300// Reply for GetDeviceID which includes the device ID as a string.
1301IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashDRM_GetDeviceIDReply,
1302                     std::string /* id */)
1303
1304// Requests the HMONITOR corresponding to the monitor on which the instance is
1305// displayed.
1306IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashDRM_GetHmonitor)
1307// Reply message for GetHmonitor which contains the HMONITOR as an int64_t.
1308IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashDRM_GetHmonitorReply,
1309                     int64_t /* hmonitor */)
1310
1311// Requests the voucher file which is used to verify the integrity of the Flash
1312// module. A PPB_FileRef resource will be created.
1313IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashDRM_GetVoucherFile)
1314// Reply message for GetVoucherFile which contains the CreateInfo for a
1315// PPB_FileRef which points to the voucher file.
1316IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashDRM_GetVoucherFileReply,
1317                     ppapi::FileRefCreateInfo /* file_info */)
1318
1319// Gamepad.
1320IPC_MESSAGE_CONTROL0(PpapiHostMsg_Gamepad_Create)
1321
1322// Requests that the gamepad host send the shared memory handle to the plugin
1323// process.
1324IPC_MESSAGE_CONTROL0(PpapiHostMsg_Gamepad_RequestMemory)
1325
1326// Reply to a RequestMemory call. This supplies the shared memory handle. The
1327// actual handle is passed in the ReplyParams struct.
1328IPC_MESSAGE_CONTROL0(PpapiPluginMsg_Gamepad_SendMemory)
1329
1330
1331// Graphics2D, plugin -> host
1332IPC_MESSAGE_CONTROL2(PpapiHostMsg_Graphics2D_Create,
1333                     PP_Size /* size */,
1334                     PP_Bool /* is_always_opaque */)
1335IPC_MESSAGE_CONTROL4(PpapiHostMsg_Graphics2D_PaintImageData,
1336                     ppapi::HostResource /* image_data */,
1337                     PP_Point /* top_left */,
1338                     bool /* src_rect_specified */,
1339                     PP_Rect /* src_rect */)
1340IPC_MESSAGE_CONTROL3(PpapiHostMsg_Graphics2D_Scroll,
1341                     bool /* clip_specified */,
1342                     PP_Rect /* clip */,
1343                     PP_Point /* amount */)
1344IPC_MESSAGE_CONTROL1(PpapiHostMsg_Graphics2D_ReplaceContents,
1345                     ppapi::HostResource /* image_data */)
1346IPC_MESSAGE_CONTROL1(PpapiHostMsg_Graphics2D_Dev_SetScale,
1347                     float /* scale */)
1348
1349// Graphics2D, plugin -> host -> plugin
1350IPC_MESSAGE_CONTROL0(PpapiHostMsg_Graphics2D_Flush)
1351IPC_MESSAGE_CONTROL0(PpapiPluginMsg_Graphics2D_FlushAck)
1352
1353IPC_MESSAGE_CONTROL2(PpapiHostMsg_Graphics2D_ReadImageData,
1354                     PP_Resource /* image */,
1355                     PP_Point /* top_left */)
1356IPC_MESSAGE_CONTROL0(PpapiPluginMsg_Graphics2D_ReadImageDataAck)
1357
1358// NetworkMonitor.
1359IPC_MESSAGE_CONTROL0(PpapiHostMsg_NetworkMonitor_Create)
1360IPC_MESSAGE_CONTROL1(PpapiPluginMsg_NetworkMonitor_NetworkList,
1361                     ppapi::proxy::SerializedNetworkList /* network_list */)
1362IPC_MESSAGE_CONTROL0(PpapiPluginMsg_NetworkMonitor_Forbidden)
1363
1364
1365// NetworkProxy ----------------------------------------------------------------
1366IPC_MESSAGE_CONTROL0(PpapiHostMsg_NetworkProxy_Create)
1367
1368// Query the browser for the proxy server to use for the given URL.
1369IPC_MESSAGE_CONTROL1(PpapiHostMsg_NetworkProxy_GetProxyForURL,
1370                     std::string /* url */)
1371
1372// Reply message for GetProxyForURL containing the proxy server.
1373IPC_MESSAGE_CONTROL1(PpapiPluginMsg_NetworkProxy_GetProxyForURLReply,
1374                     std::string /* proxy */)
1375
1376// TrueTypeFont.
1377IPC_MESSAGE_CONTROL0(PpapiHostMsg_TrueTypeFontSingleton_Create)
1378IPC_MESSAGE_CONTROL0(PpapiHostMsg_TrueTypeFontSingleton_GetFontFamilies)
1379IPC_MESSAGE_CONTROL1(PpapiPluginMsg_TrueTypeFontSingleton_GetFontFamiliesReply,
1380                     std::vector<std::string> /* font_families */)
1381IPC_MESSAGE_CONTROL1(PpapiHostMsg_TrueTypeFontSingleton_GetFontsInFamily,
1382                     std::string /* family */)
1383IPC_MESSAGE_CONTROL1(PpapiPluginMsg_TrueTypeFontSingleton_GetFontsInFamilyReply,
1384                     std::vector<ppapi::proxy::SerializedTrueTypeFontDesc>
1385                         /* fonts */)
1386IPC_MESSAGE_CONTROL1(PpapiHostMsg_TrueTypeFont_Create,
1387                     ppapi::proxy::SerializedTrueTypeFontDesc /* desc */)
1388IPC_MESSAGE_CONTROL0(PpapiHostMsg_TrueTypeFont_Describe)
1389IPC_MESSAGE_CONTROL1(PpapiPluginMsg_TrueTypeFont_DescribeReply,
1390                     ppapi::proxy::SerializedTrueTypeFontDesc /* desc */)
1391IPC_MESSAGE_CONTROL0(PpapiHostMsg_TrueTypeFont_GetTableTags)
1392IPC_MESSAGE_CONTROL1(PpapiPluginMsg_TrueTypeFont_GetTableTagsReply,
1393                     std::vector<uint32_t> /* tags */)
1394IPC_MESSAGE_CONTROL3(PpapiHostMsg_TrueTypeFont_GetTable,
1395                     uint32_t /* table */,
1396                     int32_t /* offset */,
1397                     int32_t /* max_data_length */)
1398IPC_MESSAGE_CONTROL1(PpapiPluginMsg_TrueTypeFont_GetTableReply,
1399                     std::string /* data */)
1400
1401// Host Resolver ---------------------------------------------------------------
1402// Creates a PPB_HostResolver resource.
1403IPC_MESSAGE_CONTROL0(PpapiHostMsg_HostResolver_Create)
1404
1405// Creates a PPB_HostResolver_Private resource.
1406IPC_MESSAGE_CONTROL0(PpapiHostMsg_HostResolver_CreatePrivate)
1407
1408// Resolves the given hostname.
1409IPC_MESSAGE_CONTROL2(PpapiHostMsg_HostResolver_Resolve,
1410                     ppapi::HostPortPair /* host_port */,
1411                     PP_HostResolver_Private_Hint /* hint */)
1412
1413// This message is a reply to HostResolver_Resolve. On success,
1414// |canonical_name| contains the canonical name of the host; |net_address_list|
1415// is a list of network addresses. On failure, both fields are set to empty.
1416IPC_MESSAGE_CONTROL2(PpapiPluginMsg_HostResolver_ResolveReply,
1417                     std::string /* canonical_name */,
1418                     std::vector<PP_NetAddress_Private> /* net_address_list */)
1419
1420// Platform Verification -------------------------------------------------------
1421IPC_MESSAGE_CONTROL0(PpapiHostMsg_PlatformVerification_Create)
1422IPC_MESSAGE_CONTROL0(PpapiHostMsg_PlatformVerification_CanChallengePlatform)
1423IPC_MESSAGE_CONTROL1(
1424    PpapiHostMsg_PlatformVerification_CanChallengePlatformReply,
1425    bool /* can_challenge_platform */)
1426IPC_MESSAGE_CONTROL2(PpapiHostMsg_PlatformVerification_ChallengePlatform,
1427                     std::string /* service_id  */,
1428                     std::vector<uint8_t> /* challenge */)
1429IPC_MESSAGE_CONTROL3(PpapiHostMsg_PlatformVerification_ChallengePlatformReply,
1430                     std::vector<uint8_t> /* signed_data */,
1431                     std::vector<uint8_t> /* signed_data_signature */,
1432                     std::string /* platform_key_certificate */)
1433
1434// Printing.
1435IPC_MESSAGE_CONTROL0(PpapiHostMsg_Printing_Create)
1436IPC_MESSAGE_CONTROL0(PpapiHostMsg_Printing_GetDefaultPrintSettings)
1437IPC_MESSAGE_CONTROL1(PpapiPluginMsg_Printing_GetDefaultPrintSettingsReply,
1438                     PP_PrintSettings_Dev /* print_settings */)
1439
1440// TCP Socket ------------------------------------------------------------------
1441// Creates a PPB_TCPSocket resource.
1442IPC_MESSAGE_CONTROL1(PpapiHostMsg_TCPSocket_Create,
1443                     ppapi::TCPSocketVersion /* version */)
1444
1445// Creates a PPB_TCPSocket_Private resource.
1446IPC_MESSAGE_CONTROL0(PpapiHostMsg_TCPSocket_CreatePrivate)
1447
1448IPC_MESSAGE_CONTROL1(PpapiHostMsg_TCPSocket_Bind,
1449                     PP_NetAddress_Private /* net_addr */)
1450IPC_MESSAGE_CONTROL1(PpapiPluginMsg_TCPSocket_BindReply,
1451                     PP_NetAddress_Private /* local_addr */)
1452IPC_MESSAGE_CONTROL2(PpapiHostMsg_TCPSocket_Connect,
1453                     std::string /* host */,
1454                     uint16_t /* port */)
1455IPC_MESSAGE_CONTROL1(PpapiHostMsg_TCPSocket_ConnectWithNetAddress,
1456                     PP_NetAddress_Private /* net_addr */)
1457IPC_MESSAGE_CONTROL2(PpapiPluginMsg_TCPSocket_ConnectReply,
1458                     PP_NetAddress_Private /* local_addr */,
1459                     PP_NetAddress_Private /* remote_addr */)
1460IPC_MESSAGE_CONTROL4(PpapiHostMsg_TCPSocket_SSLHandshake,
1461                     std::string /* server_name */,
1462                     uint16_t /* server_port */,
1463                     std::vector<std::vector<char> > /* trusted_certs */,
1464                     std::vector<std::vector<char> > /* untrusted_certs */)
1465IPC_MESSAGE_CONTROL1(PpapiPluginMsg_TCPSocket_SSLHandshakeReply,
1466                     ppapi::PPB_X509Certificate_Fields /* certificate_fields */)
1467IPC_MESSAGE_CONTROL1(PpapiHostMsg_TCPSocket_Read,
1468                     int32_t /* bytes_to_read */)
1469IPC_MESSAGE_CONTROL1(PpapiPluginMsg_TCPSocket_ReadReply,
1470                     std::string /* data */)
1471IPC_MESSAGE_CONTROL1(PpapiHostMsg_TCPSocket_Write,
1472                     std::string /* data */)
1473IPC_MESSAGE_CONTROL0(PpapiPluginMsg_TCPSocket_WriteReply)
1474IPC_MESSAGE_CONTROL1(PpapiHostMsg_TCPSocket_Listen,
1475                     int32_t /* backlog */)
1476IPC_MESSAGE_CONTROL0(PpapiPluginMsg_TCPSocket_ListenReply)
1477IPC_MESSAGE_CONTROL0(PpapiHostMsg_TCPSocket_Accept)
1478IPC_MESSAGE_CONTROL3(PpapiPluginMsg_TCPSocket_AcceptReply,
1479                     int /* pending_host_id*/,
1480                     PP_NetAddress_Private /* local_addr */,
1481                     PP_NetAddress_Private /* remote_addr */)
1482IPC_MESSAGE_CONTROL0(PpapiHostMsg_TCPSocket_Close)
1483IPC_MESSAGE_CONTROL2(PpapiHostMsg_TCPSocket_SetOption,
1484                     PP_TCPSocket_Option /* name */,
1485                     ppapi::SocketOptionData /* value */)
1486IPC_MESSAGE_CONTROL0(PpapiPluginMsg_TCPSocket_SetOptionReply)
1487
1488// TCP Server Socket -----------------------------------------------------------
1489// Creates a PPB_TCPServerSocket_Private resource.
1490IPC_MESSAGE_CONTROL0(PpapiHostMsg_TCPServerSocket_CreatePrivate)
1491
1492IPC_MESSAGE_CONTROL2(PpapiHostMsg_TCPServerSocket_Listen,
1493                     PP_NetAddress_Private /* addr */,
1494                     int32_t /* backlog */)
1495IPC_MESSAGE_CONTROL1(PpapiPluginMsg_TCPServerSocket_ListenReply,
1496                     PP_NetAddress_Private /* local_addr */)
1497IPC_MESSAGE_CONTROL0(PpapiHostMsg_TCPServerSocket_Accept)
1498IPC_MESSAGE_CONTROL3(PpapiPluginMsg_TCPServerSocket_AcceptReply,
1499                     int /* pending_resource_id */,
1500                     PP_NetAddress_Private /* local_addr */,
1501                     PP_NetAddress_Private /* remote_addr */)
1502IPC_MESSAGE_CONTROL0(PpapiHostMsg_TCPServerSocket_StopListening)
1503
1504// UDP Socket ------------------------------------------------------------------
1505// Creates a PPB_UDPSocket resource.
1506IPC_MESSAGE_CONTROL0(PpapiHostMsg_UDPSocket_Create)
1507
1508// Creates a PPB_UDPSocket_Private resource.
1509IPC_MESSAGE_CONTROL0(PpapiHostMsg_UDPSocket_CreatePrivate)
1510
1511IPC_MESSAGE_CONTROL2(PpapiHostMsg_UDPSocket_SetOption,
1512                     PP_UDPSocket_Option /* name */,
1513                     ppapi::SocketOptionData /* value */)
1514IPC_MESSAGE_CONTROL0(PpapiPluginMsg_UDPSocket_SetOptionReply)
1515IPC_MESSAGE_CONTROL1(PpapiHostMsg_UDPSocket_Bind,
1516                     PP_NetAddress_Private /* net_addr */)
1517IPC_MESSAGE_CONTROL1(PpapiPluginMsg_UDPSocket_BindReply,
1518                     PP_NetAddress_Private /* bound_addr */)
1519IPC_MESSAGE_CONTROL1(PpapiHostMsg_UDPSocket_RecvFrom,
1520                     int32_t /* num_bytes */)
1521IPC_MESSAGE_CONTROL2(PpapiPluginMsg_UDPSocket_RecvFromReply,
1522                     std::string /* data */,
1523                     PP_NetAddress_Private /* remote_addr */)
1524IPC_MESSAGE_CONTROL2(PpapiHostMsg_UDPSocket_SendTo,
1525                     std::string /* data */,
1526                     PP_NetAddress_Private /* net_addr */)
1527IPC_MESSAGE_CONTROL1(PpapiPluginMsg_UDPSocket_SendToReply,
1528                     int32_t /* bytes_written */)
1529IPC_MESSAGE_CONTROL0(PpapiHostMsg_UDPSocket_Close)
1530
1531// URLLoader ------------------------------------------------------------------
1532
1533IPC_MESSAGE_CONTROL0(PpapiHostMsg_URLLoader_Create)
1534
1535// These messages correspond to PPAPI calls and all should get a
1536// CallbackComplete message.
1537IPC_MESSAGE_CONTROL1(PpapiHostMsg_URLLoader_Open,
1538                     ppapi::URLRequestInfoData /* request_data */)
1539
1540// The plugin can tell the host to defer a load to hold off on sending more
1541// data because the buffer in the plugin is full. When defers_loading is set to
1542// false, data streaming will resume.
1543//
1544// When auditing redirects (no auto follow) the load will be automatically
1545// deferred each time we get a redirect. The plugin will reset this to false
1546// by sending this message when it wants to continue following the redirect.
1547//
1548// When streaming data, the host may still send more data after this call (for
1549// example, it could already be in-flight at the time of this request).
1550IPC_MESSAGE_CONTROL1(PpapiHostMsg_URLLoader_SetDeferLoading,
1551                     bool /* defers_loading */)
1552
1553// Closes the URLLoader. There is no reply.
1554IPC_MESSAGE_CONTROL0(PpapiHostMsg_URLLoader_Close)
1555
1556// Requests that cross-site restrictions be ignored. The plugin must have
1557// the private permission set. Otherwise this message will be ignored by the
1558// renderer. There is no reply.
1559IPC_MESSAGE_CONTROL0(PpapiHostMsg_URLLoader_GrantUniversalAccess)
1560
1561// Push notification that a response is available.
1562IPC_MESSAGE_CONTROL1(PpapiPluginMsg_URLLoader_ReceivedResponse,
1563                     ppapi::URLResponseInfoData /* response */)
1564
1565// Push notification with load data from the renderer. It is a custom generated
1566// message with the response data (array of bytes stored via WriteData)
1567// appended.
1568IPC_MESSAGE_CONTROL0(PpapiPluginMsg_URLLoader_SendData)
1569
1570// Push notification indicating that all data has been sent, either via
1571// SendData or by streaming it to a file. Note that since this is a push
1572// notification, we don't use the result field of the ResourceMessageReply.
1573IPC_MESSAGE_CONTROL1(PpapiPluginMsg_URLLoader_FinishedLoading,
1574                     int32_t /* result */)
1575
1576// Push notification from the renderer to the plugin to tell it about download
1577// and upload progress. This will only be sent if the plugin has requested
1578// progress updates, and only the fields requested by the plugin will be
1579// valid.
1580IPC_MESSAGE_CONTROL4(PpapiPluginMsg_URLLoader_UpdateProgress,
1581                     int64_t /* bytes_sent */,
1582                     int64_t /* total_bytes_to_be_sent */,
1583                     int64_t /* bytes_received */,
1584                     int64_t /* total_bytes_to_be_received */)
1585
1586// Shared memory ---------------------------------------------------------------
1587
1588// Creates shared memory on the host side, returning a handle to the shared
1589// memory on the plugin and keeping the memory mapped in on the host.
1590// We return a "host handle_id" that can be mapped back to the
1591// handle on the host side by PpapiGlobals::UntrackSharedMemoryHandle().
1592IPC_SYNC_MESSAGE_CONTROL2_2(PpapiHostMsg_SharedMemory_CreateSharedMemory,
1593                            PP_Instance /* instance */,
1594                            uint32_t /* size */,
1595                            int /* host_handle_id */,
1596                            ppapi::proxy::SerializedHandle /* plugin_handle */)
1597
1598// MediaStream -----------------------------------------------------------------
1599
1600// VideoDestination Private.
1601IPC_MESSAGE_CONTROL0(PpapiHostMsg_VideoDestination_Create)
1602IPC_MESSAGE_CONTROL1(PpapiHostMsg_VideoDestination_Open,
1603                     std::string /* stream_url */)
1604IPC_MESSAGE_CONTROL0(PpapiPluginMsg_VideoDestination_OpenReply)
1605IPC_MESSAGE_CONTROL2(PpapiHostMsg_VideoDestination_PutFrame,
1606                     ppapi::HostResource /* image_data */,
1607                     PP_TimeTicks /* timestamp */)
1608IPC_MESSAGE_CONTROL0(PpapiHostMsg_VideoDestination_Close)
1609
1610// VideoSource Private.
1611IPC_MESSAGE_CONTROL0(PpapiHostMsg_VideoSource_Create)
1612IPC_MESSAGE_CONTROL1(PpapiHostMsg_VideoSource_Open,
1613                     std::string /* stream_url */)
1614IPC_MESSAGE_CONTROL0(PpapiPluginMsg_VideoSource_OpenReply)
1615IPC_MESSAGE_CONTROL0(PpapiHostMsg_VideoSource_GetFrame)
1616IPC_MESSAGE_CONTROL3(PpapiPluginMsg_VideoSource_GetFrameReply,
1617                     ppapi::HostResource /* resource_id */,
1618                     PP_ImageDataDesc /* image_data_desc */,
1619                     PP_TimeTicks /* timestamp */)
1620IPC_MESSAGE_CONTROL0(PpapiHostMsg_VideoSource_Close)
1621
1622// WebSocket -------------------------------------------------------------------
1623
1624IPC_MESSAGE_CONTROL0(PpapiHostMsg_WebSocket_Create)
1625
1626// Establishes the connection to a server. This message requires
1627// WebSocket_ConnectReply as a reply message.
1628IPC_MESSAGE_CONTROL2(PpapiHostMsg_WebSocket_Connect,
1629                     std::string /* url */,
1630                     std::vector<std::string> /* protocols */)
1631
1632// Closes established connection with graceful closing handshake. This message
1633// requires WebSocket_CloseReply as a reply message.
1634IPC_MESSAGE_CONTROL2(PpapiHostMsg_WebSocket_Close,
1635                     int32_t /* code */,
1636                     std::string /* reason */)
1637
1638// Sends a text frame to the server. No reply is defined.
1639IPC_MESSAGE_CONTROL1(PpapiHostMsg_WebSocket_SendText,
1640                     std::string /* message */)
1641
1642// Sends a binary frame to the server. No reply is defined.
1643IPC_MESSAGE_CONTROL1(PpapiHostMsg_WebSocket_SendBinary,
1644                     std::vector<uint8_t> /* message */)
1645
1646// Fails the connection. This message invokes RFC6455 defined
1647// _Fail the WebSocket Connection_ operation. No reply is defined.
1648IPC_MESSAGE_CONTROL1(PpapiHostMsg_WebSocket_Fail,
1649                     std::string /* message */)
1650
1651// This message is a reply to WebSocket_Connect. If the |url| and |protocols|
1652// are invalid, WebSocket_ConnectReply is issued immediately and it contains
1653// proper error code in its result. Otherwise, WebSocket_ConnectReply is sent
1654// with valid |url|, |protocol|, and result PP_OK. |protocol| is not a passed
1655// |protocols|, but a result of opening handshake negotiation. If the
1656// connection can not be established successfully, WebSocket_ConnectReply is
1657// not issued, but WebSocket_ClosedReply is sent instead.
1658IPC_MESSAGE_CONTROL2(PpapiPluginMsg_WebSocket_ConnectReply,
1659                     std::string /* url */,
1660                     std::string /* protocol */)
1661
1662// This message is a reply to WebSocket_Close. If the operation fails,
1663// WebSocket_CloseReply is issued immediately and it contains PP_ERROR_FAILED.
1664// Otherwise, CloseReply will be issued after the closing handshake is
1665// finished. All arguments will be valid iff the result is PP_OK and it means
1666// that the client initiated closing handshake is finished gracefully.
1667IPC_MESSAGE_CONTROL4(PpapiPluginMsg_WebSocket_CloseReply,
1668                     uint64_t /* buffered_amount */,
1669                     bool /* was_clean */,
1670                     uint16_t /* code */,
1671                     std::string /* reason */)
1672
1673// Unsolicited reply message to transmit a receiving text frame.
1674IPC_MESSAGE_CONTROL1(PpapiPluginMsg_WebSocket_ReceiveTextReply,
1675                     std::string /* message */)
1676
1677// Unsolicited reply message to transmit a receiving binary frame.
1678IPC_MESSAGE_CONTROL1(PpapiPluginMsg_WebSocket_ReceiveBinaryReply,
1679                     std::vector<uint8_t> /* message */)
1680
1681// Unsolicited reply message to notify a error on underlying network connetion.
1682IPC_MESSAGE_CONTROL0(PpapiPluginMsg_WebSocket_ErrorReply)
1683
1684// Unsolicited reply message to update the buffered amount value.
1685IPC_MESSAGE_CONTROL1(PpapiPluginMsg_WebSocket_BufferedAmountReply,
1686                     uint64_t /* buffered_amount */)
1687
1688// Unsolicited reply message to update |state| because of incoming external
1689// events, e.g., protocol error, or unexpected network closure.
1690IPC_MESSAGE_CONTROL1(PpapiPluginMsg_WebSocket_StateReply,
1691                     int32_t /* state */)
1692
1693// Unsolicited reply message to notify that the connection is closed without
1694// any WebSocket_Close request. Server initiated closing handshake or
1695// unexpected network errors will invoke this message.
1696IPC_MESSAGE_CONTROL4(PpapiPluginMsg_WebSocket_ClosedReply,
1697                     uint64_t /* buffered_amount */,
1698                     bool /* was_clean */,
1699                     uint16_t /* code */,
1700                     std::string /* reason */)
1701
1702// OutputProtection -----------------------------------------------------------
1703
1704IPC_MESSAGE_CONTROL0(PpapiHostMsg_OutputProtection_Create)
1705IPC_MESSAGE_CONTROL1(PpapiHostMsg_OutputProtection_EnableProtection,
1706                     uint32_t /* desired_method_mask */)
1707IPC_MESSAGE_CONTROL0(PpapiPluginMsg_OutputProtection_EnableProtectionReply)
1708IPC_MESSAGE_CONTROL0(PpapiHostMsg_OutputProtection_QueryStatus)
1709IPC_MESSAGE_CONTROL2(PpapiPluginMsg_OutputProtection_QueryStatusReply,
1710                     uint32_t /* link_mask */,
1711                     uint32_t /* protection_mask */)
1712
1713#if !defined(OS_NACL) && !defined(NACL_WIN64)
1714
1715// Audio input.
1716IPC_MESSAGE_CONTROL0(PpapiHostMsg_AudioInput_Create)
1717IPC_MESSAGE_CONTROL3(PpapiHostMsg_AudioInput_Open,
1718                     std::string /* device_id */,
1719                     PP_AudioSampleRate /* sample_rate */,
1720                     uint32_t /* sample_frame_count */)
1721// Reply to an Open call. This supplies a socket handle and a shared memory
1722// handle. Both handles are passed in the ReplyParams struct.
1723IPC_MESSAGE_CONTROL0(PpapiPluginMsg_AudioInput_OpenReply)
1724IPC_MESSAGE_CONTROL1(PpapiHostMsg_AudioInput_StartOrStop, bool /* capture */)
1725IPC_MESSAGE_CONTROL0(PpapiHostMsg_AudioInput_Close)
1726
1727// BrowserFont -----------------------------------------------------------------
1728
1729IPC_MESSAGE_CONTROL0(PpapiHostMsg_BrowserFontSingleton_Create)
1730
1731// Requests that the browser reply with the list of font families via
1732// PpapiPluginMsg_BrowserFontSingleton_GetFontFamiliesReply.
1733IPC_MESSAGE_CONTROL0(PpapiHostMsg_BrowserFontSingleton_GetFontFamilies)
1734
1735// Reply to PpapiHostMsg_BrowserFontSingleton_GetFontFamilies with the font
1736// family list. The |families| result is encoded by separating each family name
1737// by a null character.
1738IPC_MESSAGE_CONTROL1(PpapiPluginMsg_BrowserFontSingleton_GetFontFamiliesReply,
1739                     std::string /* families */)
1740
1741// Flash -----------------------------------------------------------------------
1742
1743IPC_MESSAGE_CONTROL0(PpapiHostMsg_Flash_Create)
1744
1745// Message to notify the browser to register an update in system activity.
1746IPC_MESSAGE_CONTROL0(PpapiHostMsg_Flash_UpdateActivity)
1747
1748// Query the browser for the proxy server to use for the given URL.
1749IPC_MESSAGE_CONTROL1(PpapiHostMsg_Flash_GetProxyForURL, std::string /* url */)
1750// Reply message for GetProxyForURL containing the proxy server.
1751IPC_MESSAGE_CONTROL1(PpapiPluginMsg_Flash_GetProxyForURLReply,
1752                     std::string /* proxy */)
1753
1754// Queries the browser for the local time zone offset for a given time.
1755IPC_MESSAGE_CONTROL1(PpapiHostMsg_Flash_GetLocalTimeZoneOffset,
1756                     base::Time /* time */)
1757// Reply to GetLocalTimeZoneOffset containing the time zone offset as a double.
1758IPC_MESSAGE_CONTROL1(PpapiPluginMsg_Flash_GetLocalTimeZoneOffsetReply,
1759                     double /* offset */)
1760
1761// Query the browser for the restrictions on storing Flash LSOs.
1762IPC_MESSAGE_CONTROL0(PpapiHostMsg_Flash_GetLocalDataRestrictions)
1763// Reply message for GetLocalDataRestrictions containing the restrictions to
1764// use. These are PP_FlashLSORestrictions cast to an int32_t.
1765IPC_MESSAGE_CONTROL1(PpapiPluginMsg_Flash_GetLocalDataRestrictionsReply,
1766                     int32_t /* restrictions */)
1767
1768// Notifies the renderer whether the Flash instance is in windowed mode. No
1769// reply is sent.
1770IPC_MESSAGE_CONTROL1(PpapiHostMsg_Flash_SetInstanceAlwaysOnTop,
1771                     bool /* on_top */)
1772
1773// Notifies the renderer to draw text to the given PP_ImageData resource. All
1774// parmeters for drawing (including the resource to draw to) are contianed in
1775// the PPBFlash_DrawGlyphs_Params structure. An error code is sent in a reply
1776// message indicating success.
1777IPC_MESSAGE_CONTROL1(PpapiHostMsg_Flash_DrawGlyphs,
1778                     ppapi::proxy::PPBFlash_DrawGlyphs_Params /* params */)
1779
1780// Notifies the renderer to navigate to the given URL contained in the
1781// URLRequestInfoData. An error code is sent in a reply message indicating
1782// success.
1783IPC_MESSAGE_CONTROL3(PpapiHostMsg_Flash_Navigate,
1784                     ppapi::URLRequestInfoData /* data */,
1785                     std::string /* target */,
1786                     bool /* from_user_action */)
1787
1788// Queries the renderer on whether the plugin instance is the topmost element
1789// in the area of the instance specified by the given PP_Rect. PP_OK is sent as
1790// the error code in a reply message if the rect is topmost otherwise
1791// PP_ERROR_FAILED is sent.
1792IPC_MESSAGE_CONTROL1(PpapiHostMsg_Flash_IsRectTopmost,
1793                     PP_Rect /* rect */)
1794
1795// Notifies the renderer to invoke printing for the given plugin instance. No
1796// reply is sent.
1797IPC_MESSAGE_CONTROL0(PpapiHostMsg_Flash_InvokePrinting)
1798
1799// DeviceEnumeration -----------------------------------------------------------
1800// Device enumeration messages used by audio input and video capture.
1801IPC_MESSAGE_CONTROL0(PpapiHostMsg_DeviceEnumeration_EnumerateDevices)
1802IPC_MESSAGE_CONTROL1(PpapiPluginMsg_DeviceEnumeration_EnumerateDevicesReply,
1803                     std::vector<ppapi::DeviceRefData> /* devices */)
1804IPC_MESSAGE_CONTROL1(PpapiHostMsg_DeviceEnumeration_MonitorDeviceChange,
1805                     uint32_t /* callback_id */)
1806IPC_MESSAGE_CONTROL0(PpapiHostMsg_DeviceEnumeration_StopMonitoringDeviceChange)
1807IPC_MESSAGE_CONTROL2(PpapiPluginMsg_DeviceEnumeration_NotifyDeviceChange,
1808                     uint32_t /* callback_id */,
1809                     std::vector<ppapi::DeviceRefData> /* devices */)
1810
1811// Flash clipboard.
1812IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashClipboard_Create)
1813IPC_MESSAGE_CONTROL1(PpapiHostMsg_FlashClipboard_RegisterCustomFormat,
1814                     std::string /* format_name */)
1815IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashClipboard_RegisterCustomFormatReply,
1816                     uint32_t /* format */)
1817IPC_MESSAGE_CONTROL2(PpapiHostMsg_FlashClipboard_IsFormatAvailable,
1818                     uint32_t /* clipboard_type */,
1819                     uint32_t /* format */)
1820IPC_MESSAGE_CONTROL2(PpapiHostMsg_FlashClipboard_ReadData,
1821                     uint32_t /* clipboard_type */,
1822                     uint32_t /* format */)
1823IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashClipboard_ReadDataReply,
1824                     std::string /* result */)
1825IPC_MESSAGE_CONTROL3(PpapiHostMsg_FlashClipboard_WriteData,
1826                     uint32_t /* clipboard_type */,
1827                     std::vector<uint32_t> /* formats */,
1828                     std::vector<std::string> /* data */)
1829
1830// Flash file.
1831IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashFile_Create)
1832IPC_MESSAGE_CONTROL2(PpapiHostMsg_FlashFile_OpenFile,
1833                     ppapi::PepperFilePath /* path */,
1834                     int /* pp_open_flags */)
1835IPC_MESSAGE_CONTROL2(PpapiHostMsg_FlashFile_RenameFile,
1836                     ppapi::PepperFilePath /* from_path */,
1837                     ppapi::PepperFilePath /* to_path */)
1838IPC_MESSAGE_CONTROL2(PpapiHostMsg_FlashFile_DeleteFileOrDir,
1839                     ppapi::PepperFilePath /* path */,
1840                     bool /* recursive */)
1841IPC_MESSAGE_CONTROL1(PpapiHostMsg_FlashFile_CreateDir,
1842                     ppapi::PepperFilePath /* path */)
1843IPC_MESSAGE_CONTROL1(PpapiHostMsg_FlashFile_QueryFile,
1844                     ppapi::PepperFilePath /* path */)
1845IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashFile_QueryFileReply,
1846                     base::PlatformFileInfo /* file_info */)
1847IPC_MESSAGE_CONTROL1(PpapiHostMsg_FlashFile_GetDirContents,
1848                     ppapi::PepperFilePath /* path */)
1849IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashFile_GetDirContentsReply,
1850                     ppapi::DirContents /* entries */)
1851IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashFile_CreateTemporaryFile)
1852
1853// Flash font file.
1854IPC_MESSAGE_CONTROL2(PpapiHostMsg_FlashFontFile_Create,
1855                     ppapi::proxy::SerializedFontDescription /* description */,
1856                     PP_PrivateFontCharset /* charset */)
1857IPC_MESSAGE_CONTROL1(PpapiHostMsg_FlashFontFile_GetFontTable,
1858                     uint32_t /* table */)
1859IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashFontFile_GetFontTableReply,
1860                     std::string /* output */)
1861
1862// Flash fullscreen.
1863IPC_MESSAGE_CONTROL0(PpapiHostMsg_FlashFullscreen_Create)
1864IPC_MESSAGE_CONTROL1(PpapiHostMsg_FlashFullscreen_SetFullscreen,
1865                     bool /* fullscreen */)
1866
1867// FlashMenu ------------------------------------------------------------------
1868
1869// Creates the flash menu with the given data.
1870IPC_MESSAGE_CONTROL1(PpapiHostMsg_FlashMenu_Create,
1871                     ppapi::proxy::SerializedFlashMenu /* menu_data */)
1872
1873// Shows the menu at the given location relative to the plugin instance.
1874IPC_MESSAGE_CONTROL1(PpapiHostMsg_FlashMenu_Show,
1875                     PP_Point /* location */)
1876
1877// Reply to a show command. If the resource reply is PP_OK, the selected_id
1878// will be the menu item ID chosen by the user.
1879IPC_MESSAGE_CONTROL1(PpapiPluginMsg_FlashMenu_ShowReply,
1880                     int32_t /* selected_id */)
1881
1882// PDF ------------------------------------------------------------------------
1883
1884// Creates the PDF resource.
1885IPC_MESSAGE_CONTROL0(PpapiHostMsg_PDF_Create)
1886
1887// Requests the localized string for the given ID.
1888IPC_MESSAGE_CONTROL1(PpapiHostMsg_PDF_GetLocalizedString,
1889                     PP_ResourceString /* string_id */)
1890// Reply for PpapiHostMsg_PDF_GetLocalizedString containing the localized
1891// string.
1892IPC_MESSAGE_CONTROL1(PpapiPluginMsg_PDF_GetLocalizedStringReply,
1893                     std::string /* localized_string*/)
1894
1895// Notifies the renderer that the PDF started loading.
1896IPC_MESSAGE_CONTROL0(PpapiHostMsg_PDF_DidStartLoading)
1897
1898// Notifies the renderer that the PDF stopped loading.
1899IPC_MESSAGE_CONTROL0(PpapiHostMsg_PDF_DidStopLoading)
1900
1901// Sets any restrictions on the PDF content.
1902IPC_MESSAGE_CONTROL1(PpapiHostMsg_PDF_SetContentRestriction,
1903                     int /* restrictions */)
1904
1905// Requests that the specified action be recorded with UMA.
1906IPC_MESSAGE_CONTROL1(PpapiHostMsg_PDF_UserMetricsRecordAction,
1907                     std::string /* action */)
1908
1909// Notifies the renderer that the current PDF uses an unsupported feature.
1910IPC_MESSAGE_CONTROL0(PpapiHostMsg_PDF_HasUnsupportedFeature)
1911
1912// Notifies the renderer to print the current PDF.
1913IPC_MESSAGE_CONTROL0(PpapiHostMsg_PDF_Print)
1914
1915// Notifies the renderer to save the current PDF.
1916IPC_MESSAGE_CONTROL0(PpapiHostMsg_PDF_SaveAs)
1917
1918// Requests a resource image for the plugin at a particular scale.
1919IPC_MESSAGE_CONTROL2(PpapiHostMsg_PDF_GetResourceImage,
1920                     PP_ResourceImage /* image_id */,
1921                     float /* scale */)
1922
1923// Reply for PpapiHostMsg_PDF_GetResourceImage containing the host resource id
1924// of the image and a PP_ImageDataDesc which describes the image. Also carries
1925// a shared memory handle pointing to the memory containg the image.
1926IPC_MESSAGE_CONTROL2(PpapiPluginMsg_PDF_GetResourceImageReply,
1927                     ppapi::HostResource /* resource_id */,
1928                     PP_ImageDataDesc /* image_data_desc */)
1929
1930// VideoCapture_Dev, plugin -> host
1931IPC_MESSAGE_CONTROL0(PpapiHostMsg_VideoCapture_Create)
1932IPC_MESSAGE_CONTROL0(PpapiHostMsg_VideoCapture_StartCapture)
1933IPC_MESSAGE_CONTROL1(PpapiHostMsg_VideoCapture_ReuseBuffer,
1934                     uint32_t /* buffer */)
1935IPC_MESSAGE_CONTROL0(PpapiHostMsg_VideoCapture_StopCapture)
1936IPC_MESSAGE_CONTROL0(PpapiHostMsg_VideoCapture_Close)
1937
1938// VideoCapture_Dev, plugin -> host -> plugin
1939IPC_MESSAGE_CONTROL3(PpapiHostMsg_VideoCapture_Open,
1940                     std::string /* device_id */,
1941                     PP_VideoCaptureDeviceInfo_Dev /* requested_info */,
1942                     uint32_t /* buffer_count */)
1943IPC_MESSAGE_CONTROL0(PpapiPluginMsg_VideoCapture_OpenReply)
1944
1945// VideoCapture_Dev, host -> plugin
1946IPC_MESSAGE_CONTROL3(PpapiPluginMsg_VideoCapture_OnDeviceInfo,
1947                     PP_VideoCaptureDeviceInfo_Dev /* info */,
1948                     std::vector<ppapi::HostResource> /* buffers */,
1949                     uint32_t /* buffer_size */)
1950IPC_MESSAGE_CONTROL1(PpapiPluginMsg_VideoCapture_OnStatus,
1951                     uint32_t /* status */)
1952IPC_MESSAGE_CONTROL1(PpapiPluginMsg_VideoCapture_OnError,
1953                     uint32_t /* error */)
1954IPC_MESSAGE_CONTROL1(PpapiPluginMsg_VideoCapture_OnBufferReady,
1955                     uint32_t /* buffer */)
1956
1957// Talk ------------------------------------------------------------------------
1958
1959IPC_MESSAGE_CONTROL0(PpapiHostMsg_Talk_Create)
1960IPC_MESSAGE_CONTROL1(PpapiHostMsg_Talk_RequestPermission,
1961                     PP_TalkPermission /* permission */)
1962IPC_MESSAGE_CONTROL0(PpapiPluginMsg_Talk_RequestPermissionReply)
1963IPC_MESSAGE_CONTROL0(PpapiHostMsg_Talk_StartRemoting)
1964IPC_MESSAGE_CONTROL0(PpapiPluginMsg_Talk_StartRemotingReply)
1965IPC_MESSAGE_CONTROL0(PpapiHostMsg_Talk_StopRemoting)
1966IPC_MESSAGE_CONTROL0(PpapiPluginMsg_Talk_StopRemotingReply)
1967IPC_MESSAGE_CONTROL1(PpapiPluginMsg_Talk_NotifyEvent, PP_TalkEvent /* event */)
1968
1969#endif  // !defined(OS_NACL) && !defined(NACL_WIN64)
1970