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 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_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 | 10 |
11 namespace media { | 11 namespace media { |
12 class AudioRendererSink; | 12 class AudioRendererSink; |
13 } | 13 } |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 | |
17 // Holds parameters for constructing WebMediaPlayerImpl without having | 16 // Holds parameters for constructing WebMediaPlayerImpl without having |
18 // to plumb arguments through various abstraction layers. | 17 // to plumb arguments through various abstraction layers. |
19 class WebMediaPlayerParams { | 18 class WebMediaPlayerParams { |
20 public: | 19 public: |
21 // Parameters may be null. | 20 // Parameters may be null. |
22 WebMediaPlayerParams( | 21 WebMediaPlayerParams( |
23 const base::Callback<void(const base::Closure&)>& defer_load_cb, | 22 const base::Callback<void(const base::Closure&)>& defer_load_cb, |
24 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink); | 23 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink); |
25 ~WebMediaPlayerParams(); | 24 ~WebMediaPlayerParams(); |
26 | 25 |
27 base::Callback<void(const base::Closure&)> defer_load_cb() const { | 26 base::Callback<void(const base::Closure&)> defer_load_cb() const { |
28 return defer_load_cb_; | 27 return defer_load_cb_; |
29 } | 28 } |
30 | 29 |
31 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink() const { | 30 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink() const { |
32 return audio_renderer_sink_; | 31 return audio_renderer_sink_; |
33 } | 32 } |
34 | 33 |
35 private: | 34 private: |
36 base::Callback<void(const base::Closure&)> defer_load_cb_; | 35 base::Callback<void(const base::Closure&)> defer_load_cb_; |
37 scoped_refptr<media::AudioRendererSink> audio_renderer_sink_; | 36 scoped_refptr<media::AudioRendererSink> audio_renderer_sink_; |
38 | 37 |
39 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); | 38 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); |
40 }; | 39 }; |
41 | 40 |
42 } // namespace media | 41 } // namespace media |
43 | 42 |
44 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ | 43 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ |
OLD | NEW |