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

Side by Side Diff: media/base/audio_renderer_sink.h

Issue 2038053002: Change audio render thread checking to use new AudioRendererSink::BelongsToRendererThread() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using the new BelongsTo...() function for thread checking. Created 4 years, 6 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
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_BASE_AUDIO_RENDERER_SINK_H_ 5 #ifndef MEDIA_BASE_AUDIO_RENDERER_SINK_H_
6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_ 6 #define MEDIA_BASE_AUDIO_RENDERER_SINK_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 // Returns |true| on success. 63 // Returns |true| on success.
64 virtual bool SetVolume(double volume) = 0; 64 virtual bool SetVolume(double volume) = 0;
65 65
66 // Returns current output device information. If the information is not 66 // Returns current output device information. If the information is not
67 // available yet, this method may block until it becomes available. 67 // available yet, this method may block until it becomes available.
68 // If the sink is not associated with any output device, |device_status| of 68 // If the sink is not associated with any output device, |device_status| of
69 // OutputDeviceInfo should be set to OUTPUT_DEVICE_STATUS_ERROR_INTERNAL. 69 // OutputDeviceInfo should be set to OUTPUT_DEVICE_STATUS_ERROR_INTERNAL.
70 // Must never be called on the IO thread. 70 // Must never be called on the IO thread.
71 virtual OutputDeviceInfo GetOutputDeviceInfo() = 0; 71 virtual OutputDeviceInfo GetOutputDeviceInfo() = 0;
72 72
73 // Returns true if called on rendering thread, otherwise false.
74 virtual bool BelongsToRenderingThread() = 0;
75
73 protected: 76 protected:
74 friend class base::RefCountedThreadSafe<AudioRendererSink>; 77 friend class base::RefCountedThreadSafe<AudioRendererSink>;
75 virtual ~AudioRendererSink() {} 78 virtual ~AudioRendererSink() {}
76 }; 79 };
77 80
78 // Same as AudioRendererSink except that Initialize() and Start() can be called 81 // Same as AudioRendererSink except that Initialize() and Start() can be called
79 // again after Stop(). 82 // again after Stop().
80 // TODO(sandersd): Fold back into AudioRendererSink once all subclasses support 83 // TODO(sandersd): Fold back into AudioRendererSink once all subclasses support
81 // this. 84 // this.
82 85
(...skipping 13 matching lines...) Expand all
96 const url::Origin& security_origin, 99 const url::Origin& security_origin,
97 const OutputDeviceStatusCB& callback) = 0; 100 const OutputDeviceStatusCB& callback) = 0;
98 101
99 protected: 102 protected:
100 ~SwitchableAudioRendererSink() override {} 103 ~SwitchableAudioRendererSink() override {}
101 }; 104 };
102 105
103 } // namespace media 106 } // namespace media
104 107
105 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_ 108 #endif // MEDIA_BASE_AUDIO_RENDERER_SINK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698