| OLD | NEW |
| 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" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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 virtual ~SoundsManagerImpl(); |
| 28 | 28 |
| 29 // SoundsManager implementation: | 29 // SoundsManager implementation: |
| 30 virtual bool Initialize(SoundKey key, | 30 virtual bool Initialize(SoundKey key, |
| 31 const base::StringPiece& data) OVERRIDE; | 31 const base::StringPiece& data) override; |
| 32 virtual bool Play(SoundKey key) OVERRIDE; | 32 virtual bool Play(SoundKey key) override; |
| 33 virtual base::TimeDelta GetDuration(SoundKey key) OVERRIDE; | 33 virtual base::TimeDelta GetDuration(SoundKey key) override; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 base::hash_map<SoundKey, linked_ptr<AudioStreamHandler> > handlers_; | 36 base::hash_map<SoundKey, linked_ptr<AudioStreamHandler> > handlers_; |
| 37 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 37 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 38 | 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(SoundsManagerImpl); | 39 DISALLOW_COPY_AND_ASSIGN(SoundsManagerImpl); |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 SoundsManagerImpl::SoundsManagerImpl() | 42 SoundsManagerImpl::SoundsManagerImpl() |
| 43 : task_runner_(AudioManager::Get()->GetTaskRunner()) { | 43 : task_runner_(AudioManager::Get()->GetTaskRunner()) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 // static | 109 // static |
| 110 void SoundsManager::InitializeForTesting(SoundsManager* manager) { | 110 void SoundsManager::InitializeForTesting(SoundsManager* manager) { |
| 111 CHECK(!g_instance) << "SoundsManager is already initialized."; | 111 CHECK(!g_instance) << "SoundsManager is already initialized."; |
| 112 CHECK(manager); | 112 CHECK(manager); |
| 113 g_instance = manager; | 113 g_instance = manager; |
| 114 g_initialized_for_testing = true; | 114 g_initialized_for_testing = true; |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace media | 117 } // namespace media |
| OLD | NEW |