| Index: ppapi/shared_impl/ppb_audio_shared.cc
|
| diff --git a/ppapi/shared_impl/audio_impl.cc b/ppapi/shared_impl/ppb_audio_shared.cc
|
| similarity index 77%
|
| rename from ppapi/shared_impl/audio_impl.cc
|
| rename to ppapi/shared_impl/ppb_audio_shared.cc
|
| index b684ab1263c460c0b89c9d9de81c83b9d161b17f..5385106025910836ddd4e92e7f69c227daf5108e 100644
|
| --- a/ppapi/shared_impl/audio_impl.cc
|
| +++ b/ppapi/shared_impl/ppb_audio_shared.cc
|
| @@ -2,20 +2,20 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "ppapi/shared_impl/audio_impl.h"
|
| +#include "ppapi/shared_impl/ppb_audio_shared.h"
|
|
|
| #include "base/logging.h"
|
|
|
| namespace ppapi {
|
|
|
| -AudioImpl::AudioImpl()
|
| +PPB_Audio_Shared::PPB_Audio_Shared()
|
| : playing_(false),
|
| shared_memory_size_(0),
|
| callback_(NULL),
|
| user_data_(NULL) {
|
| }
|
|
|
| -AudioImpl::~AudioImpl() {
|
| +PPB_Audio_Shared::~PPB_Audio_Shared() {
|
| // Closing the socket causes the thread to exit - wait for it.
|
| if (socket_.get())
|
| socket_->Close();
|
| @@ -25,12 +25,13 @@ AudioImpl::~AudioImpl() {
|
| }
|
| }
|
|
|
| -void AudioImpl::SetCallback(PPB_Audio_Callback callback, void* user_data) {
|
| +void PPB_Audio_Shared::SetCallback(PPB_Audio_Callback callback,
|
| + void* user_data) {
|
| callback_ = callback;
|
| user_data_ = user_data;
|
| }
|
|
|
| -void AudioImpl::SetStartPlaybackState() {
|
| +void PPB_Audio_Shared::SetStartPlaybackState() {
|
| DCHECK(!playing_);
|
| DCHECK(!audio_thread_.get());
|
|
|
| @@ -44,7 +45,7 @@ void AudioImpl::SetStartPlaybackState() {
|
| playing_ = true;
|
| }
|
|
|
| -void AudioImpl::SetStopPlaybackState() {
|
| +void PPB_Audio_Shared::SetStopPlaybackState() {
|
| DCHECK(playing_);
|
|
|
| if (audio_thread_.get()) {
|
| @@ -54,9 +55,10 @@ void AudioImpl::SetStopPlaybackState() {
|
| playing_ = false;
|
| }
|
|
|
| -void AudioImpl::SetStreamInfo(base::SharedMemoryHandle shared_memory_handle,
|
| - size_t shared_memory_size,
|
| - base::SyncSocket::Handle socket_handle) {
|
| +void PPB_Audio_Shared::SetStreamInfo(
|
| + base::SharedMemoryHandle shared_memory_handle,
|
| + size_t shared_memory_size,
|
| + base::SyncSocket::Handle socket_handle) {
|
| socket_.reset(new base::SyncSocket(socket_handle));
|
| shared_memory_.reset(new base::SharedMemory(shared_memory_handle, false));
|
| shared_memory_size_ = shared_memory_size;
|
| @@ -70,7 +72,7 @@ void AudioImpl::SetStreamInfo(base::SharedMemoryHandle shared_memory_handle,
|
| }
|
| }
|
|
|
| -void AudioImpl::StartThread() {
|
| +void PPB_Audio_Shared::StartThread() {
|
| DCHECK(callback_);
|
| DCHECK(!audio_thread_.get());
|
| audio_thread_.reset(new base::DelegateSimpleThread(
|
| @@ -78,7 +80,7 @@ void AudioImpl::StartThread() {
|
| audio_thread_->Start();
|
| }
|
|
|
| -void AudioImpl::Run() {
|
| +void PPB_Audio_Shared::Run() {
|
| int pending_data;
|
| void* buffer = shared_memory_->memory();
|
|
|
|
|