| Index: media/audio/audio_device_thread.h
|
| diff --git a/media/audio/audio_device_thread.h b/media/audio/audio_device_thread.h
|
| index 61e5e8724ddc24b289c01c364e3491b137779462..30b8e009fef69c6ad23047c1a2da7eefc9f5bcb4 100644
|
| --- a/media/audio/audio_device_thread.h
|
| +++ b/media/audio/audio_device_thread.h
|
| @@ -75,13 +75,11 @@ class MEDIA_EXPORT AudioDeviceThread {
|
| AudioDeviceThread();
|
| ~AudioDeviceThread();
|
|
|
| - // Starts the audio thread. The thread must not already be running. If
|
| + // Starts the audio thread and suspends it. Resume() must then be called to
|
| + // actually start running. The thread must not already be started. If
|
| // |sychronized_buffers| is set, the browser expects to be notified via the
|
| // |socket| every time AudioDeviceThread::Process() completes.
|
| - void Start(AudioDeviceThread::Callback* callback,
|
| - base::SyncSocket::Handle socket,
|
| - const char* thread_name,
|
| - bool synchronized_buffers);
|
| + void StartSuspended(const char* thread_name, bool synchronized_buffers);
|
|
|
| // This tells the audio thread to stop and clean up the data.
|
| // The method can stop the thread synchronously or asynchronously.
|
| @@ -94,6 +92,15 @@ class MEDIA_EXPORT AudioDeviceThread {
|
| // If set to NULL, function will wait for the thread to exit before returning.
|
| void Stop(base::MessageLoop* loop_for_join);
|
|
|
| + // Resumes the thread so that it starts running with the given |callback| and
|
| + // |socket|. This will also reset the index used for sychronized buffers.
|
| + void Resume(AudioDeviceThread::Callback* callback,
|
| + base::SyncSocket::Handle socket);
|
| +
|
| + // Suspends the thread and shuts down the socket. It can be resumed again with
|
| + // Resume().
|
| + void Suspend();
|
| +
|
| // Returns true if the thread is stopped or stopping.
|
| bool IsStopped();
|
|
|
| @@ -105,6 +112,7 @@ class MEDIA_EXPORT AudioDeviceThread {
|
| // 2) We override ThreadMain to add additional on-thread initialization
|
| // while still synchronized with SimpleThread::Start() to provide
|
| // reliable initialization.
|
| + // TODO(grunell): Do we still need this extra layer?
|
| class Thread;
|
|
|
| base::Lock thread_lock_;
|
|
|