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

Unified Diff: media/audio/audio_thread_impl.cc

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: addressed comments 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: media/audio/audio_thread_impl.cc
diff --git a/content/browser/audio_manager_thread.cc b/media/audio/audio_thread_impl.cc
similarity index 52%
rename from content/browser/audio_manager_thread.cc
rename to media/audio/audio_thread_impl.cc
index 54263bb9bdda06950f702539b5542b640fb61897..65588bce31c911a014160a8e5a54ef6add6fe6c1 100644
--- a/content/browser/audio_manager_thread.cc
+++ b/media/audio/audio_thread_impl.cc
@@ -2,14 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/audio_manager_thread.h"
+#include "media/audio/audio_thread_impl.h"
#include "base/threading/thread_task_runner_handle.h"
-#include "build/build_config.h"
-namespace content {
+namespace media {
-AudioManagerThread::AudioManagerThread() : thread_("AudioThread") {
+AudioThreadImpl::AudioThreadImpl() : thread_("AudioThread") {
#if defined(OS_WIN)
thread_.init_com_with_mta(true);
#endif
@@ -22,8 +21,21 @@ AudioManagerThread::AudioManagerThread() : thread_("AudioThread") {
#else
task_runner_ = thread_.task_runner();
#endif
+ worker_task_runner_ = thread_.task_runner();
}
-AudioManagerThread::~AudioManagerThread() {}
+AudioThreadImpl::~AudioThreadImpl() {}
o1ka 2017/05/10 15:57:57 DCHECK that it's called on |task_runner_| on Mac?
alokp 2017/05/10 18:04:03 I do not think we want to verify anything special
-} // namespace content
+void AudioThreadImpl::Stop() {
+ thread_.Stop();
+}
+
+base::SingleThreadTaskRunner* AudioThreadImpl::GetTaskRunner() {
+ return task_runner_.get();
+}
+
+base::SingleThreadTaskRunner* AudioThreadImpl::GetWorkerTaskRunner() {
+ return worker_task_runner_.get();
+}
+
+} // namespace media

Powered by Google App Engine
This is Rietveld 408576698