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

Side by Side Diff: media/audio/sounds/sounds_manager.cc

Issue 655713003: Standardize usage of virtual/override/final in media/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « media/audio/sounds/audio_stream_handler.cc ('k') | media/audio/sounds/test_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "media/audio/sounds/sounds_manager.h" 5 #include "media/audio/sounds/sounds_manager.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/linked_ptr.h" 9 #include "base/memory/linked_ptr.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "base/single_thread_task_runner.h" 11 #include "base/single_thread_task_runner.h"
12 #include "media/audio/audio_manager.h" 12 #include "media/audio/audio_manager.h"
13 #include "media/audio/sounds/audio_stream_handler.h" 13 #include "media/audio/sounds/audio_stream_handler.h"
14 14
15 namespace media { 15 namespace media {
16 16
17 namespace { 17 namespace {
18 18
19 SoundsManager* g_instance = NULL; 19 SoundsManager* g_instance = NULL;
20 bool g_initialized_for_testing = false; 20 bool g_initialized_for_testing = false;
21 21
22 // SoundsManagerImpl --------------------------------------------------- 22 // SoundsManagerImpl ---------------------------------------------------
23 23
24 class SoundsManagerImpl : public SoundsManager { 24 class SoundsManagerImpl : public SoundsManager {
25 public: 25 public:
26 SoundsManagerImpl(); 26 SoundsManagerImpl();
27 virtual ~SoundsManagerImpl(); 27 ~SoundsManagerImpl() override;
28 28
29 // SoundsManager implementation: 29 // SoundsManager implementation:
30 virtual bool Initialize(SoundKey key, 30 bool Initialize(SoundKey key, const base::StringPiece& data) override;
31 const base::StringPiece& data) override; 31 bool Play(SoundKey key) override;
32 virtual bool Play(SoundKey key) override; 32 base::TimeDelta GetDuration(SoundKey key) override;
33 virtual base::TimeDelta GetDuration(SoundKey key) override;
34 33
35 private: 34 private:
36 base::hash_map<SoundKey, linked_ptr<AudioStreamHandler> > handlers_; 35 base::hash_map<SoundKey, linked_ptr<AudioStreamHandler> > handlers_;
37 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 36 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
38 37
39 DISALLOW_COPY_AND_ASSIGN(SoundsManagerImpl); 38 DISALLOW_COPY_AND_ASSIGN(SoundsManagerImpl);
40 }; 39 };
41 40
42 SoundsManagerImpl::SoundsManagerImpl() 41 SoundsManagerImpl::SoundsManagerImpl()
43 : task_runner_(AudioManager::Get()->GetTaskRunner()) { 42 : task_runner_(AudioManager::Get()->GetTaskRunner()) {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 107
109 // static 108 // static
110 void SoundsManager::InitializeForTesting(SoundsManager* manager) { 109 void SoundsManager::InitializeForTesting(SoundsManager* manager) {
111 CHECK(!g_instance) << "SoundsManager is already initialized."; 110 CHECK(!g_instance) << "SoundsManager is already initialized.";
112 CHECK(manager); 111 CHECK(manager);
113 g_instance = manager; 112 g_instance = manager;
114 g_initialized_for_testing = true; 113 g_initialized_for_testing = true;
115 } 114 }
116 115
117 } // namespace media 116 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/sounds/audio_stream_handler.cc ('k') | media/audio/sounds/test_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698