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

Unified Diff: media/audio/mock_audio_manager.h

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: fixes content_browsertests and content_unittests Created 3 years, 9 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
Index: media/audio/mock_audio_manager.h
diff --git a/media/audio/mock_audio_manager.h b/media/audio/mock_audio_manager.h
index 69e0d1496ed022a37cd159da08c1bd7c09d73662..e4555e3726c0a6ef9e6c59a46e4f7e60b443e2ec 100644
--- a/media/audio/mock_audio_manager.h
+++ b/media/audio/mock_audio_manager.h
@@ -18,17 +18,14 @@ namespace media {
// would causing failures on classes which expect that.
class MockAudioManager : public AudioManager {
public:
- class Deleter {
- public:
- void operator()(const MockAudioManager* instance) const;
- };
-
- using UniquePtr = std::unique_ptr<MockAudioManager, Deleter>;
using GetDeviceDescriptionsCallback =
base::RepeatingCallback<void(AudioDeviceDescriptions*)>;
explicit MockAudioManager(
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
+ ~MockAudioManager() override;
+
+ void Shutdown() override;
bool HasAudioOutputDevices() override;
@@ -91,12 +88,7 @@ class MockAudioManager : public AudioManager {
void SetOutputDeviceDescriptionsCallback(
GetDeviceDescriptionsCallback callback);
- protected:
- ~MockAudioManager() override;
-
private:
- friend class base::DeleteHelper<MockAudioManager>;
-
AudioParameters input_params_;
AudioParameters output_params_;
AudioParameters default_output_params_;

Powered by Google App Engine
This is Rietveld 408576698