| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PPAPI_SHARED_IMPL_AUDIO_CONFIG_IMPL_H_ | |
| 6 #define PPAPI_SHARED_IMPL_AUDIO_CONFIG_IMPL_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "ppapi/shared_impl/resource.h" | |
| 11 #include "ppapi/thunk/ppb_audio_config_api.h" | |
| 12 | |
| 13 namespace ppapi { | |
| 14 | |
| 15 class PPAPI_SHARED_EXPORT AudioConfigImpl | |
| 16 : public Resource, | |
| 17 public thunk::PPB_AudioConfig_API { | |
| 18 public: | |
| 19 virtual ~AudioConfigImpl(); | |
| 20 | |
| 21 static PP_Resource CreateAsImpl(PP_Instance instance, | |
| 22 PP_AudioSampleRate sample_rate, | |
| 23 uint32_t sample_frame_count); | |
| 24 static PP_Resource CreateAsProxy(PP_Instance instance, | |
| 25 PP_AudioSampleRate sample_rate, | |
| 26 uint32_t sample_frame_count); | |
| 27 | |
| 28 // Resource overrides. | |
| 29 virtual thunk::PPB_AudioConfig_API* AsPPB_AudioConfig_API() OVERRIDE; | |
| 30 | |
| 31 // PPB_AudioConfig_API implementation. | |
| 32 virtual PP_AudioSampleRate GetSampleRate() OVERRIDE; | |
| 33 virtual uint32_t GetSampleFrameCount() OVERRIDE; | |
| 34 | |
| 35 private: | |
| 36 // You must call Init before using this object. | |
| 37 explicit AudioConfigImpl(PP_Instance instance); // Impl c'tor. | |
| 38 explicit AudioConfigImpl(const HostResource& host_resource); // Proxy c'tor. | |
| 39 | |
| 40 // Returns false if the arguments are invalid, the object should not be | |
| 41 // used in this case. | |
| 42 bool Init(PP_AudioSampleRate sample_rate, uint32_t sample_frame_count); | |
| 43 | |
| 44 PP_AudioSampleRate sample_rate_; | |
| 45 uint32_t sample_frame_count_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(AudioConfigImpl); | |
| 48 }; | |
| 49 | |
| 50 } // namespace ppapi | |
| 51 | |
| 52 #endif // PPAPI_SHARED_IMPL_AUDIO_CONFIG_IMPL_H_ | |
| OLD | NEW |