| OLD | NEW |
| 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 WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_ | 5 #ifndef WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_ |
| 6 #define WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_ | 6 #define WEBKIT_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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 WebKit::WebURLLoader* loader, | 162 WebKit::WebURLLoader* loader, |
| 163 double finishTime); | 163 double finishTime); |
| 164 virtual void didFail( | 164 virtual void didFail( |
| 165 WebKit::WebURLLoader* loader, | 165 WebKit::WebURLLoader* loader, |
| 166 const WebKit::WebURLError&); | 166 const WebKit::WebURLError&); |
| 167 | 167 |
| 168 // Returns true if the media resource has a single origin, false otherwise. | 168 // Returns true if the media resource has a single origin, false otherwise. |
| 169 // Only valid to call after Start() has completed. | 169 // Only valid to call after Start() has completed. |
| 170 bool HasSingleOrigin() const; | 170 bool HasSingleOrigin() const; |
| 171 | 171 |
| 172 // Sets the defer strategy to the given value. | 172 // Sets the defer strategy to the given value unless it seems unwise. |
| 173 // Specifically downgrade kNeverDefer to kThresholdDefer if we know the |
| 174 // current response will not be used to satisfy future requests (the cache |
| 175 // won't help us). |
| 173 void UpdateDeferStrategy(DeferStrategy strategy); | 176 void UpdateDeferStrategy(DeferStrategy strategy); |
| 174 | 177 |
| 175 // Sets the playback rate to the given value and updates buffer window | 178 // Sets the playback rate to the given value and updates buffer window |
| 176 // accordingly. | 179 // accordingly. |
| 177 void SetPlaybackRate(float playback_rate); | 180 void SetPlaybackRate(float playback_rate); |
| 178 | 181 |
| 179 // Sets the bitrate to the given value and updates buffer window | 182 // Sets the bitrate to the given value and updates buffer window |
| 180 // accordingly. | 183 // accordingly. |
| 181 void SetBitrate(int bitrate); | 184 void SetBitrate(int bitrate); |
| 182 | 185 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 // Keeps track of an active WebURLLoader and associated state. | 263 // Keeps track of an active WebURLLoader and associated state. |
| 261 scoped_ptr<ActiveLoader> active_loader_; | 264 scoped_ptr<ActiveLoader> active_loader_; |
| 262 | 265 |
| 263 // Tracks if |active_loader_| failed. If so, then all calls to Read() will | 266 // Tracks if |active_loader_| failed. If so, then all calls to Read() will |
| 264 // fail. | 267 // fail. |
| 265 bool loader_failed_; | 268 bool loader_failed_; |
| 266 | 269 |
| 267 // Current buffering algorithm in place for resource loading. | 270 // Current buffering algorithm in place for resource loading. |
| 268 DeferStrategy defer_strategy_; | 271 DeferStrategy defer_strategy_; |
| 269 | 272 |
| 273 // True if the currently-reading response might be used to satisfy a future |
| 274 // request from the cache. |
| 275 bool might_be_reused_from_cache_in_future_; |
| 276 |
| 270 // True if Range header is supported. | 277 // True if Range header is supported. |
| 271 bool range_supported_; | 278 bool range_supported_; |
| 272 | 279 |
| 273 // Forward capacity to reset to after an extension. | 280 // Forward capacity to reset to after an extension. |
| 274 size_t saved_forward_capacity_; | 281 size_t saved_forward_capacity_; |
| 275 | 282 |
| 276 GURL url_; | 283 GURL url_; |
| 277 int64 first_byte_position_; | 284 int64 first_byte_position_; |
| 278 int64 last_byte_position_; | 285 int64 last_byte_position_; |
| 279 bool single_origin_; | 286 bool single_origin_; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 309 float playback_rate_; | 316 float playback_rate_; |
| 310 | 317 |
| 311 scoped_refptr<media::MediaLog> media_log_; | 318 scoped_refptr<media::MediaLog> media_log_; |
| 312 | 319 |
| 313 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); | 320 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); |
| 314 }; | 321 }; |
| 315 | 322 |
| 316 } // namespace webkit_media | 323 } // namespace webkit_media |
| 317 | 324 |
| 318 #endif // WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_ | 325 #endif // WEBKIT_MEDIA_BUFFERED_RESOURCE_LOADER_H_ |
| OLD | NEW |