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_RESOURCE_LOADER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_BUFFERED_RESOURCE_LOADER_H_ |
6 #define CONTENT_RENDERER_MEDIA_BUFFERED_RESOURCE_LOADER_H_ | 6 #define CONTENT_RENDERER_MEDIA_BUFFERED_RESOURCE_LOADER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 namespace media { | 22 namespace media { |
23 class MediaLog; | 23 class MediaLog; |
24 class SeekableBuffer; | 24 class SeekableBuffer; |
25 } | 25 } |
26 | 26 |
27 namespace content { | 27 namespace content { |
28 | 28 |
29 const int64 kPositionNotSpecified = -1; | 29 const int64 kPositionNotSpecified = -1; |
30 | 30 |
31 const char kHttpScheme[] = "http"; | |
32 const char kHttpsScheme[] = "https"; | |
33 | |
34 // BufferedResourceLoader is single threaded and must be accessed on the | 31 // BufferedResourceLoader is single threaded and must be accessed on the |
35 // render thread. It wraps a WebURLLoader and does in-memory buffering, | 32 // render thread. It wraps a WebURLLoader and does in-memory buffering, |
36 // pausing resource loading when the in-memory buffer is full and resuming | 33 // pausing resource loading when the in-memory buffer is full and resuming |
37 // resource loading when there is available capacity. | 34 // resource loading when there is available capacity. |
38 class CONTENT_EXPORT BufferedResourceLoader | 35 class CONTENT_EXPORT BufferedResourceLoader |
39 : NON_EXPORTED_BASE(public blink::WebURLLoaderClient) { | 36 : NON_EXPORTED_BASE(public blink::WebURLLoaderClient) { |
40 public: | 37 public: |
41 // kNeverDefer - Aggresively buffer; never defer loading while paused. | 38 // kNeverDefer - Aggresively buffer; never defer loading while paused. |
42 // kReadThenDefer - Request only enough data to fulfill read requests. | 39 // kReadThenDefer - Request only enough data to fulfill read requests. |
43 // kCapacityDefer - Try to keep amount of buffered data at capacity. | 40 // kCapacityDefer - Try to keep amount of buffered data at capacity. |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 float playback_rate_; | 314 float playback_rate_; |
318 | 315 |
319 scoped_refptr<media::MediaLog> media_log_; | 316 scoped_refptr<media::MediaLog> media_log_; |
320 | 317 |
321 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); | 318 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); |
322 }; | 319 }; |
323 | 320 |
324 } // namespace content | 321 } // namespace content |
325 | 322 |
326 #endif // CONTENT_RENDERER_MEDIA_BUFFERED_RESOURCE_LOADER_H_ | 323 #endif // CONTENT_RENDERER_MEDIA_BUFFERED_RESOURCE_LOADER_H_ |
OLD | NEW |