Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2342)

Unified Diff: content/renderer/media/audio_device.h

Issue 9264013: Simplify shutdown of AudioDevice's audio thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed incorrect call to ShutDownAudioThread from OnLowLatencyCreated Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/media/audio_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/audio_device.h
diff --git a/content/renderer/media/audio_device.h b/content/renderer/media/audio_device.h
index 73470b52f86b9bf12d75cb004d1e54c986534e2a..e9753c740c52ea21c61da1822d4f816cfd78302f 100644
--- a/content/renderer/media/audio_device.h
+++ b/content/renderer/media/audio_device.h
@@ -157,7 +157,7 @@ class CONTENT_EXPORT AudioDevice
private:
// Magic required by ref_counted.h to avoid any code deleting the object
- // accidently while there are references to it.
+ // accidentally while there are references to it.
friend class base::RefCountedThreadSafe<AudioSocket>;
~AudioSocket() { }
@@ -177,7 +177,7 @@ class CONTENT_EXPORT AudioDevice
void InitializeOnIOThread(const AudioParameters& params);
void PlayOnIOThread();
void PauseOnIOThread(bool flush);
- void ShutDownOnIOThread(base::WaitableEvent* completion);
+ void ShutDownOnIOThread();
void SetVolumeOnIOThread(double volume);
void Send(IPC::Message* message);
@@ -220,12 +220,14 @@ class CONTENT_EXPORT AudioDevice
double volume_;
// Callbacks for rendering audio occur on this thread.
+ // Must only be modified on the IO thread and when the thread is not running.
scoped_ptr<base::DelegateSimpleThread> audio_thread_;
// Cached audio message filter (lives on the main render thread).
scoped_refptr<AudioMessageFilter> filter_;
// Our stream ID on the message filter. Only accessed on the IO thread.
+ // Must only be modified on the IO thread.
int32 stream_id_;
// State of Play() / Pause() calls before OnLowLatencyCreated() is called.
@@ -234,19 +236,17 @@ class CONTENT_EXPORT AudioDevice
// Set to |true| when OnLowLatencyCreated() is called.
// Set to |false| when ShutDownOnIOThread() is called.
// This is for use with play_on_start_ to track Play() / Pause() state.
+ // Must only be touched from the IO thread.
bool is_started_;
// Data transfer between browser and render process uses a combination
// of sync sockets and shared memory to provide lowest possible latency.
+ // These variables must only be set on the IO thread while the audio_thread_
+ // is not running.
base::SharedMemoryHandle shared_memory_handle_;
scoped_refptr<AudioSocket> audio_socket_;
int memory_length_;
- // Protects lifetime of:
- // audio_socket_
- // audio_thread_
- base::Lock lock_;
-
DISALLOW_COPY_AND_ASSIGN(AudioDevice);
};
« no previous file with comments | « no previous file | content/renderer/media/audio_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698