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

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

Issue 9112029: Safe and reliable fix for 2 race conditions. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' 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') | content/renderer/media/audio_device.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/audio_device.h
===================================================================
--- content/renderer/media/audio_device.h (revision 116480)
+++ content/renderer/media/audio_device.h (working copy)
@@ -101,7 +101,6 @@
int channels,
double sample_rate,
RenderCallback* callback);
- virtual ~AudioDevice();
void Initialize(size_t buffer_size,
int channels,
@@ -178,6 +177,11 @@
base::SyncSocket socket_;
};
+ // Magic required by ref_counted.h to avoid any code deleting the object
+ // accidently while there are references to it.
+ friend class base::RefCountedThreadSafe<AudioDevice>;
+ virtual ~AudioDevice();
+
// Methods called on IO thread ----------------------------------------------
// The following methods are tasks posted on the IO thread that needs to
// be executed on that thread. They interact with AudioMessageFilter and
« no previous file with comments | « no previous file | content/renderer/media/audio_device.cc » ('j') | content/renderer/media/audio_device.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698