| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef PPAPI_PROXY_PPB_AUDIO_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_AUDIO_PROXY_H_ |
| 6 #define PPAPI_PROXY_PPB_AUDIO_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_AUDIO_PROXY_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 struct PPB_Audio; | 23 struct PPB_Audio; |
| 24 | 24 |
| 25 namespace ppapi { | 25 namespace ppapi { |
| 26 | 26 |
| 27 class HostResource; | 27 class HostResource; |
| 28 | 28 |
| 29 namespace proxy { | 29 namespace proxy { |
| 30 | 30 |
| 31 class PPB_Audio_Proxy : public InterfaceProxy { | 31 class PPB_Audio_Proxy : public InterfaceProxy { |
| 32 public: | 32 public: |
| 33 PPB_Audio_Proxy(Dispatcher* dispatcher, const void* target_interface); | 33 PPB_Audio_Proxy(Dispatcher* dispatcher); |
| 34 virtual ~PPB_Audio_Proxy(); | 34 virtual ~PPB_Audio_Proxy(); |
| 35 | 35 |
| 36 static const Info* GetInfo(); | |
| 37 | |
| 38 // Creates an Audio object in the plugin process. | 36 // Creates an Audio object in the plugin process. |
| 39 static PP_Resource CreateProxyResource(PP_Instance instance_id, | 37 static PP_Resource CreateProxyResource(PP_Instance instance_id, |
| 40 PP_Resource config_id, | 38 PP_Resource config_id, |
| 41 PPB_Audio_Callback audio_callback, | 39 PPB_Audio_Callback audio_callback, |
| 42 void* user_data); | 40 void* user_data); |
| 43 | 41 |
| 44 | 42 |
| 45 const PPB_Audio* ppb_audio_target() const { | |
| 46 return static_cast<const PPB_Audio*>(target_interface()); | |
| 47 } | |
| 48 | |
| 49 // InterfaceProxy implementation. | 43 // InterfaceProxy implementation. |
| 50 virtual bool OnMessageReceived(const IPC::Message& msg); | 44 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 51 | 45 |
| 46 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_AUDIO; |
| 47 |
| 52 private: | 48 private: |
| 53 // Plugin->renderer message handlers. | 49 // Plugin->renderer message handlers. |
| 54 void OnMsgCreate(PP_Instance instance_id, | 50 void OnMsgCreate(PP_Instance instance_id, |
| 55 int32_t sample_rate, | 51 int32_t sample_rate, |
| 56 uint32_t sample_frame_count, | 52 uint32_t sample_frame_count, |
| 57 ppapi::HostResource* result); | 53 ppapi::HostResource* result); |
| 58 void OnMsgStartOrStop(const ppapi::HostResource& audio_id, bool play); | 54 void OnMsgStartOrStop(const ppapi::HostResource& audio_id, bool play); |
| 59 | 55 |
| 60 // Renderer->plugin message handlers. | 56 // Renderer->plugin message handlers. |
| 61 void OnMsgNotifyAudioStreamCreated(const ppapi::HostResource& audio_id, | 57 void OnMsgNotifyAudioStreamCreated(const ppapi::HostResource& audio_id, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 84 pp::CompletionCallbackFactory<PPB_Audio_Proxy, | 80 pp::CompletionCallbackFactory<PPB_Audio_Proxy, |
| 85 ProxyNonThreadSafeRefCount> callback_factory_; | 81 ProxyNonThreadSafeRefCount> callback_factory_; |
| 86 | 82 |
| 87 DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Proxy); | 83 DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Proxy); |
| 88 }; | 84 }; |
| 89 | 85 |
| 90 } // namespace proxy | 86 } // namespace proxy |
| 91 } // namespace ppapi | 87 } // namespace ppapi |
| 92 | 88 |
| 93 #endif // PPAPI_PROXY_PPB_AUDIO_PROXY_H_ | 89 #endif // PPAPI_PROXY_PPB_AUDIO_PROXY_H_ |
| OLD | NEW |