Chromium Code Reviews| 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 MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ | 5 #ifndef MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ |
| 6 #define MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ | 6 #define MEDIA_BLINK_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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 const std::string& content_range_str, int64* first_byte_position, | 198 const std::string& content_range_str, int64* first_byte_position, |
| 199 int64* last_byte_position, int64* instance_size); | 199 int64* last_byte_position, int64* instance_size); |
| 200 | 200 |
| 201 // Cancels and closes any outstanding deferred ActiveLoader instances. Does | 201 // Cancels and closes any outstanding deferred ActiveLoader instances. Does |
| 202 // not report a failed state, so subsequent read calls to cache may still | 202 // not report a failed state, so subsequent read calls to cache may still |
| 203 // complete okay. If the ActiveLoader is not deferred it will be canceled once | 203 // complete okay. If the ActiveLoader is not deferred it will be canceled once |
| 204 // it is unless playback starts before then (as determined by the reported | 204 // it is unless playback starts before then (as determined by the reported |
| 205 // playback rate). | 205 // playback rate). |
| 206 void CancelUponDeferral(); | 206 void CancelUponDeferral(); |
| 207 | 207 |
| 208 // Returns the orinal URL of the response. If the response is generated in the | |
|
falken
2015/07/02 01:04:08
"original URL"
"a Service Worker"
horo
2015/07/02 03:10:49
Done.
| |
| 209 // Service Worker it is empty. | |
| 210 const GURL response_original_url() const { return response_original_url_; } | |
| 211 | |
| 208 private: | 212 private: |
| 209 friend class BufferedDataSourceTest; | 213 friend class BufferedDataSourceTest; |
| 210 friend class BufferedResourceLoaderTest; | 214 friend class BufferedResourceLoaderTest; |
| 211 friend class MockBufferedDataSource; | 215 friend class MockBufferedDataSource; |
| 212 | 216 |
| 213 // Updates the |buffer_|'s forward and backward capacities. | 217 // Updates the |buffer_|'s forward and backward capacities. |
| 214 void UpdateBufferWindow(); | 218 void UpdateBufferWindow(); |
| 215 | 219 |
| 216 // Updates deferring behavior based on current buffering scheme. | 220 // Updates deferring behavior based on current buffering scheme. |
| 217 void UpdateDeferBehavior(); | 221 void UpdateDeferBehavior(); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 309 | 313 |
| 310 // Injected WebURLLoader instance for testing purposes. | 314 // Injected WebURLLoader instance for testing purposes. |
| 311 scoped_ptr<blink::WebURLLoader> test_loader_; | 315 scoped_ptr<blink::WebURLLoader> test_loader_; |
| 312 | 316 |
| 313 // Bitrate of the media. Set to 0 if unknown. | 317 // Bitrate of the media. Set to 0 if unknown. |
| 314 int bitrate_; | 318 int bitrate_; |
| 315 | 319 |
| 316 // Playback rate of the media. | 320 // Playback rate of the media. |
| 317 double playback_rate_; | 321 double playback_rate_; |
| 318 | 322 |
| 323 GURL response_original_url_; | |
| 324 | |
| 319 scoped_refptr<MediaLog> media_log_; | 325 scoped_refptr<MediaLog> media_log_; |
| 320 | 326 |
| 321 bool cancel_upon_deferral_; | 327 bool cancel_upon_deferral_; |
| 322 | 328 |
| 323 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); | 329 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); |
| 324 }; | 330 }; |
| 325 | 331 |
| 326 } // namespace media | 332 } // namespace media |
| 327 | 333 |
| 328 #endif // MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ | 334 #endif // MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ |
| OLD | NEW |