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" |
11 #include "base/sync_socket.h" | 11 #include "base/sync_socket.h" |
12 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
13 #include "ppapi/c/ppb_audio.h" | 13 #include "ppapi/c/ppb_audio.h" |
14 #include "ppapi/c/ppb_audio_config.h" | 14 #include "ppapi/c/ppb_audio_config.h" |
15 #include "ppapi/c/trusted/ppb_audio_trusted.h" | 15 #include "ppapi/c/trusted/ppb_audio_trusted.h" |
16 #include "ppapi/shared_impl/audio_config_impl.h" | 16 #include "ppapi/shared_impl/audio_config_impl.h" |
17 #include "ppapi/shared_impl/audio_impl.h" | 17 #include "ppapi/shared_impl/audio_impl.h" |
18 #include "ppapi/shared_impl/scoped_pp_resource.h" | 18 #include "ppapi/shared_impl/scoped_pp_resource.h" |
19 #include "ppapi/shared_impl/resource.h" | 19 #include "ppapi/shared_impl/resource.h" |
20 #include "webkit/plugins/ppapi/plugin_delegate.h" | 20 #include "webkit/plugins/ppapi/plugin_delegate.h" |
21 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 21 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
22 | 22 |
23 namespace webkit { | 23 namespace webkit { |
24 namespace ppapi { | 24 namespace ppapi { |
25 | 25 |
26 // The implementation is actually in AudioConfigImpl. | |
27 class PPB_AudioConfig_Impl : public ::ppapi::Resource, | |
28 public ::ppapi::AudioConfigImpl { | |
29 public: | |
30 virtual ~PPB_AudioConfig_Impl(); | |
31 | |
32 // Non-trusted creation. | |
33 static PP_Resource Create(PP_Instance instance, | |
34 PP_AudioSampleRate sample_rate, | |
35 uint32_t sample_frame_count); | |
36 | |
37 // Resource overrides. | |
38 virtual ::ppapi::thunk::PPB_AudioConfig_API* AsPPB_AudioConfig_API() OVERRIDE; | |
39 | |
40 private: | |
41 explicit PPB_AudioConfig_Impl(PP_Instance instance); | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(PPB_AudioConfig_Impl); | |
44 }; | |
45 | |
46 // Some of the backend functionality of this class is implemented by the | 26 // Some of the backend functionality of this class is implemented by the |
47 // AudioImpl so it can be shared with the proxy. | 27 // AudioImpl so it can be shared with the proxy. |
48 class PPB_Audio_Impl : public ::ppapi::Resource, | 28 class PPB_Audio_Impl : public ::ppapi::Resource, |
49 public ::ppapi::AudioImpl, | 29 public ::ppapi::AudioImpl, |
50 public PluginDelegate::PlatformAudio::Client { | 30 public PluginDelegate::PlatformAudio::Client { |
51 public: | 31 public: |
52 // Trusted initialization. You must call Init after this. | 32 // Trusted initialization. You must call Init after this. |
53 // | 33 // |
54 // Untrusted initialization should just call the static Create() function | 34 // Untrusted initialization should just call the static Create() function |
55 // to properly create & initialize this class. | 35 // to properly create & initialize this class. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 size_t shared_memory_size_for_create_callback_; | 87 size_t shared_memory_size_for_create_callback_; |
108 scoped_ptr<base::SyncSocket> socket_for_create_callback_; | 88 scoped_ptr<base::SyncSocket> socket_for_create_callback_; |
109 | 89 |
110 DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl); | 90 DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl); |
111 }; | 91 }; |
112 | 92 |
113 } // namespace ppapi | 93 } // namespace ppapi |
114 } // namespace webkit | 94 } // namespace webkit |
115 | 95 |
116 #endif // WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_IMPL_H_ | 96 #endif // WEBKIT_PLUGINS_PPAPI_PPB_AUDIO_IMPL_H_ |
OLD | NEW |