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