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

Unified Diff: content/browser/browser_main_loop.cc

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: rebase Created 3 years, 7 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: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index ee67b189e31496d10bb99865d51919ff04e3710c..3b4128fccff1188906bae3c2f9a76a7af4fc0815 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -52,7 +52,6 @@
#include "components/tracing/common/trace_config_file.h"
#include "components/tracing/common/trace_to_console.h"
#include "components/tracing/common/tracing_switches.h"
-#include "content/browser/audio_manager_thread.h"
#include "content/browser/browser_thread_impl.h"
#include "content/browser/dom_storage/dom_storage_area.h"
#include "content/browser/download/download_resource_handler.h"
@@ -93,7 +92,9 @@
#include "content/public/common/result_codes.h"
#include "device/gamepad/gamepad_service.h"
#include "gpu/vulkan/features.h"
+#include "media/audio/audio_manager.h"
#include "media/audio/audio_system_impl.h"
+#include "media/audio/audio_thread_impl.h"
#include "media/base/media.h"
#include "media/base/user_input_monitor.h"
#include "media/midi/midi_service.h"
@@ -1366,6 +1367,10 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DeleteDataSources");
URLDataManager::DeleteDataSources();
}
+ {
+ TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:AudioMan");
+ audio_manager_->Shutdown();
+ }
if (parts_) {
TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:PostDestroyThreads");
@@ -1760,15 +1765,13 @@ void BrowserMainLoop::EndStartupTracing() {
}
void BrowserMainLoop::CreateAudioManager() {
- DCHECK(!audio_thread_);
DCHECK(!audio_manager_);
audio_manager_ = GetContentClient()->browser()->CreateAudioManager(
MediaInternals::GetInstance());
if (!audio_manager_) {
- audio_thread_ = base::MakeUnique<AudioManagerThread>();
audio_manager_ = media::AudioManager::Create(
- audio_thread_->task_runner(), audio_thread_->worker_task_runner(),
+ base::MakeUnique<media::AudioThreadImpl>(),
BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
MediaInternals::GetInstance());
}
« no previous file with comments | « content/browser/browser_main_loop.h ('k') | content/browser/renderer_host/media/audio_input_device_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698