OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/proxy/ppb_instance_proxy.h" | 5 #include "ppapi/proxy/ppb_instance_proxy.h" |
6 | 6 |
7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
8 #include "ppapi/c/pp_var.h" | 8 #include "ppapi/c/pp_var.h" |
9 #include "ppapi/c/ppb_audio_config.h" | |
9 #include "ppapi/c/ppb_instance.h" | 10 #include "ppapi/c/ppb_instance.h" |
10 #include "ppapi/c/ppb_messaging.h" | 11 #include "ppapi/c/ppb_messaging.h" |
11 #include "ppapi/c/ppb_mouse_lock.h" | 12 #include "ppapi/c/ppb_mouse_lock.h" |
12 #include "ppapi/proxy/enter_proxy.h" | 13 #include "ppapi/proxy/enter_proxy.h" |
13 #include "ppapi/proxy/host_dispatcher.h" | 14 #include "ppapi/proxy/host_dispatcher.h" |
14 #include "ppapi/proxy/plugin_dispatcher.h" | 15 #include "ppapi/proxy/plugin_dispatcher.h" |
15 #include "ppapi/proxy/ppapi_messages.h" | 16 #include "ppapi/proxy/ppapi_messages.h" |
16 #include "ppapi/proxy/serialized_var.h" | 17 #include "ppapi/proxy/serialized_var.h" |
17 #include "ppapi/shared_impl/ppapi_globals.h" | 18 #include "ppapi/shared_impl/ppapi_globals.h" |
18 #include "ppapi/shared_impl/ppb_url_util_shared.h" | 19 #include "ppapi/shared_impl/ppb_url_util_shared.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 IPC_BEGIN_MESSAGE_MAP(PPB_Instance_Proxy, msg) | 74 IPC_BEGIN_MESSAGE_MAP(PPB_Instance_Proxy, msg) |
74 // Plugin -> Host messages. | 75 // Plugin -> Host messages. |
75 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetWindowObject, | 76 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetWindowObject, |
76 OnHostMsgGetWindowObject) | 77 OnHostMsgGetWindowObject) |
77 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetOwnerElementObject, | 78 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetOwnerElementObject, |
78 OnHostMsgGetOwnerElementObject) | 79 OnHostMsgGetOwnerElementObject) |
79 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_BindGraphics, | 80 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_BindGraphics, |
80 OnHostMsgBindGraphics) | 81 OnHostMsgBindGraphics) |
81 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_IsFullFrame, | 82 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_IsFullFrame, |
82 OnHostMsgIsFullFrame) | 83 OnHostMsgIsFullFrame) |
84 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_AudioHardwareOutputSampleRate, | |
85 OnHostMsgAudioHardwareOutputSampleRate) | |
86 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_AudioHardwareOutputBufferSize, | |
87 OnHostMsgAudioHardwareOutputBufferSize) | |
83 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ExecuteScript, | 88 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ExecuteScript, |
84 OnHostMsgExecuteScript) | 89 OnHostMsgExecuteScript) |
85 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetDefaultCharSet, | 90 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetDefaultCharSet, |
86 OnHostMsgGetDefaultCharSet) | 91 OnHostMsgGetDefaultCharSet) |
87 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PostMessage, | 92 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_PostMessage, |
88 OnHostMsgPostMessage) | 93 OnHostMsgPostMessage) |
89 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_FlashSetFullscreen, | 94 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_FlashSetFullscreen, |
90 OnHostMsgFlashSetFullscreen) | 95 OnHostMsgFlashSetFullscreen) |
91 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_FlashGetScreenSize, | 96 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_FlashGetScreenSize, |
92 OnHostMsgFlashGetScreenSize) | 97 OnHostMsgFlashGetScreenSize) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 if (se.IsThrown()) | 181 if (se.IsThrown()) |
177 return PP_MakeUndefined(); | 182 return PP_MakeUndefined(); |
178 | 183 |
179 ReceiveSerializedVarReturnValue result; | 184 ReceiveSerializedVarReturnValue result; |
180 dispatcher()->Send(new PpapiHostMsg_PPBInstance_ExecuteScript( | 185 dispatcher()->Send(new PpapiHostMsg_PPBInstance_ExecuteScript( |
181 API_ID_PPB_INSTANCE, instance, | 186 API_ID_PPB_INSTANCE, instance, |
182 SerializedVarSendInput(dispatcher(), script), &se, &result)); | 187 SerializedVarSendInput(dispatcher(), script), &se, &result)); |
183 return result.Return(dispatcher()); | 188 return result.Return(dispatcher()); |
184 } | 189 } |
185 | 190 |
191 uint32_t PPB_Instance_Proxy:: | |
brettw
2012/02/10 19:01:33
Style: Don't wrap after the :: if you don't need t
nfullagar
2012/02/14 00:42:37
Done.
| |
192 AudioHardwareOutputSampleRate(PP_Instance instance) { | |
193 uint32_t result = PP_AUDIOSAMPLERATE_NONE; | |
194 dispatcher()->Send(new PpapiHostMsg_PPBInstance_AudioHardwareOutputSampleRate( | |
brettw
2012/02/10 19:01:33
Can the messages and handlers be made to match the
nfullagar
2012/02/14 00:42:37
Changed to GetAudio... (as you suggested in a late
| |
195 API_ID_PPB_INSTANCE, instance, &result)); | |
196 return result; | |
197 } | |
198 | |
199 uint32_t PPB_Instance_Proxy:: | |
200 AudioHardwareOutputBufferSize(PP_Instance instance) { | |
201 uint32_t result = 0; | |
202 dispatcher()->Send(new PpapiHostMsg_PPBInstance_AudioHardwareOutputBufferSize( | |
203 API_ID_PPB_INSTANCE, instance, &result)); | |
204 return result; | |
205 } | |
206 | |
186 PP_Var PPB_Instance_Proxy::GetDefaultCharSet(PP_Instance instance) { | 207 PP_Var PPB_Instance_Proxy::GetDefaultCharSet(PP_Instance instance) { |
187 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); | 208 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
188 if (!dispatcher) | 209 if (!dispatcher) |
189 return PP_MakeUndefined(); | 210 return PP_MakeUndefined(); |
190 | 211 |
191 ReceiveSerializedVarReturnValue result; | 212 ReceiveSerializedVarReturnValue result; |
192 dispatcher->Send(new PpapiHostMsg_PPBInstance_GetDefaultCharSet( | 213 dispatcher->Send(new PpapiHostMsg_PPBInstance_GetDefaultCharSet( |
193 API_ID_PPB_INSTANCE, instance, &result)); | 214 API_ID_PPB_INSTANCE, instance, &result)); |
194 return result.Return(dispatcher); | 215 return result.Return(dispatcher); |
195 } | 216 } |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
397 void PPB_Instance_Proxy::OnHostMsgBindGraphics(PP_Instance instance, | 418 void PPB_Instance_Proxy::OnHostMsgBindGraphics(PP_Instance instance, |
398 const HostResource& device, | 419 const HostResource& device, |
399 PP_Bool* result) { | 420 PP_Bool* result) { |
400 EnterInstanceNoLock enter(instance, false); | 421 EnterInstanceNoLock enter(instance, false); |
401 if (enter.succeeded()) { | 422 if (enter.succeeded()) { |
402 *result = enter.functions()->BindGraphics(instance, | 423 *result = enter.functions()->BindGraphics(instance, |
403 device.host_resource()); | 424 device.host_resource()); |
404 } | 425 } |
405 } | 426 } |
406 | 427 |
428 void PPB_Instance_Proxy::OnHostMsgAudioHardwareOutputSampleRate( | |
429 PP_Instance instance, uint32_t* result) { | |
430 EnterInstanceNoLock enter(instance, false); | |
431 if (enter.succeeded()) | |
432 *result = enter.functions()->AudioHardwareOutputSampleRate(instance); | |
433 } | |
434 | |
435 void PPB_Instance_Proxy::OnHostMsgAudioHardwareOutputBufferSize( | |
436 PP_Instance instance, uint32_t* result) { | |
437 EnterInstanceNoLock enter(instance, false); | |
438 if (enter.succeeded()) | |
439 *result = enter.functions()->AudioHardwareOutputBufferSize(instance); | |
440 } | |
441 | |
407 void PPB_Instance_Proxy::OnHostMsgIsFullFrame(PP_Instance instance, | 442 void PPB_Instance_Proxy::OnHostMsgIsFullFrame(PP_Instance instance, |
408 PP_Bool* result) { | 443 PP_Bool* result) { |
409 EnterInstanceNoLock enter(instance, false); | 444 EnterInstanceNoLock enter(instance, false); |
410 if (enter.succeeded()) | 445 if (enter.succeeded()) |
411 *result = enter.functions()->IsFullFrame(instance); | 446 *result = enter.functions()->IsFullFrame(instance); |
412 } | 447 } |
413 | 448 |
414 void PPB_Instance_Proxy::OnHostMsgExecuteScript( | 449 void PPB_Instance_Proxy::OnHostMsgExecuteScript( |
415 PP_Instance instance, | 450 PP_Instance instance, |
416 SerializedVarReceiveInput script, | 451 SerializedVarReceiveInput script, |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
577 } | 612 } |
578 | 613 |
579 void PPB_Instance_Proxy::MouseLockCompleteInHost(int32_t result, | 614 void PPB_Instance_Proxy::MouseLockCompleteInHost(int32_t result, |
580 PP_Instance instance) { | 615 PP_Instance instance) { |
581 dispatcher()->Send(new PpapiMsg_PPBInstance_MouseLockComplete( | 616 dispatcher()->Send(new PpapiMsg_PPBInstance_MouseLockComplete( |
582 API_ID_PPB_INSTANCE, instance, result)); | 617 API_ID_PPB_INSTANCE, instance, result)); |
583 } | 618 } |
584 | 619 |
585 } // namespace proxy | 620 } // namespace proxy |
586 } // namespace ppapi | 621 } // namespace ppapi |
OLD | NEW |