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

Side by Side Diff: media/audio/audio_system.cc

Issue 2687853002: Switching VirtualKeyboardPrivate keyboard config call stack to receive HasInputDevices() responce a… (Closed)
Patch Set: Fix for compilation error on linux_chromium_chromeos Created 3 years, 10 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "media/audio/audio_system.h"
6
7 namespace media {
8
9 static AudioSystem* g_last_created = nullptr;
10
11 AudioSystem::~AudioSystem() {}
12
13 AudioSystem* AudioSystem::Get() {
14 return g_last_created;
15 }
16
17 void AudioSystem::SetInstance(AudioSystem* audio_system) {
18 DCHECK(audio_system);
19 if (g_last_created && audio_system) {
20 // We create multiple instances of AudioSystem only when testing.
21 // We should not encounter this case in production.
22 LOG(WARNING) << "Multiple instances of AudioSystem detected";
23 }
24 g_last_created = audio_system;
25 }
26
27 void AudioSystem::ClearInstance(const AudioSystem* audio_system) {
28 DCHECK(audio_system);
29 if (g_last_created != audio_system) {
30 // We create multiple instances of AudioSystem only when testing.
31 // We should not encounter this case in production.
32 LOG(WARNING) << "Multiple instances of AudioSystem detected";
33 } else {
34 g_last_created = nullptr;
35 }
36 }
37
38 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698