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

Side by Side Diff: media/audio/audio_output_controller.h

Issue 10383262: RefCounted types should not have public destructors, delegate cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_
6 #define MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ 6 #define MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 public AudioOutputStream::AudioSourceCallback { 69 public AudioOutputStream::AudioSourceCallback {
70 public: 70 public:
71 // Value sent by the controller to the renderer in low-latency mode 71 // Value sent by the controller to the renderer in low-latency mode
72 // indicating that the stream is paused. 72 // indicating that the stream is paused.
73 static const int kPauseMark; 73 static const int kPauseMark;
74 74
75 // An event handler that receives events from the AudioOutputController. The 75 // An event handler that receives events from the AudioOutputController. The
76 // following methods are called on the audio manager thread. 76 // following methods are called on the audio manager thread.
77 class MEDIA_EXPORT EventHandler { 77 class MEDIA_EXPORT EventHandler {
78 public: 78 public:
79 virtual ~EventHandler() {}
80 virtual void OnCreated(AudioOutputController* controller) = 0; 79 virtual void OnCreated(AudioOutputController* controller) = 0;
81 virtual void OnPlaying(AudioOutputController* controller) = 0; 80 virtual void OnPlaying(AudioOutputController* controller) = 0;
82 virtual void OnPaused(AudioOutputController* controller) = 0; 81 virtual void OnPaused(AudioOutputController* controller) = 0;
83 virtual void OnError(AudioOutputController* controller, int error_code) = 0; 82 virtual void OnError(AudioOutputController* controller, int error_code) = 0;
83
84 protected:
85 virtual ~EventHandler() {}
84 }; 86 };
85 87
86 // A synchronous reader interface used by AudioOutputController for 88 // A synchronous reader interface used by AudioOutputController for
87 // synchronous reading. 89 // synchronous reading.
88 class SyncReader { 90 class SyncReader {
89 public: 91 public:
90 virtual ~SyncReader() {} 92 virtual ~SyncReader() {}
91 93
92 // Notify the synchronous reader the number of bytes in the 94 // Notify the synchronous reader the number of bytes in the
93 // AudioOutputController not yet played. This is used by SyncReader to 95 // AudioOutputController not yet played. This is used by SyncReader to
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 229
228 // Workaround for Mac OS X bug, see crbug.com/128128. 230 // Workaround for Mac OS X bug, see crbug.com/128128.
229 base::Time previous_stop_time_; 231 base::Time previous_stop_time_;
230 232
231 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); 233 DISALLOW_COPY_AND_ASSIGN(AudioOutputController);
232 }; 234 };
233 235
234 } // namespace media 236 } // namespace media
235 237
236 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ 238 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698