OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_ | 5 #ifndef MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_ |
6 #define MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_ | 6 #define MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "media/audio/audio_input_controller.h" | 10 #include "media/audio/audio_input_controller.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // ... | 42 // ... |
43 // // Reset factory. | 43 // // Reset factory. |
44 // AudioInputController::set_factory(NULL); | 44 // AudioInputController::set_factory(NULL); |
45 | 45 |
46 class TestAudioInputController : public AudioInputController { | 46 class TestAudioInputController : public AudioInputController { |
47 public: | 47 public: |
48 TestAudioInputController(TestAudioInputControllerFactory* factory, | 48 TestAudioInputController(TestAudioInputControllerFactory* factory, |
49 AudioManager* audio_manager, | 49 AudioManager* audio_manager, |
50 EventHandler* event_handler, | 50 EventHandler* event_handler, |
51 SyncWriter* sync_writer); | 51 SyncWriter* sync_writer); |
52 virtual ~TestAudioInputController(); | |
53 | 52 |
54 // Returns the event handler installed on the AudioInputController. | 53 // Returns the event handler installed on the AudioInputController. |
55 EventHandler* event_handler() const { return event_handler_; } | 54 EventHandler* event_handler() const { return event_handler_; } |
56 | 55 |
57 // Overriden to do nothing. It is assumed the caller will notify the event | 56 // Overriden to do nothing. It is assumed the caller will notify the event |
58 // handler with recorded data and other events. | 57 // handler with recorded data and other events. |
59 virtual void Record() OVERRIDE {} | 58 virtual void Record() OVERRIDE {} |
60 | 59 |
61 // Ensure that the closure is run on the audio-manager thread. | 60 // Ensure that the closure is run on the audio-manager thread. |
62 virtual void Close(const base::Closure& closed_task) OVERRIDE; | 61 virtual void Close(const base::Closure& closed_task) OVERRIDE; |
63 | 62 |
| 63 protected: |
| 64 virtual ~TestAudioInputController(); |
| 65 |
64 private: | 66 private: |
65 // These are not owned by us and expected to be valid for this object's | 67 // These are not owned by us and expected to be valid for this object's |
66 // lifetime. | 68 // lifetime. |
67 TestAudioInputControllerFactory* factory_; | 69 TestAudioInputControllerFactory* factory_; |
68 EventHandler* event_handler_; | 70 EventHandler* event_handler_; |
69 | 71 |
70 DISALLOW_COPY_AND_ASSIGN(TestAudioInputController); | 72 DISALLOW_COPY_AND_ASSIGN(TestAudioInputController); |
71 }; | 73 }; |
72 | 74 |
73 // Simple AudioInputController::Factory method that creates | 75 // Simple AudioInputController::Factory method that creates |
(...skipping 19 matching lines...) Expand all Loading... |
93 | 95 |
94 // The caller of Create owns this object. | 96 // The caller of Create owns this object. |
95 TestAudioInputController* controller_; | 97 TestAudioInputController* controller_; |
96 | 98 |
97 DISALLOW_COPY_AND_ASSIGN(TestAudioInputControllerFactory); | 99 DISALLOW_COPY_AND_ASSIGN(TestAudioInputControllerFactory); |
98 }; | 100 }; |
99 | 101 |
100 } // namespace media | 102 } // namespace media |
101 | 103 |
102 #endif // MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_ | 104 #endif // MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_ |
OLD | NEW |