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 WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_IMPL_H_ | 5 #ifndef WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_IMPL_H_ |
6 #define WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_IMPL_H_ | 6 #define WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 // The implementation is actually in AudioConfigImpl. | 28 // The implementation is actually in AudioConfigImpl. |
29 class PPB_AudioConfig_Impl : public Resource, | 29 class PPB_AudioConfig_Impl : public Resource, |
30 public ::ppapi::AudioConfigImpl { | 30 public ::ppapi::AudioConfigImpl { |
31 public: | 31 public: |
32 // Note that you must call Init (on AudioConfigImpl) before using this class. | 32 // Note that you must call Init (on AudioConfigImpl) before using this class. |
33 PPB_AudioConfig_Impl(PluginInstance* instance); | 33 PPB_AudioConfig_Impl(PluginInstance* instance); |
34 virtual ~PPB_AudioConfig_Impl(); | 34 virtual ~PPB_AudioConfig_Impl(); |
35 | 35 |
36 // ResourceObjectBase overrides. | 36 // ResourceObjectBase overrides. |
37 virtual ::ppapi::thunk::PPB_AudioConfig_API* AsPPB_AudioConfig_API() OVERRIDE; | 37 virtual ::ppapi::thunk::PPB_AudioConfig_API* AsAudioConfig_API() OVERRIDE; |
38 | 38 |
39 private: | 39 private: |
40 DISALLOW_COPY_AND_ASSIGN(PPB_AudioConfig_Impl); | 40 DISALLOW_COPY_AND_ASSIGN(PPB_AudioConfig_Impl); |
41 }; | 41 }; |
42 | 42 |
43 // Some of the backend functionality of this class is implemented by the | 43 // Some of the backend functionality of this class is implemented by the |
44 // AudioImpl so it can be shared with the proxy. | 44 // AudioImpl so it can be shared with the proxy. |
45 class PPB_Audio_Impl : public Resource, | 45 class PPB_Audio_Impl : public Resource, |
46 public ::ppapi::AudioImpl, | 46 public ::ppapi::AudioImpl, |
47 public ::ppapi::thunk::PPB_AudioTrusted_API, | 47 public ::ppapi::thunk::PPB_AudioTrusted_API, |
48 public PluginDelegate::PlatformAudio::Client { | 48 public PluginDelegate::PlatformAudio::Client { |
49 public: | 49 public: |
50 // After creation, either call Init (for non-trusted init) or OpenTrusted | 50 // After creation, either call Init (for non-trusted init) or OpenTrusted |
51 // (for trusted init). | 51 // (for trusted init). |
52 explicit PPB_Audio_Impl(PluginInstance* instance); | 52 explicit PPB_Audio_Impl(PluginInstance* instance); |
53 virtual ~PPB_Audio_Impl(); | 53 virtual ~PPB_Audio_Impl(); |
54 | 54 |
55 // Initialization function for non-trusted init. | 55 // Initialization function for non-trusted init. |
56 bool Init(PP_Resource config_id, | 56 bool Init(PP_Resource config_id, |
57 PPB_Audio_Callback user_callback, void* user_data); | 57 PPB_Audio_Callback user_callback, void* user_data); |
58 | 58 |
59 // ResourceObjectBase overrides. | 59 // ResourceObjectBase overrides. |
60 virtual ::ppapi::thunk::PPB_Audio_API* AsPPB_Audio_API(); | 60 virtual ::ppapi::thunk::PPB_Audio_API* AsAudio_API(); |
61 virtual ::ppapi::thunk::PPB_AudioTrusted_API* AsPPB_AudioTrusted_API(); | 61 virtual ::ppapi::thunk::PPB_AudioTrusted_API* AsAudioTrusted_API(); |
62 | 62 |
63 // PPB_Audio_API implementation. | 63 // PPB_Audio_API implementation. |
64 virtual PP_Resource GetCurrentConfig() OVERRIDE; | 64 virtual PP_Resource GetCurrentConfig() OVERRIDE; |
65 virtual PP_Bool StartPlayback() OVERRIDE; | 65 virtual PP_Bool StartPlayback() OVERRIDE; |
66 virtual PP_Bool StopPlayback() OVERRIDE; | 66 virtual PP_Bool StopPlayback() OVERRIDE; |
67 | 67 |
68 // PPB_AudioTrusted_API implementation. | 68 // PPB_AudioTrusted_API implementation. |
69 virtual int32_t OpenTrusted(PP_Resource config_id, | 69 virtual int32_t OpenTrusted(PP_Resource config_id, |
70 PP_CompletionCallback create_callback) OVERRIDE; | 70 PP_CompletionCallback create_callback) OVERRIDE; |
71 virtual int32_t GetSyncSocket(int* sync_socket) OVERRIDE; | 71 virtual int32_t GetSyncSocket(int* sync_socket) OVERRIDE; |
(...skipping 26 matching lines...) Expand all Loading... |
98 size_t shared_memory_size_for_create_callback_; | 98 size_t shared_memory_size_for_create_callback_; |
99 scoped_ptr<base::SyncSocket> socket_for_create_callback_; | 99 scoped_ptr<base::SyncSocket> socket_for_create_callback_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl); | 101 DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl); |
102 }; | 102 }; |
103 | 103 |
104 } // namespace ppapi | 104 } // namespace ppapi |
105 } // namespace webkit | 105 } // namespace webkit |
106 | 106 |
107 #endif // WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_IMPL_H_ | 107 #endif // WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_IMPL_H_ |
OLD | NEW |