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 ...@@ -163,7 +163,6 @@ class PlatformImage2DImpl
DISALLOW_COPY_AND_ASSIGN(PlatformImage2DImpl); DISALLOW_COPY_AND_ASSIGN(PlatformImage2DImpl);
}; };
class PlatformAudioImpl class PlatformAudioImpl
: public webkit::ppapi::PluginDelegate::PlatformAudio, : public webkit::ppapi::PluginDelegate::PlatformAudio,
public AudioMessageFilter::Delegate, public AudioMessageFilter::Delegate,
...@@ -188,9 +187,9 @@ class PlatformAudioImpl ...@@ -188,9 +187,9 @@ class PlatformAudioImpl
webkit::ppapi::PluginDelegate::PlatformAudioCommonClient* client); webkit::ppapi::PluginDelegate::PlatformAudioCommonClient* client);
// PlatformAudio implementation (called on main thread). // PlatformAudio implementation (called on main thread).
virtual bool StartPlayback(); virtual bool StartPlayback() OVERRIDE;
virtual bool StopPlayback(); virtual bool StopPlayback() OVERRIDE;
virtual void ShutDown(); virtual void ShutDown() OVERRIDE;
private: private:
// I/O thread backends to above functions. // I/O thread backends to above functions.
...@@ -199,21 +198,22 @@ class PlatformAudioImpl ...@@ -199,21 +198,22 @@ class PlatformAudioImpl
void StopPlaybackOnIOThread(); void StopPlaybackOnIOThread();
void ShutDownOnIOThread(); void ShutDownOnIOThread();
virtual void OnRequestPacket(AudioBuffersState buffers_state) { virtual void OnRequestPacket(AudioBuffersState buffers_state) OVERRIDE {
LOG(FATAL) << "Should never get OnRequestPacket in PlatformAudioImpl"; 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"; LOG(FATAL) << "Should never get OnCreated in PlatformAudioImpl";
} }
virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle, virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle,
base::SyncSocket::Handle socket_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 // The client to notify when the stream is created. THIS MUST ONLY BE
// ACCESSED ON THE MAIN THREAD. // ACCESSED ON THE MAIN THREAD.
...@@ -362,9 +362,9 @@ class PlatformAudioInputImpl ...@@ -362,9 +362,9 @@ class PlatformAudioInputImpl
webkit::ppapi::PluginDelegate::PlatformAudioCommonClient* client); webkit::ppapi::PluginDelegate::PlatformAudioCommonClient* client);
// PlatformAudio implementation (called on main thread). // PlatformAudio implementation (called on main thread).
virtual bool StartCapture(); virtual bool StartCapture() OVERRIDE;
virtual bool StopCapture(); virtual bool StopCapture() OVERRIDE;
virtual void ShutDown(); virtual void ShutDown() OVERRIDE;
private: private:
// I/O thread backends to above functions. // I/O thread backends to above functions.
...@@ -375,13 +375,13 @@ class PlatformAudioInputImpl ...@@ -375,13 +375,13 @@ class PlatformAudioInputImpl
virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle, virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle,
base::SyncSocket::Handle socket_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 // The client to notify when the stream is created. THIS MUST ONLY BE
// ACCESSED ON THE MAIN THREAD. // ACCESSED ON THE MAIN THREAD.
......
...@@ -11,10 +11,10 @@ label Chrome { ...@@ -11,10 +11,10 @@ label Chrome {
}; };
/** /**
* This interface is to be used by proxy implementations. All * This interface is to be used by proxy implementations. All functions should
* functions should be called from the main thread only. The * be called from the main thread only. The resource returned is an Audio input
* resource returned is an Audio input esource; most of the PPB_Audio * resource; most of the PPB_AudioInput interface is also usable on this
* interface is also usable on this resource. * resource.
*/ */
[version=0.1, macro="PPB_AUDIO_INPUT_TRUSTED_DEV_INTERFACE"] [version=0.1, macro="PPB_AUDIO_INPUT_TRUSTED_DEV_INTERFACE"]
interface PPB_AudioInputTrusted_Dev { interface PPB_AudioInputTrusted_Dev {
...@@ -23,11 +23,10 @@ interface PPB_AudioInputTrusted_Dev { ...@@ -23,11 +23,10 @@ interface PPB_AudioInputTrusted_Dev {
[in] PP_Instance instance); [in] PP_Instance instance);
/** /**
* Opens a paused audio interface, used by trusted side of proxy. * Opens a paused audio input interface, used by trusted side of proxy.
* Returns PP_ERROR_WOULD_BLOCK on success, and invokes * Returns PP_ERROR_WOULD_BLOCK on success, and invokes the |create_callback|
* the |create_callback| asynchronously to complete. * asynchronously to complete. As this function should always be invoked from
* As this function should always be invoked from the main thread, * the main thread, do not use the blocking variant of PP_CompletionCallback.
* do not use the blocking variant of PP_CompletionCallback.
*/ */
int32_t Open( int32_t Open(
[in] PP_Resource audio_input, [in] PP_Resource audio_input,
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* found in the LICENSE file. * 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_ #ifndef PPAPI_C_TRUSTED_PPB_AUDIO_INPUT_TRUSTED_DEV_H_
#define PPAPI_C_TRUSTED_PPB_AUDIO_INPUT_TRUSTED_DEV_H_ #define PPAPI_C_TRUSTED_PPB_AUDIO_INPUT_TRUSTED_DEV_H_
...@@ -30,20 +30,19 @@ ...@@ -30,20 +30,19 @@
* @{ * @{
*/ */
/** /**
* This interface is to be used by proxy implementations. All * This interface is to be used by proxy implementations. All functions should
* functions should be called from the main thread only. The * be called from the main thread only. The resource returned is an Audio input
* resource returned is an Audio input esource; most of the PPB_Audio * resource; most of the PPB_AudioInput interface is also usable on this
* interface is also usable on this resource. * resource.
*/ */
struct PPB_AudioInputTrusted_Dev { struct PPB_AudioInputTrusted_Dev {
/** Returns an audio input resource. */ /** Returns an audio input resource. */
PP_Resource (*CreateTrusted)(PP_Instance instance); PP_Resource (*CreateTrusted)(PP_Instance instance);
/** /**
* Opens a paused audio interface, used by trusted side of proxy. * Opens a paused audio input interface, used by trusted side of proxy.
* Returns PP_ERROR_WOULD_BLOCK on success, and invokes * Returns PP_ERROR_WOULD_BLOCK on success, and invokes the |create_callback|
* the |create_callback| asynchronously to complete. * asynchronously to complete. As this function should always be invoked from
* As this function should always be invoked from the main thread, * the main thread, do not use the blocking variant of PP_CompletionCallback.
* do not use the blocking variant of PP_CompletionCallback.
*/ */
int32_t (*Open)(PP_Resource audio_input, int32_t (*Open)(PP_Resource audio_input,
PP_Resource config, PP_Resource config,
......
...@@ -45,9 +45,10 @@ class PPB_Audio_Impl : public ::ppapi::Resource, ...@@ -45,9 +45,10 @@ class PPB_Audio_Impl : public ::ppapi::Resource,
PPB_Audio_Callback audio_callback, PPB_Audio_Callback audio_callback,
void* user_data); void* user_data);
// Initialization function for non-trusted init. // Initialization function for trusted init.
bool Init(PP_Resource config_id, bool Init(PP_Resource config_id,
PPB_Audio_Callback user_callback, void* user_data); PPB_Audio_Callback user_callback,
void* user_data);
// Resource overrides. // Resource overrides.
virtual ::ppapi::thunk::PPB_Audio_API* AsPPB_Audio_API(); virtual ::ppapi::thunk::PPB_Audio_API* AsPPB_Audio_API();
......
...@@ -44,9 +44,10 @@ class PPB_AudioInput_Impl : public ::ppapi::Resource, ...@@ -44,9 +44,10 @@ class PPB_AudioInput_Impl : public ::ppapi::Resource,
PPB_AudioInput_Callback audio_input_callback, PPB_AudioInput_Callback audio_input_callback,
void* user_data); void* user_data);
// Initialization function for non-trusted init. // Initialization function for trusted init.
bool Init(PP_Resource config_id, bool Init(PP_Resource config_id,
PPB_AudioInput_Callback callback, void* user_data); PPB_AudioInput_Callback callback,
void* user_data);
// Resource overrides. // Resource overrides.
virtual ::ppapi::thunk::PPB_AudioInput_API* AsPPB_AudioInput_API() OVERRIDE; 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