| Index: media/audio/mac/audio_low_latency_input_mac.h
|
| diff --git a/media/audio/mac/audio_low_latency_input_mac.h b/media/audio/mac/audio_low_latency_input_mac.h
|
| index 59dd618dad4d9952eaf5837beeaeb613085f9373..4881646c99d56cc6dd1710d000f479de483929b6 100644
|
| --- a/media/audio/mac/audio_low_latency_input_mac.h
|
| +++ b/media/audio/mac/audio_low_latency_input_mac.h
|
| @@ -39,11 +39,13 @@
|
| #include <AudioUnit/AudioUnit.h>
|
| #include <CoreAudio/CoreAudio.h>
|
| #include <map>
|
| +#include <vector>
|
|
|
| #include "base/atomicops.h"
|
| #include "base/cancelable_callback.h"
|
| #include "base/macros.h"
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "base/memory/weak_ptr.h"
|
| #include "base/threading/thread_checker.h"
|
| #include "base/time/time.h"
|
| #include "base/timer/timer.h"
|
| @@ -122,6 +124,10 @@ class MEDIA_EXPORT AUAudioInputStream
|
| UInt32 num_addresses,
|
| const AudioObjectPropertyAddress addresses[]);
|
|
|
| + // Updates the |device_property_changes_map_| on the main browser thread,
|
| + // (CrBrowserMain) which is the same thread as this instance is created on.
|
| + void DevicePropertyChangedOnMainThread(const std::vector<UInt32>& properties);
|
| +
|
| // Registers OnDevicePropertyChanged() to receive notifications when device
|
| // properties changes.
|
| void RegisterDeviceChangeListener();
|
| @@ -283,6 +289,11 @@ class MEDIA_EXPORT AUAudioInputStream
|
| UInt32 largest_glitch_frames_;
|
| int glitches_detected_;
|
|
|
| + // Used to ensure DevicePropertyChangedOnMainThread() is not called when
|
| + // this object is destroyed.
|
| + // Note that, all member variables should appear before the WeakPtrFactory.
|
| + base::WeakPtrFactory<AUAudioInputStream> weak_factory_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream);
|
| };
|
|
|
|
|