• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "ppapi/proxy/resource_creation_proxy.h"
6 
7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/pp_size.h"
9 #include "ppapi/proxy/audio_input_resource.h"
10 #include "ppapi/proxy/connection.h"
11 #include "ppapi/proxy/file_chooser_resource.h"
12 #include "ppapi/proxy/file_io_resource.h"
13 #include "ppapi/proxy/file_ref_resource.h"
14 #include "ppapi/proxy/file_system_resource.h"
15 #include "ppapi/proxy/flash_drm_resource.h"
16 #include "ppapi/proxy/flash_font_file_resource.h"
17 #include "ppapi/proxy/flash_menu_resource.h"
18 #include "ppapi/proxy/graphics_2d_resource.h"
19 #include "ppapi/proxy/host_resolver_private_resource.h"
20 #include "ppapi/proxy/host_resolver_resource.h"
21 #include "ppapi/proxy/net_address_resource.h"
22 #include "ppapi/proxy/network_monitor_resource.h"
23 #include "ppapi/proxy/output_protection_resource.h"
24 #include "ppapi/proxy/platform_verification_private_resource.h"
25 #include "ppapi/proxy/plugin_dispatcher.h"
26 #include "ppapi/proxy/plugin_globals.h"
27 #include "ppapi/proxy/plugin_resource_tracker.h"
28 #include "ppapi/proxy/ppapi_messages.h"
29 #include "ppapi/proxy/ppb_audio_proxy.h"
30 #include "ppapi/proxy/ppb_broker_proxy.h"
31 #include "ppapi/proxy/ppb_buffer_proxy.h"
32 #include "ppapi/proxy/ppb_flash_message_loop_proxy.h"
33 #include "ppapi/proxy/ppb_graphics_3d_proxy.h"
34 #include "ppapi/proxy/ppb_image_data_proxy.h"
35 #include "ppapi/proxy/ppb_video_decoder_proxy.h"
36 #include "ppapi/proxy/ppb_x509_certificate_private_proxy.h"
37 #include "ppapi/proxy/printing_resource.h"
38 #include "ppapi/proxy/talk_resource.h"
39 #include "ppapi/proxy/tcp_server_socket_private_resource.h"
40 #include "ppapi/proxy/tcp_socket_private_resource.h"
41 #include "ppapi/proxy/tcp_socket_resource.h"
42 #include "ppapi/proxy/truetype_font_resource.h"
43 #include "ppapi/proxy/udp_socket_private_resource.h"
44 #include "ppapi/proxy/udp_socket_resource.h"
45 #include "ppapi/proxy/url_loader_resource.h"
46 #include "ppapi/proxy/url_request_info_resource.h"
47 #include "ppapi/proxy/url_response_info_resource.h"
48 #include "ppapi/proxy/video_capture_resource.h"
49 #include "ppapi/proxy/video_destination_resource.h"
50 #include "ppapi/proxy/video_source_resource.h"
51 #include "ppapi/proxy/websocket_resource.h"
52 #include "ppapi/shared_impl/api_id.h"
53 #include "ppapi/shared_impl/host_resource.h"
54 #include "ppapi/shared_impl/ppb_audio_config_shared.h"
55 #include "ppapi/shared_impl/ppb_audio_shared.h"
56 #include "ppapi/shared_impl/ppb_input_event_shared.h"
57 #include "ppapi/shared_impl/ppb_resource_array_shared.h"
58 #include "ppapi/shared_impl/var.h"
59 #include "ppapi/thunk/enter.h"
60 #include "ppapi/thunk/ppb_image_data_api.h"
61 
62 using ppapi::thunk::ResourceCreationAPI;
63 
64 namespace ppapi {
65 namespace proxy {
66 
ResourceCreationProxy(Dispatcher * dispatcher)67 ResourceCreationProxy::ResourceCreationProxy(Dispatcher* dispatcher)
68     : InterfaceProxy(dispatcher) {
69 }
70 
~ResourceCreationProxy()71 ResourceCreationProxy::~ResourceCreationProxy() {
72 }
73 
74 // static
Create(Dispatcher * dispatcher)75 InterfaceProxy* ResourceCreationProxy::Create(Dispatcher* dispatcher) {
76   return new ResourceCreationProxy(dispatcher);
77 }
78 
CreateFileIO(PP_Instance instance)79 PP_Resource ResourceCreationProxy::CreateFileIO(PP_Instance instance) {
80   return (new FileIOResource(GetConnection(), instance))->GetReference();
81 }
82 
CreateFileRef(PP_Instance instance,const FileRefCreateInfo & create_info)83 PP_Resource ResourceCreationProxy::CreateFileRef(
84     PP_Instance instance,
85     const FileRefCreateInfo& create_info) {
86   return FileRefResource::CreateFileRef(GetConnection(), instance, create_info);
87 }
88 
CreateFileSystem(PP_Instance instance,PP_FileSystemType type)89 PP_Resource ResourceCreationProxy::CreateFileSystem(
90     PP_Instance instance,
91     PP_FileSystemType type) {
92   return (new FileSystemResource(GetConnection(), instance,
93                                  type))->GetReference();
94 }
95 
CreateIMEInputEvent(PP_Instance instance,PP_InputEvent_Type type,PP_TimeTicks time_stamp,struct PP_Var text,uint32_t segment_number,const uint32_t * segment_offsets,int32_t target_segment,uint32_t selection_start,uint32_t selection_end)96 PP_Resource ResourceCreationProxy::CreateIMEInputEvent(
97     PP_Instance instance,
98     PP_InputEvent_Type type,
99     PP_TimeTicks time_stamp,
100     struct PP_Var text,
101     uint32_t segment_number,
102     const uint32_t* segment_offsets,
103     int32_t target_segment,
104     uint32_t selection_start,
105     uint32_t selection_end) {
106   return PPB_InputEvent_Shared::CreateIMEInputEvent(
107       OBJECT_IS_PROXY, instance, type, time_stamp, text, segment_number,
108       segment_offsets, target_segment, selection_start, selection_end);
109 }
110 
CreateKeyboardInputEvent(PP_Instance instance,PP_InputEvent_Type type,PP_TimeTicks time_stamp,uint32_t modifiers,uint32_t key_code,struct PP_Var character_text)111 PP_Resource ResourceCreationProxy::CreateKeyboardInputEvent(
112     PP_Instance instance,
113     PP_InputEvent_Type type,
114     PP_TimeTicks time_stamp,
115     uint32_t modifiers,
116     uint32_t key_code,
117     struct PP_Var character_text) {
118   return PPB_InputEvent_Shared::CreateKeyboardInputEvent(
119       OBJECT_IS_PROXY, instance, type, time_stamp, modifiers, key_code,
120       character_text);
121 }
122 
CreateMouseInputEvent(PP_Instance instance,PP_InputEvent_Type type,PP_TimeTicks time_stamp,uint32_t modifiers,PP_InputEvent_MouseButton mouse_button,const PP_Point * mouse_position,int32_t click_count,const PP_Point * mouse_movement)123 PP_Resource ResourceCreationProxy::CreateMouseInputEvent(
124     PP_Instance instance,
125     PP_InputEvent_Type type,
126     PP_TimeTicks time_stamp,
127     uint32_t modifiers,
128     PP_InputEvent_MouseButton mouse_button,
129     const PP_Point* mouse_position,
130     int32_t click_count,
131     const PP_Point* mouse_movement) {
132   return PPB_InputEvent_Shared::CreateMouseInputEvent(
133       OBJECT_IS_PROXY, instance, type, time_stamp, modifiers,
134       mouse_button, mouse_position, click_count, mouse_movement);
135 }
136 
CreateTouchInputEvent(PP_Instance instance,PP_InputEvent_Type type,PP_TimeTicks time_stamp,uint32_t modifiers)137 PP_Resource ResourceCreationProxy::CreateTouchInputEvent(
138     PP_Instance instance,
139     PP_InputEvent_Type type,
140     PP_TimeTicks time_stamp,
141     uint32_t modifiers) {
142   return PPB_InputEvent_Shared::CreateTouchInputEvent(
143       OBJECT_IS_PROXY, instance, type, time_stamp, modifiers);
144 }
145 
CreateResourceArray(PP_Instance instance,const PP_Resource elements[],uint32_t size)146 PP_Resource ResourceCreationProxy::CreateResourceArray(
147     PP_Instance instance,
148     const PP_Resource elements[],
149     uint32_t size) {
150   PPB_ResourceArray_Shared* object = new PPB_ResourceArray_Shared(
151       OBJECT_IS_PROXY, instance, elements, size);
152   return object->GetReference();
153 }
154 
CreateTrueTypeFont(PP_Instance instance,const PP_TrueTypeFontDesc_Dev * desc)155 PP_Resource ResourceCreationProxy::CreateTrueTypeFont(
156     PP_Instance instance,
157     const PP_TrueTypeFontDesc_Dev* desc) {
158   return (new TrueTypeFontResource(GetConnection(),
159                                    instance, *desc))->GetReference();
160 
161 }
162 
CreateURLLoader(PP_Instance instance)163 PP_Resource ResourceCreationProxy::CreateURLLoader(PP_Instance instance) {
164     return (new URLLoaderResource(GetConnection(), instance))->GetReference();
165 }
166 
CreateURLRequestInfo(PP_Instance instance)167 PP_Resource ResourceCreationProxy::CreateURLRequestInfo(
168     PP_Instance instance) {
169   return (new URLRequestInfoResource(
170       GetConnection(), instance, URLRequestInfoData()))->GetReference();
171 }
172 
CreateWheelInputEvent(PP_Instance instance,PP_TimeTicks time_stamp,uint32_t modifiers,const PP_FloatPoint * wheel_delta,const PP_FloatPoint * wheel_ticks,PP_Bool scroll_by_page)173 PP_Resource ResourceCreationProxy::CreateWheelInputEvent(
174     PP_Instance instance,
175     PP_TimeTicks time_stamp,
176     uint32_t modifiers,
177     const PP_FloatPoint* wheel_delta,
178     const PP_FloatPoint* wheel_ticks,
179     PP_Bool scroll_by_page) {
180   return PPB_InputEvent_Shared::CreateWheelInputEvent(
181       OBJECT_IS_PROXY, instance, time_stamp, modifiers,
182       wheel_delta, wheel_ticks, scroll_by_page);
183 }
184 
CreateAudio1_0(PP_Instance instance,PP_Resource config_id,PPB_Audio_Callback_1_0 audio_callback,void * user_data)185 PP_Resource ResourceCreationProxy::CreateAudio1_0(
186     PP_Instance instance,
187     PP_Resource config_id,
188     PPB_Audio_Callback_1_0 audio_callback,
189     void* user_data) {
190   return PPB_Audio_Proxy::CreateProxyResource(
191       instance, config_id, AudioCallbackCombined(audio_callback), user_data);
192 }
193 
CreateAudio(PP_Instance instance,PP_Resource config_id,PPB_Audio_Callback audio_callback,void * user_data)194 PP_Resource ResourceCreationProxy::CreateAudio(
195     PP_Instance instance,
196     PP_Resource config_id,
197     PPB_Audio_Callback audio_callback,
198     void* user_data) {
199   return PPB_Audio_Proxy::CreateProxyResource(
200       instance, config_id, AudioCallbackCombined(audio_callback), user_data);
201 }
202 
CreateAudioTrusted(PP_Instance instance)203 PP_Resource ResourceCreationProxy::CreateAudioTrusted(PP_Instance instance) {
204   // Proxied plugins can't create trusted audio devices.
205   return 0;
206 }
207 
CreateAudioConfig(PP_Instance instance,PP_AudioSampleRate sample_rate,uint32_t sample_frame_count)208 PP_Resource ResourceCreationProxy::CreateAudioConfig(
209     PP_Instance instance,
210     PP_AudioSampleRate sample_rate,
211     uint32_t sample_frame_count) {
212   return PPB_AudioConfig_Shared::Create(
213       OBJECT_IS_PROXY, instance, sample_rate, sample_frame_count);
214 }
215 
CreateFileChooser(PP_Instance instance,PP_FileChooserMode_Dev mode,const PP_Var & accept_types)216 PP_Resource ResourceCreationProxy::CreateFileChooser(
217     PP_Instance instance,
218     PP_FileChooserMode_Dev mode,
219     const PP_Var& accept_types) {
220   scoped_refptr<StringVar> string_var = StringVar::FromPPVar(accept_types);
221   std::string str = string_var.get() ? string_var->value() : std::string();
222   return (new FileChooserResource(GetConnection(), instance, mode, str.c_str()))
223       ->GetReference();
224 }
225 
CreateGraphics2D(PP_Instance instance,const PP_Size * size,PP_Bool is_always_opaque)226 PP_Resource ResourceCreationProxy::CreateGraphics2D(PP_Instance instance,
227                                                     const PP_Size* size,
228                                                     PP_Bool is_always_opaque) {
229   return (new Graphics2DResource(GetConnection(), instance, *size,
230                                  is_always_opaque))->GetReference();
231 }
232 
CreateGraphics3D(PP_Instance instance,PP_Resource share_context,const int32_t * attrib_list)233 PP_Resource ResourceCreationProxy::CreateGraphics3D(
234     PP_Instance instance,
235     PP_Resource share_context,
236     const int32_t* attrib_list) {
237   return PPB_Graphics3D_Proxy::CreateProxyResource(
238       instance, share_context, attrib_list);
239 }
240 
CreateGraphics3DRaw(PP_Instance instance,PP_Resource share_context,const int32_t * attrib_list)241 PP_Resource ResourceCreationProxy::CreateGraphics3DRaw(
242     PP_Instance instance,
243     PP_Resource share_context,
244     const int32_t* attrib_list) {
245   // Not proxied. The raw creation function is used only in the implementation
246   // of the proxy on the host side.
247   return 0;
248 }
249 
CreateHostResolver(PP_Instance instance)250 PP_Resource ResourceCreationProxy::CreateHostResolver(PP_Instance instance) {
251   return (new HostResolverResource(GetConnection(), instance))->GetReference();
252 }
253 
CreateHostResolverPrivate(PP_Instance instance)254 PP_Resource ResourceCreationProxy::CreateHostResolverPrivate(
255     PP_Instance instance) {
256   return (new HostResolverPrivateResource(
257       GetConnection(), instance))->GetReference();
258 }
259 
CreateImageData(PP_Instance instance,PP_ImageDataFormat format,const PP_Size * size,PP_Bool init_to_zero)260 PP_Resource ResourceCreationProxy::CreateImageData(
261     PP_Instance instance,
262     PP_ImageDataFormat format,
263     const PP_Size* size,
264     PP_Bool init_to_zero) {
265   // On the plugin side, we create PlatformImageData resources for trusted
266   // plugins and SimpleImageData resources for untrusted ones.
267   PPB_ImageData_Shared::ImageDataType type =
268 #if !defined(OS_NACL)
269       PPB_ImageData_Shared::PLATFORM;
270 #else
271       PPB_ImageData_Shared::SIMPLE;
272 #endif
273   return PPB_ImageData_Proxy::CreateProxyResource(
274       instance, type,
275       format, *size, init_to_zero);
276 }
277 
CreateImageDataSimple(PP_Instance instance,PP_ImageDataFormat format,const PP_Size * size,PP_Bool init_to_zero)278 PP_Resource ResourceCreationProxy::CreateImageDataSimple(
279     PP_Instance instance,
280     PP_ImageDataFormat format,
281     const PP_Size* size,
282     PP_Bool init_to_zero) {
283   return PPB_ImageData_Proxy::CreateProxyResource(
284       instance,
285       PPB_ImageData_Shared::SIMPLE,
286       format, *size, init_to_zero);
287 }
288 
CreateNetAddressFromIPv4Address(PP_Instance instance,const PP_NetAddress_IPv4 * ipv4_addr)289 PP_Resource ResourceCreationProxy::CreateNetAddressFromIPv4Address(
290     PP_Instance instance,
291     const PP_NetAddress_IPv4* ipv4_addr) {
292   return (new NetAddressResource(GetConnection(), instance,
293                                  *ipv4_addr))->GetReference();
294 }
295 
CreateNetAddressFromIPv6Address(PP_Instance instance,const PP_NetAddress_IPv6 * ipv6_addr)296 PP_Resource ResourceCreationProxy::CreateNetAddressFromIPv6Address(
297     PP_Instance instance,
298     const PP_NetAddress_IPv6* ipv6_addr) {
299   return (new NetAddressResource(GetConnection(), instance,
300                                  *ipv6_addr))->GetReference();
301 }
302 
CreateNetAddressFromNetAddressPrivate(PP_Instance instance,const PP_NetAddress_Private & private_addr)303 PP_Resource ResourceCreationProxy::CreateNetAddressFromNetAddressPrivate(
304     PP_Instance instance,
305     const PP_NetAddress_Private& private_addr) {
306   return (new NetAddressResource(GetConnection(), instance,
307                                  private_addr))->GetReference();
308 }
309 
CreateNetworkMonitor(PP_Instance instance)310 PP_Resource ResourceCreationProxy::CreateNetworkMonitor(
311     PP_Instance instance) {
312   return (new NetworkMonitorResource(GetConnection(), instance))->
313       GetReference();
314 }
315 
CreateOutputProtectionPrivate(PP_Instance instance)316 PP_Resource ResourceCreationProxy::CreateOutputProtectionPrivate(
317     PP_Instance instance) {
318   return (new OutputProtectionResource(GetConnection(), instance))->
319       GetReference();
320 }
321 
CreatePrinting(PP_Instance instance)322 PP_Resource ResourceCreationProxy::CreatePrinting(PP_Instance instance) {
323   return (new PrintingResource(GetConnection(), instance))->GetReference();
324 }
325 
CreateTCPServerSocketPrivate(PP_Instance instance)326 PP_Resource ResourceCreationProxy::CreateTCPServerSocketPrivate(
327     PP_Instance instance) {
328   return (new TCPServerSocketPrivateResource(GetConnection(), instance))->
329       GetReference();
330 }
331 
CreateTCPSocket1_0(PP_Instance instance)332 PP_Resource ResourceCreationProxy::CreateTCPSocket1_0(
333     PP_Instance instance) {
334   return (new TCPSocketResource(GetConnection(), instance,
335                                 TCP_SOCKET_VERSION_1_0))->GetReference();
336 }
337 
CreateTCPSocket(PP_Instance instance)338 PP_Resource ResourceCreationProxy::CreateTCPSocket(
339     PP_Instance instance) {
340   return (new TCPSocketResource(
341       GetConnection(), instance, TCP_SOCKET_VERSION_1_1_OR_ABOVE))->
342           GetReference();
343 }
344 
CreateTCPSocketPrivate(PP_Instance instance)345 PP_Resource ResourceCreationProxy::CreateTCPSocketPrivate(
346     PP_Instance instance) {
347   return (new TCPSocketPrivateResource(GetConnection(), instance))->
348       GetReference();
349 }
350 
CreateUDPSocket(PP_Instance instance)351 PP_Resource ResourceCreationProxy::CreateUDPSocket(PP_Instance instance) {
352   return (new UDPSocketResource(GetConnection(), instance))->GetReference();
353 }
354 
CreateUDPSocketPrivate(PP_Instance instance)355 PP_Resource ResourceCreationProxy::CreateUDPSocketPrivate(
356     PP_Instance instance) {
357   return (new UDPSocketPrivateResource(
358       GetConnection(), instance))->GetReference();
359 }
360 
CreateVideoDestination(PP_Instance instance)361 PP_Resource ResourceCreationProxy::CreateVideoDestination(
362     PP_Instance instance) {
363   return (new VideoDestinationResource(GetConnection(),
364                                        instance))->GetReference();
365 }
366 
CreateVideoSource(PP_Instance instance)367 PP_Resource ResourceCreationProxy::CreateVideoSource(
368     PP_Instance instance) {
369   return (new VideoSourceResource(GetConnection(), instance))->GetReference();
370 }
371 
CreateWebSocket(PP_Instance instance)372 PP_Resource ResourceCreationProxy::CreateWebSocket(PP_Instance instance) {
373   return (new WebSocketResource(GetConnection(), instance))->GetReference();
374 }
375 
CreateX509CertificatePrivate(PP_Instance instance)376 PP_Resource ResourceCreationProxy::CreateX509CertificatePrivate(
377     PP_Instance instance) {
378   return PPB_X509Certificate_Private_Proxy::CreateProxyResource(instance);
379 }
380 
381 #if !defined(OS_NACL)
CreateAudioInput(PP_Instance instance)382 PP_Resource ResourceCreationProxy::CreateAudioInput(
383     PP_Instance instance) {
384   return (new AudioInputResource(GetConnection(), instance))->GetReference();
385 }
386 
CreateBroker(PP_Instance instance)387 PP_Resource ResourceCreationProxy::CreateBroker(PP_Instance instance) {
388   return PPB_Broker_Proxy::CreateProxyResource(instance);
389 }
390 
CreateBrowserFont(PP_Instance instance,const PP_BrowserFont_Trusted_Description * description)391 PP_Resource ResourceCreationProxy::CreateBrowserFont(
392     PP_Instance instance,
393     const PP_BrowserFont_Trusted_Description* description) {
394   PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
395   if (!dispatcher)
396     return 0;
397   return PluginGlobals::Get()->CreateBrowserFont(
398       GetConnection(), instance, *description, dispatcher->preferences());
399 }
400 
CreateBuffer(PP_Instance instance,uint32_t size)401 PP_Resource ResourceCreationProxy::CreateBuffer(PP_Instance instance,
402                                                 uint32_t size) {
403   return PPB_Buffer_Proxy::CreateProxyResource(instance, size);
404 }
405 
CreateFlashDRM(PP_Instance instance)406 PP_Resource ResourceCreationProxy::CreateFlashDRM(PP_Instance instance) {
407   return (new FlashDRMResource(GetConnection(), instance))->GetReference();
408 }
409 
CreateFlashFontFile(PP_Instance instance,const PP_BrowserFont_Trusted_Description * description,PP_PrivateFontCharset charset)410 PP_Resource ResourceCreationProxy::CreateFlashFontFile(
411     PP_Instance instance,
412     const PP_BrowserFont_Trusted_Description* description,
413     PP_PrivateFontCharset charset) {
414   return (new FlashFontFileResource(
415       GetConnection(), instance, description, charset))->GetReference();
416 }
417 
CreateFlashMenu(PP_Instance instance,const PP_Flash_Menu * menu_data)418 PP_Resource ResourceCreationProxy::CreateFlashMenu(
419     PP_Instance instance,
420     const PP_Flash_Menu* menu_data) {
421   scoped_refptr<FlashMenuResource> flash_menu(
422       new FlashMenuResource(GetConnection(), instance));
423   if (!flash_menu->Initialize(menu_data))
424     return 0;
425   return flash_menu->GetReference();
426 }
427 
CreateFlashMessageLoop(PP_Instance instance)428 PP_Resource ResourceCreationProxy::CreateFlashMessageLoop(
429     PP_Instance instance) {
430   return PPB_Flash_MessageLoop_Proxy::CreateProxyResource(instance);
431 }
432 
CreatePlatformVerificationPrivate(PP_Instance instance)433 PP_Resource ResourceCreationProxy::CreatePlatformVerificationPrivate(
434     PP_Instance instance) {
435   return (new PlatformVerificationPrivateResource(GetConnection(), instance))->
436       GetReference();
437 }
438 
CreateScrollbar(PP_Instance instance,PP_Bool vertical)439 PP_Resource ResourceCreationProxy::CreateScrollbar(PP_Instance instance,
440                                                    PP_Bool vertical) {
441   NOTIMPLEMENTED();  // Not proxied yet.
442   return 0;
443 }
444 
CreateTalk(PP_Instance instance)445 PP_Resource ResourceCreationProxy::CreateTalk(PP_Instance instance) {
446   return (new TalkResource(GetConnection(), instance))->GetReference();
447 }
448 
CreateVideoCapture(PP_Instance instance)449 PP_Resource ResourceCreationProxy::CreateVideoCapture(PP_Instance instance) {
450   PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
451   if (!dispatcher)
452     return 0;
453   return (new VideoCaptureResource(GetConnection(), instance, dispatcher))
454       ->GetReference();
455 }
456 
CreateVideoDecoder(PP_Instance instance,PP_Resource context3d_id,PP_VideoDecoder_Profile profile)457 PP_Resource ResourceCreationProxy::CreateVideoDecoder(
458     PP_Instance instance,
459     PP_Resource context3d_id,
460     PP_VideoDecoder_Profile profile) {
461   return PPB_VideoDecoder_Proxy::CreateProxyResource(
462       instance, context3d_id, profile);
463 }
464 
465 #endif  // !defined(OS_NACL)
466 
Send(IPC::Message * msg)467 bool ResourceCreationProxy::Send(IPC::Message* msg) {
468   return dispatcher()->Send(msg);
469 }
470 
OnMessageReceived(const IPC::Message & msg)471 bool ResourceCreationProxy::OnMessageReceived(const IPC::Message& msg) {
472   return false;
473 }
474 
GetConnection()475 Connection ResourceCreationProxy::GetConnection() {
476   return Connection(PluginGlobals::Get()->GetBrowserSender(), dispatcher());
477 }
478 
479 }  // namespace proxy
480 }  // namespace ppapi
481