Pepper: Fix nits mentioned in review in audio input code.

In particular, dmichael's comments in http://codereview.chromium.org/8574029.

TBR=jam@chromium.org

Review URL: http://codereview.chromium.org/8489002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111007 0039d316-1c4b-4281-b951-d872f2087c98
parent 3701b4ea
......@@ -163,7 +163,6 @@ class PlatformImage2DImpl
DISALLOW_COPY_AND_ASSIGN(PlatformImage2DImpl);
};
class PlatformAudioImpl
: public webkit::ppapi::PluginDelegate::PlatformAudio,
public AudioMessageFilter::Delegate,
......@@ -188,9 +187,9 @@ class PlatformAudioImpl
webkit::ppapi::PluginDelegate::PlatformAudioCommonClient* client);
// PlatformAudio implementation (called on main thread).
virtual bool StartPlayback();
virtual bool StopPlayback();
virtual void ShutDown();
virtual bool StartPlayback() OVERRIDE;
virtual bool StopPlayback() OVERRIDE;
virtual void ShutDown() OVERRIDE;
private:
// I/O thread backends to above functions.
......@@ -199,21 +198,22 @@ class PlatformAudioImpl
void StopPlaybackOnIOThread();
void ShutDownOnIOThread();
virtual void OnRequestPacket(AudioBuffersState buffers_state) {
virtual void OnRequestPacket(AudioBuffersState buffers_state) OVERRIDE {
LOG(FATAL) << "Should never get OnRequestPacket in PlatformAudioImpl";
}
virtual void OnStateChanged(AudioStreamState state) {}
virtual void OnStateChanged(AudioStreamState state) OVERRIDE {}
virtual void OnCreated(base::SharedMemoryHandle handle, uint32 length) {
virtual void OnCreated(base::SharedMemoryHandle handle,
uint32 length) OVERRIDE {
LOG(FATAL) << "Should never get OnCreated in PlatformAudioImpl";
}
virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle,
base::SyncSocket::Handle socket_handle,
uint32 length);
uint32 length) OVERRIDE;
virtual void OnVolume(double volume) {}
virtual void OnVolume(double volume) OVERRIDE {}
// The client to notify when the stream is created. THIS MUST ONLY BE
// ACCESSED ON THE MAIN THREAD.
......@@ -362,9 +362,9 @@ class PlatformAudioInputImpl
webkit::ppapi::PluginDelegate::PlatformAudioCommonClient* client);
// PlatformAudio implementation (called on main thread).
virtual bool StartCapture();
virtual bool StopCapture();
virtual void ShutDown();
virtual bool StartCapture() OVERRIDE;
virtual bool StopCapture() OVERRIDE;
virtual void ShutDown() OVERRIDE;
private:
// I/O thread backends to above functions.
......@@ -375,13 +375,13 @@ class PlatformAudioInputImpl
virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle,
base::SyncSocket::Handle socket_handle,
uint32 length);
uint32 length) OVERRIDE;
virtual void OnVolume(double volume) {}
virtual void OnVolume(double volume) OVERRIDE {}
virtual void OnStateChanged(AudioStreamState state) {}
virtual void OnStateChanged(AudioStreamState state) OVERRIDE {}
virtual void OnDeviceReady(int index) {}
virtual void OnDeviceReady(int index) OVERRIDE {}
// The client to notify when the stream is created. THIS MUST ONLY BE
// ACCESSED ON THE MAIN THREAD.
......
......@@ -11,10 +11,10 @@ label Chrome {
};
/**
* This interface is to be used by proxy implementations. All
* functions should be called from the main thread only. The
* resource returned is an Audio input esource; most of the PPB_Audio
* interface is also usable on this resource.
* This interface is to be used by proxy implementations. All functions should
* be called from the main thread only. The resource returned is an Audio input
* resource; most of the PPB_AudioInput interface is also usable on this
* resource.
*/
[version=0.1, macro="PPB_AUDIO_INPUT_TRUSTED_DEV_INTERFACE"]
interface PPB_AudioInputTrusted_Dev {
......@@ -23,11 +23,10 @@ interface PPB_AudioInputTrusted_Dev {
[in] PP_Instance instance);
/**
* Opens a paused audio interface, used by trusted side of proxy.
* Returns PP_ERROR_WOULD_BLOCK on success, and invokes
* the |create_callback| asynchronously to complete.
* As this function should always be invoked from the main thread,
* do not use the blocking variant of PP_CompletionCallback.
* Opens a paused audio input interface, used by trusted side of proxy.
* Returns PP_ERROR_WOULD_BLOCK on success, and invokes the |create_callback|
* asynchronously to complete. As this function should always be invoked from
* the main thread, do not use the blocking variant of PP_CompletionCallback.
*/
int32_t Open(
[in] PP_Resource audio_input,
......@@ -35,7 +34,7 @@ interface PPB_AudioInputTrusted_Dev {
[in] PP_CompletionCallback create_callback);
/**
* Get the sync socket. Use once Open has completed.
* Get the sync socket. Use once Open has completed.
* Returns PP_OK on success.
*/
int32_t GetSyncSocket(
......@@ -43,7 +42,7 @@ interface PPB_AudioInputTrusted_Dev {
[out] handle_t sync_socket);
/**
* Get the shared memory interface. Use once Open has completed.
* Get the shared memory interface. Use once Open has completed.
* Returns PP_OK on success.
*/
int32_t GetSharedMemory(
......
......@@ -3,7 +3,7 @@
* found in the LICENSE file.
*/
/* From trusted/ppb_audio_input_trusted_dev.idl modified Mon Nov 14 18:13:23 2011. */
/* From trusted/ppb_audio_input_trusted_dev.idl modified Mon Nov 21 12:37:35 2011. */
#ifndef PPAPI_C_TRUSTED_PPB_AUDIO_INPUT_TRUSTED_DEV_H_
#define PPAPI_C_TRUSTED_PPB_AUDIO_INPUT_TRUSTED_DEV_H_
......@@ -30,31 +30,30 @@
* @{
*/
/**
* This interface is to be used by proxy implementations. All
* functions should be called from the main thread only. The
* resource returned is an Audio input esource; most of the PPB_Audio
* interface is also usable on this resource.
* This interface is to be used by proxy implementations. All functions should
* be called from the main thread only. The resource returned is an Audio input
* resource; most of the PPB_AudioInput interface is also usable on this
* resource.
*/
struct PPB_AudioInputTrusted_Dev {
/** Returns an audio input resource. */
PP_Resource (*CreateTrusted)(PP_Instance instance);
/**
* Opens a paused audio interface, used by trusted side of proxy.
* Returns PP_ERROR_WOULD_BLOCK on success, and invokes
* the |create_callback| asynchronously to complete.
* As this function should always be invoked from the main thread,
* do not use the blocking variant of PP_CompletionCallback.
* Opens a paused audio input interface, used by trusted side of proxy.
* Returns PP_ERROR_WOULD_BLOCK on success, and invokes the |create_callback|
* asynchronously to complete. As this function should always be invoked from
* the main thread, do not use the blocking variant of PP_CompletionCallback.
*/
int32_t (*Open)(PP_Resource audio_input,
PP_Resource config,
struct PP_CompletionCallback create_callback);
/**
* Get the sync socket. Use once Open has completed.
* Get the sync socket. Use once Open has completed.
* Returns PP_OK on success.
*/
int32_t (*GetSyncSocket)(PP_Resource audio_input, int* sync_socket);
/**
* Get the shared memory interface. Use once Open has completed.
* Get the shared memory interface. Use once Open has completed.
* Returns PP_OK on success.
*/
int32_t (*GetSharedMemory)(PP_Resource audio_input,
......
......@@ -45,9 +45,10 @@ class PPB_Audio_Impl : public ::ppapi::Resource,
PPB_Audio_Callback audio_callback,
void* user_data);
// Initialization function for non-trusted init.
// Initialization function for trusted init.
bool Init(PP_Resource config_id,
PPB_Audio_Callback user_callback, void* user_data);
PPB_Audio_Callback user_callback,
void* user_data);
// Resource overrides.
virtual ::ppapi::thunk::PPB_Audio_API* AsPPB_Audio_API();
......
......@@ -49,7 +49,7 @@ PP_Resource PPB_AudioInput_Impl::Create(PP_Instance instance,
PPB_AudioInput_Callback audio_input_callback,
void* user_data) {
scoped_refptr<PPB_AudioInput_Impl>
audio_input(new PPB_AudioInput_Impl(instance));
audio_input(new PPB_AudioInput_Impl(instance));
if (!audio_input->Init(config, audio_input_callback, user_data))
return 0;
return audio_input->GetReference();
......
......@@ -44,9 +44,10 @@ class PPB_AudioInput_Impl : public ::ppapi::Resource,
PPB_AudioInput_Callback audio_input_callback,
void* user_data);
// Initialization function for non-trusted init.
// Initialization function for trusted init.
bool Init(PP_Resource config_id,
PPB_AudioInput_Callback callback, void* user_data);
PPB_AudioInput_Callback callback,
void* user_data);
// Resource overrides.
virtual ::ppapi::thunk::PPB_AudioInput_API* AsPPB_AudioInput_API() OVERRIDE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment