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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. |
| 214 int64_t GetMemoryUsage() const; |
| 215 |
213 private: | 216 private: |
214 friend class BufferedDataSourceTest; | 217 friend class BufferedDataSourceTest; |
215 friend class BufferedResourceLoaderTest; | 218 friend class BufferedResourceLoaderTest; |
216 friend class MockBufferedDataSource; | 219 friend class MockBufferedDataSource; |
217 | 220 |
218 // Updates the |buffer_|'s forward and backward capacities. | 221 // Updates the |buffer_|'s forward and backward capacities. |
219 void UpdateBufferWindow(); | 222 void UpdateBufferWindow(); |
220 | 223 |
221 // Updates deferring behavior based on current buffering scheme. | 224 // Updates deferring behavior based on current buffering scheme. |
222 void UpdateDeferBehavior(); | 225 void UpdateDeferBehavior(); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 scoped_refptr<MediaLog> media_log_; | 329 scoped_refptr<MediaLog> media_log_; |
327 | 330 |
328 bool cancel_upon_deferral_; | 331 bool cancel_upon_deferral_; |
329 | 332 |
330 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); | 333 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); |
331 }; | 334 }; |
332 | 335 |
333 } // namespace media | 336 } // namespace media |
334 | 337 |
335 #endif // MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ | 338 #endif // MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ |
OLD | NEW |