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

Side by Side Diff: chromecast/media/audio/cast_audio_manager.cc

Issue 2784433002: Ensures that audio tasks cannot run after AudioManager is deleted. (Closed)
Patch Set: chromeos and android build Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromecast/media/audio/cast_audio_manager.h" 5 #include "chromecast/media/audio/cast_audio_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, 45 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner,
46 ::media::AudioLogFactory* audio_log_factory, 46 ::media::AudioLogFactory* audio_log_factory,
47 MediaPipelineBackendManager* backend_manager, 47 MediaPipelineBackendManager* backend_manager,
48 CastAudioMixer* audio_mixer) 48 CastAudioMixer* audio_mixer)
49 : AudioManagerBase(std::move(task_runner), 49 : AudioManagerBase(std::move(task_runner),
50 std::move(worker_task_runner), 50 std::move(worker_task_runner),
51 audio_log_factory), 51 audio_log_factory),
52 backend_manager_(backend_manager), 52 backend_manager_(backend_manager),
53 mixer_(audio_mixer) {} 53 mixer_(audio_mixer) {}
54 54
55 CastAudioManager::~CastAudioManager() { 55 CastAudioManager::~CastAudioManager() = default;
56 Shutdown();
57 }
58 56
59 bool CastAudioManager::HasAudioOutputDevices() { 57 bool CastAudioManager::HasAudioOutputDevices() {
60 return true; 58 return true;
61 } 59 }
62 60
63 bool CastAudioManager::HasAudioInputDevices() { 61 bool CastAudioManager::HasAudioInputDevices() {
64 return false; 62 return false;
65 } 63 }
66 64
67 void CastAudioManager::ShowAudioInputSettings() { 65 void CastAudioManager::ShowAudioInputSettings() {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 DCHECK(!mixer_output_stream_); // Only allow 1 |mixer_output_stream_|. 177 DCHECK(!mixer_output_stream_); // Only allow 1 |mixer_output_stream_|.
180 178
181 // Keep a reference to this stream for proper behavior on 179 // Keep a reference to this stream for proper behavior on
182 // CastAudioManager::ReleaseOutputStream. 180 // CastAudioManager::ReleaseOutputStream.
183 mixer_output_stream_.reset(new CastAudioOutputStream(params, this)); 181 mixer_output_stream_.reset(new CastAudioOutputStream(params, this));
184 return mixer_output_stream_.get(); 182 return mixer_output_stream_.get();
185 } 183 }
186 184
187 } // namespace media 185 } // namespace media
188 } // namespace chromecast 186 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698