| 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 original URL of the response. If the request is redirected to | 208 // Returns the original URL of the response. If the request is redirected to |
| 209 // another URL it is the URL after redirected. If the response is generated in | 209 // another URL it is the URL after redirected. If the response is generated in |
| 210 // a Service Worker it is empty. | 210 // a Service Worker it is empty. |
| 211 const GURL response_original_url() const { return response_original_url_; } | 211 const GURL& response_original_url() const { return response_original_url_; } |
| 212 | 212 |
| 213 // Returns an estimate of the amount of memory owned by the resource loader. | 213 // Returns an estimate of the amount of memory owned by the resource loader. |
| 214 int64_t GetMemoryUsage() const; | 214 int64_t GetMemoryUsage() const; |
| 215 | 215 |
| 216 private: | 216 private: |
| 217 friend class BufferedDataSourceTest; | 217 friend class BufferedDataSourceTest; |
| 218 friend class BufferedResourceLoaderTest; | 218 friend class BufferedResourceLoaderTest; |
| 219 friend class MockBufferedDataSource; | 219 friend class MockBufferedDataSource; |
| 220 | 220 |
| 221 // Updates the |buffer_|'s forward and backward capacities. | 221 // Updates the |buffer_|'s forward and backward capacities. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 scoped_refptr<MediaLog> media_log_; | 329 scoped_refptr<MediaLog> media_log_; |
| 330 | 330 |
| 331 bool cancel_upon_deferral_; | 331 bool cancel_upon_deferral_; |
| 332 | 332 |
| 333 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); | 333 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); |
| 334 }; | 334 }; |
| 335 | 335 |
| 336 } // namespace media | 336 } // namespace media |
| 337 | 337 |
| 338 #endif // MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ | 338 #endif // MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ |
| OLD | NEW |