| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 WEBKIT_GLUE_MEDIA_BUFFERED_RESOURCE_LOADER_H_ | 5 #ifndef WEBKIT_GLUE_MEDIA_BUFFERED_RESOURCE_LOADER_H_ |
| 6 #define WEBKIT_GLUE_MEDIA_BUFFERED_RESOURCE_LOADER_H_ | 6 #define WEBKIT_GLUE_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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 kNeverDefer, | 47 kNeverDefer, |
| 48 kReadThenDefer, | 48 kReadThenDefer, |
| 49 kThresholdDefer, | 49 kThresholdDefer, |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 // |url| - URL for the resource to be loaded. | 52 // |url| - URL for the resource to be loaded. |
| 53 // |first_byte_position| - First byte to start loading from, | 53 // |first_byte_position| - First byte to start loading from, |
| 54 // |kPositionNotSpecified| for not specified. | 54 // |kPositionNotSpecified| for not specified. |
| 55 // |last_byte_position| - Last byte to be loaded, | 55 // |last_byte_position| - Last byte to be loaded, |
| 56 // |kPositionNotSpecified| for not specified. | 56 // |kPositionNotSpecified| for not specified. |
| 57 // |strategy| is the initial loading strategy to use. |
| 58 // |bitrate| is the bitrate of the media, 0 if unknown. |
| 59 // |playback_rate| is the current playback rate of the media. |
| 57 BufferedResourceLoader(const GURL& url, | 60 BufferedResourceLoader(const GURL& url, |
| 58 int64 first_byte_position, | 61 int64 first_byte_position, |
| 59 int64 last_byte_position, | 62 int64 last_byte_position, |
| 63 DeferStrategy strategy, |
| 64 int bitrate, |
| 65 float playback_rate, |
| 60 media::MediaLog* media_log); | 66 media::MediaLog* media_log); |
| 61 | 67 |
| 62 // Start the resource loading with the specified URL and range. | 68 // Start the resource loading with the specified URL and range. |
| 63 // This method operates in asynchronous mode. Once there's a response from the | 69 // This method operates in asynchronous mode. Once there's a response from the |
| 64 // server, success or fail |callback| is called with the result. | 70 // server, success or fail |callback| is called with the result. |
| 65 // |callback| is called with the following values: | 71 // |callback| is called with the following values: |
| 66 // - net::OK | 72 // - net::OK |
| 67 // The request has started successfully. | 73 // The request has started successfully. |
| 68 // - net::ERR_FAILED | 74 // - net::ERR_FAILED |
| 69 // The request has failed because of an error with the network. | 75 // The request has failed because of an error with the network. |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 float playback_rate_; | 294 float playback_rate_; |
| 289 | 295 |
| 290 scoped_refptr<media::MediaLog> media_log_; | 296 scoped_refptr<media::MediaLog> media_log_; |
| 291 | 297 |
| 292 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); | 298 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); |
| 293 }; | 299 }; |
| 294 | 300 |
| 295 } // namespace webkit_glue | 301 } // namespace webkit_glue |
| 296 | 302 |
| 297 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_RESOURCE_LOADER_H_ | 303 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_RESOURCE_LOADER_H_ |
| OLD | NEW |