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

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

Issue 10067035: RefCounted types should not have public destructors, media/ and gpu/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/test_audio_input_controller_factory.h ('k') | media/base/audio_renderer_sink.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/test_audio_input_controller_factory.h" 5 #include "media/audio/test_audio_input_controller_factory.h"
6 #include "media/audio/audio_io.h" 6 #include "media/audio/audio_io.h"
7 7
8 namespace media { 8 namespace media {
9 9
10 TestAudioInputController::TestAudioInputController( 10 TestAudioInputController::TestAudioInputController(
11 TestAudioInputControllerFactory* factory, 11 TestAudioInputControllerFactory* factory,
12 AudioManager* audio_manager, 12 AudioManager* audio_manager,
13 EventHandler* event_handler, 13 EventHandler* event_handler,
14 SyncWriter* sync_writer) 14 SyncWriter* sync_writer)
15 : AudioInputController(event_handler, sync_writer), 15 : AudioInputController(event_handler, sync_writer),
16 factory_(factory), 16 factory_(factory),
17 event_handler_(event_handler) { 17 event_handler_(event_handler) {
18 message_loop_ = audio_manager->GetMessageLoop(); 18 message_loop_ = audio_manager->GetMessageLoop();
19 } 19 }
20 20
21 void TestAudioInputController::Close(const base::Closure& closed_task) {
22 message_loop_->PostTask(FROM_HERE, closed_task);
23 }
24
21 TestAudioInputController::~TestAudioInputController() { 25 TestAudioInputController::~TestAudioInputController() {
22 // Inform the factory so that it allows creating new instances in future. 26 // Inform the factory so that it allows creating new instances in future.
23 factory_->OnTestAudioInputControllerDestroyed(this); 27 factory_->OnTestAudioInputControllerDestroyed(this);
24 } 28 }
25 29
26 void TestAudioInputController::Close(const base::Closure& closed_task) {
27 message_loop_->PostTask(FROM_HERE, closed_task);
28 }
29
30 TestAudioInputControllerFactory::TestAudioInputControllerFactory() 30 TestAudioInputControllerFactory::TestAudioInputControllerFactory()
31 : controller_(NULL) { 31 : controller_(NULL) {
32 } 32 }
33 33
34 AudioInputController* TestAudioInputControllerFactory::Create( 34 AudioInputController* TestAudioInputControllerFactory::Create(
35 AudioManager* audio_manager, 35 AudioManager* audio_manager,
36 AudioInputController::EventHandler* event_handler, 36 AudioInputController::EventHandler* event_handler,
37 AudioParameters params) { 37 AudioParameters params) {
38 DCHECK(!controller_); // Only one test instance managed at a time. 38 DCHECK(!controller_); // Only one test instance managed at a time.
39 controller_ = new TestAudioInputController(this, audio_manager, 39 controller_ = new TestAudioInputController(this, audio_manager,
40 event_handler, NULL); 40 event_handler, NULL);
41 return controller_; 41 return controller_;
42 } 42 }
43 43
44 void TestAudioInputControllerFactory::OnTestAudioInputControllerDestroyed( 44 void TestAudioInputControllerFactory::OnTestAudioInputControllerDestroyed(
45 TestAudioInputController* controller) { 45 TestAudioInputController* controller) {
46 DCHECK_EQ(controller_, controller); 46 DCHECK_EQ(controller_, controller);
47 controller_ = NULL; 47 controller_ = NULL;
48 } 48 }
49 49
50 } // namespace media 50 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/test_audio_input_controller_factory.h ('k') | media/base/audio_renderer_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698