| 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 #include "webkit/plugins/ppapi/ppb_audio_input_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_audio_input_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ppapi/c/dev/ppb_audio_input_dev.h" | 8 #include "ppapi/c/dev/ppb_audio_input_dev.h" |
| 9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
| 10 #include "ppapi/c/ppb_audio_config.h" | 10 #include "ppapi/c/ppb_audio_config.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 using ppapi::thunk::PPB_AudioInput_API; | 21 using ppapi::thunk::PPB_AudioInput_API; |
| 22 using ppapi::thunk::PPB_AudioConfig_API; | 22 using ppapi::thunk::PPB_AudioConfig_API; |
| 23 using ppapi::TrackedCallback; | 23 using ppapi::TrackedCallback; |
| 24 | 24 |
| 25 namespace webkit { | 25 namespace webkit { |
| 26 namespace ppapi { | 26 namespace ppapi { |
| 27 | 27 |
| 28 // PPB_AudioInput_Impl --------------------------------------------------------- | 28 // PPB_AudioInput_Impl --------------------------------------------------------- |
| 29 | 29 |
| 30 PPB_AudioInput_Impl::PPB_AudioInput_Impl(PP_Instance instance) | 30 PPB_AudioInput_Impl::PPB_AudioInput_Impl(PP_Instance instance) |
| 31 : Resource(instance), | 31 : Resource(::ppapi::OBJECT_IS_IMPL, instance), |
| 32 audio_input_(NULL) { | 32 audio_input_(NULL) { |
| 33 } | 33 } |
| 34 | 34 |
| 35 PPB_AudioInput_Impl::~PPB_AudioInput_Impl() { | 35 PPB_AudioInput_Impl::~PPB_AudioInput_Impl() { |
| 36 // Calling ShutDown() makes sure StreamCreated cannot be called anymore and | 36 // Calling ShutDown() makes sure StreamCreated cannot be called anymore and |
| 37 // releases the audio data associated with the pointer. Note however, that | 37 // releases the audio data associated with the pointer. Note however, that |
| 38 // until ShutDown returns, StreamCreated may still be called. This will be | 38 // until ShutDown returns, StreamCreated may still be called. This will be |
| 39 // OK since we'll just immediately clean up the data it stored later in this | 39 // OK since we'll just immediately clean up the data it stored later in this |
| 40 // destructor. | 40 // destructor. |
| 41 if (audio_input_) { | 41 if (audio_input_) { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 void PPB_AudioInput_Impl::OnSetStreamInfo( | 155 void PPB_AudioInput_Impl::OnSetStreamInfo( |
| 156 base::SharedMemoryHandle shared_memory_handle, | 156 base::SharedMemoryHandle shared_memory_handle, |
| 157 size_t shared_memory_size, | 157 size_t shared_memory_size, |
| 158 base::SyncSocket::Handle socket_handle) { | 158 base::SyncSocket::Handle socket_handle) { |
| 159 SetStreamInfo(shared_memory_handle, shared_memory_size, socket_handle); | 159 SetStreamInfo(shared_memory_handle, shared_memory_size, socket_handle); |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace ppapi | 162 } // namespace ppapi |
| 163 } // namespace webkit | 163 } // namespace webkit |
| OLD | NEW |