Chromium Code Reviews| 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..627cc525cbf025857753c1c2db06589772ac4532 100644 |
| --- a/media/audio/audio_device_thread.h |
| +++ b/media/audio/audio_device_thread.h |
| @@ -75,13 +75,12 @@ class MEDIA_EXPORT AudioDeviceThread { |
| AudioDeviceThread(); |
| ~AudioDeviceThread(); |
| - // Starts the audio thread. The thread must not already be running. 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); |
| + // Starts the audio thread and puts into wait mode. Resume() must |
| + // be called to release it and 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(const char* thread_name, bool synchronized_buffers); |
|
tommi (sloooow) - chröme
2016/05/14 11:06:28
Can the thread be started using different names ea
Henrik Grunell
2016/05/16 14:37:36
It can only be started once, and stopped once. Pau
|
| // This tells the audio thread to stop and clean up the data. |
| // The method can stop the thread synchronously or asynchronously. |
| @@ -94,6 +93,16 @@ 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 from wait mode 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); |
| + |
| + // Puts the thread in the wait mode and shuts down the socket. |
| + // It can be resumed again with Resume(). |
| + void Pause(); |
| + |
| // Returns true if the thread is stopped or stopping. |
| bool IsStopped(); |
| @@ -105,6 +114,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_; |