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 17 matching lines...) Expand all Loading... |
28 class PPB_AudioConfig_Impl : public Resource, | 28 class PPB_AudioConfig_Impl : public Resource, |
29 public ::ppapi::AudioConfigImpl { | 29 public ::ppapi::AudioConfigImpl { |
30 public: | 30 public: |
31 virtual ~PPB_AudioConfig_Impl(); | 31 virtual ~PPB_AudioConfig_Impl(); |
32 | 32 |
33 // Non-trusted creation. | 33 // Non-trusted creation. |
34 static PP_Resource Create(PluginInstance* instance, | 34 static PP_Resource Create(PluginInstance* instance, |
35 PP_AudioSampleRate sample_rate, | 35 PP_AudioSampleRate sample_rate, |
36 uint32_t sample_frame_count); | 36 uint32_t sample_frame_count); |
37 | 37 |
38 // ResourceObjectBase overrides. | 38 // Resource overrides. |
39 virtual ::ppapi::thunk::PPB_AudioConfig_API* AsPPB_AudioConfig_API() OVERRIDE; | 39 virtual ::ppapi::thunk::PPB_AudioConfig_API* AsPPB_AudioConfig_API() OVERRIDE; |
40 | 40 |
41 private: | 41 private: |
42 explicit PPB_AudioConfig_Impl(PluginInstance* instance); | 42 explicit PPB_AudioConfig_Impl(PluginInstance* instance); |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(PPB_AudioConfig_Impl); | 44 DISALLOW_COPY_AND_ASSIGN(PPB_AudioConfig_Impl); |
45 }; | 45 }; |
46 | 46 |
47 // Some of the backend functionality of this class is implemented by the | 47 // Some of the backend functionality of this class is implemented by the |
48 // AudioImpl so it can be shared with the proxy. | 48 // AudioImpl so it can be shared with the proxy. |
(...skipping 13 matching lines...) Expand all Loading... |
62 // and will return 0 on failure. | 62 // and will return 0 on failure. |
63 static PP_Resource Create(PluginInstance* instance, | 63 static PP_Resource Create(PluginInstance* instance, |
64 PP_Resource config_id, | 64 PP_Resource config_id, |
65 PPB_Audio_Callback audio_callback, | 65 PPB_Audio_Callback audio_callback, |
66 void* user_data); | 66 void* user_data); |
67 | 67 |
68 // Initialization function for non-trusted init. | 68 // Initialization function for non-trusted init. |
69 bool Init(PP_Resource config_id, | 69 bool Init(PP_Resource config_id, |
70 PPB_Audio_Callback user_callback, void* user_data); | 70 PPB_Audio_Callback user_callback, void* user_data); |
71 | 71 |
72 // ResourceObjectBase overrides. | 72 // Resource overrides. |
73 virtual ::ppapi::thunk::PPB_Audio_API* AsPPB_Audio_API(); | 73 virtual ::ppapi::thunk::PPB_Audio_API* AsPPB_Audio_API(); |
74 | 74 |
75 // PPB_Audio_API implementation. | 75 // PPB_Audio_API implementation. |
76 virtual PP_Resource GetCurrentConfig() OVERRIDE; | 76 virtual PP_Resource GetCurrentConfig() OVERRIDE; |
77 virtual PP_Bool StartPlayback() OVERRIDE; | 77 virtual PP_Bool StartPlayback() OVERRIDE; |
78 virtual PP_Bool StopPlayback() OVERRIDE; | 78 virtual PP_Bool StopPlayback() OVERRIDE; |
79 virtual int32_t OpenTrusted(PP_Resource config_id, | 79 virtual int32_t OpenTrusted(PP_Resource config_id, |
80 PP_CompletionCallback create_callback) OVERRIDE; | 80 PP_CompletionCallback create_callback) OVERRIDE; |
81 virtual int32_t GetSyncSocket(int* sync_socket) OVERRIDE; | 81 virtual int32_t GetSyncSocket(int* sync_socket) OVERRIDE; |
82 virtual int32_t GetSharedMemory(int* shm_handle, uint32_t* shm_size) OVERRIDE; | 82 virtual int32_t GetSharedMemory(int* shm_handle, uint32_t* shm_size) OVERRIDE; |
(...skipping 25 matching lines...) Expand all Loading... |
108 size_t shared_memory_size_for_create_callback_; | 108 size_t shared_memory_size_for_create_callback_; |
109 scoped_ptr<base::SyncSocket> socket_for_create_callback_; | 109 scoped_ptr<base::SyncSocket> socket_for_create_callback_; |
110 | 110 |
111 DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl); | 111 DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl); |
112 }; | 112 }; |
113 | 113 |
114 } // namespace ppapi | 114 } // namespace ppapi |
115 } // namespace webkit | 115 } // namespace webkit |
116 | 116 |
117 #endif // WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_IMPL_H_ | 117 #endif // WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_IMPL_H_ |
OLD | NEW |