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

Unified Diff: media/mojo/services/test_mojo_media_client.cc

Issue 2295403002: Destroy MojoMediaClient in MojoMediaApplication::OnStop(). (Closed)
Patch Set: ignore request if stopped Created 4 years, 4 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 | « media/mojo/services/test_mojo_media_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/mojo/services/test_mojo_media_client.cc
diff --git a/media/mojo/services/test_mojo_media_client.cc b/media/mojo/services/test_mojo_media_client.cc
index a9b1a31fc4892be15d19640f419df4d043fd5b31..4b11fd70131eab5d7f1a49b71c9d5b85fc774c6c 100644
--- a/media/mojo/services/test_mojo_media_client.cc
+++ b/media/mojo/services/test_mojo_media_client.cc
@@ -24,7 +24,14 @@ namespace media {
TestMojoMediaClient::TestMojoMediaClient() {}
-TestMojoMediaClient::~TestMojoMediaClient() {}
+TestMojoMediaClient::~TestMojoMediaClient() {
+ DVLOG(1) << __FUNCTION__;
+ // AudioManager destructor requires MessageLoop.
+ // Destroy it before the message loop goes away.
+ audio_manager_.reset();
+ // Flush the message loop to ensure that the audio manager is destroyed.
+ base::RunLoop().RunUntilIdle();
+}
void TestMojoMediaClient::Initialize() {
InitializeMediaLibrary();
@@ -39,16 +46,6 @@ void TestMojoMediaClient::Initialize() {
// Flush the message loop to ensure that the audio manager is initialized.
base::RunLoop().RunUntilIdle();
}
-
-}
-
-void TestMojoMediaClient::WillQuit() {
- DVLOG(1) << __FUNCTION__;
- // AudioManager destructor requires MessageLoop.
- // Destroy it before the message loop goes away.
- audio_manager_.reset();
- // Flush the message loop to ensure that the audio manager is destroyed.
- base::RunLoop().RunUntilIdle();
}
scoped_refptr<AudioRendererSink> TestMojoMediaClient::CreateAudioRendererSink(
« no previous file with comments | « media/mojo/services/test_mojo_media_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698