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_BUFFERED_DATA_SOURCE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_ |
6 #define CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_ | 6 #define CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // | 32 // |
33 // BufferedDataSource must be created and initialized on the render thread | 33 // BufferedDataSource must be created and initialized on the render thread |
34 // before being passed to other threads. It may be deleted on any thread. | 34 // before being passed to other threads. It may be deleted on any thread. |
35 class CONTENT_EXPORT BufferedDataSource : public media::DataSource { | 35 class CONTENT_EXPORT BufferedDataSource : public media::DataSource { |
36 public: | 36 public: |
37 typedef base::Callback<void(bool)> DownloadingCB; | 37 typedef base::Callback<void(bool)> DownloadingCB; |
38 | 38 |
39 // |downloading_cb| will be called whenever the downloading/paused state of | 39 // |downloading_cb| will be called whenever the downloading/paused state of |
40 // the source changes. | 40 // the source changes. |
41 BufferedDataSource(const scoped_refptr<base::MessageLoopProxy>& render_loop, | 41 BufferedDataSource(const scoped_refptr<base::MessageLoopProxy>& render_loop, |
42 WebKit::WebFrame* frame, | 42 blink::WebFrame* frame, |
43 media::MediaLog* media_log, | 43 media::MediaLog* media_log, |
44 const DownloadingCB& downloading_cb); | 44 const DownloadingCB& downloading_cb); |
45 virtual ~BufferedDataSource(); | 45 virtual ~BufferedDataSource(); |
46 | 46 |
47 // Initialize this object using |url| and |cors_mode|, executing |init_cb| | 47 // Initialize this object using |url| and |cors_mode|, executing |init_cb| |
48 // with the result of initialization when it has completed. | 48 // with the result of initialization when it has completed. |
49 // | 49 // |
50 // Method called on the render thread. | 50 // Method called on the render thread. |
51 typedef base::Callback<void(bool)> InitializeCB; | 51 typedef base::Callback<void(bool)> InitializeCB; |
52 void Initialize( | 52 void Initialize( |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 // Some resources are assumed to be fully buffered (i.e., file://) so we don't | 155 // Some resources are assumed to be fully buffered (i.e., file://) so we don't |
156 // need to report what |loader_| has buffered. | 156 // need to report what |loader_| has buffered. |
157 bool assume_fully_buffered_; | 157 bool assume_fully_buffered_; |
158 | 158 |
159 // This value will be true if this data source can only support streaming. | 159 // This value will be true if this data source can only support streaming. |
160 // i.e. range request is not supported. | 160 // i.e. range request is not supported. |
161 bool streaming_; | 161 bool streaming_; |
162 | 162 |
163 // A webframe for loading. | 163 // A webframe for loading. |
164 WebKit::WebFrame* frame_; | 164 blink::WebFrame* frame_; |
165 | 165 |
166 // A resource loader for the media resource. | 166 // A resource loader for the media resource. |
167 scoped_ptr<BufferedResourceLoader> loader_; | 167 scoped_ptr<BufferedResourceLoader> loader_; |
168 | 168 |
169 // Callback method from the pipeline for initialization. | 169 // Callback method from the pipeline for initialization. |
170 InitializeCB init_cb_; | 170 InitializeCB init_cb_; |
171 | 171 |
172 // Read parameters received from the Read() method call. Must be accessed | 172 // Read parameters received from the Read() method call. Must be accessed |
173 // under |lock_|. | 173 // under |lock_|. |
174 class ReadOperation; | 174 class ReadOperation; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 scoped_refptr<media::MediaLog> media_log_; | 216 scoped_refptr<media::MediaLog> media_log_; |
217 | 217 |
218 DownloadingCB downloading_cb_; | 218 DownloadingCB downloading_cb_; |
219 | 219 |
220 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); | 220 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); |
221 }; | 221 }; |
222 | 222 |
223 } // namespace content | 223 } // namespace content |
224 | 224 |
225 #endif // CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_ | 225 #endif // CONTENT_RENDERER_MEDIA_BUFFERED_DATA_SOURCE_H_ |
OLD | NEW |