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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 float playback_rate, | 89 float playback_rate, |
90 MediaLog* media_log); | 90 MediaLog* media_log); |
91 virtual ~BufferedResourceLoader(); | 91 virtual ~BufferedResourceLoader(); |
92 | 92 |
93 // Start the resource loading with the specified URL and range. | 93 // Start the resource loading with the specified URL and range. |
94 // | 94 // |
95 // |loading_cb| is executed when the loading state has changed. | 95 // |loading_cb| is executed when the loading state has changed. |
96 // |progress_cb| is executed when additional data has arrived. | 96 // |progress_cb| is executed when additional data has arrived. |
97 typedef base::Callback<void(Status)> StartCB; | 97 typedef base::Callback<void(Status)> StartCB; |
98 typedef base::Callback<void(LoadingState)> LoadingStateChangedCB; | 98 typedef base::Callback<void(LoadingState)> LoadingStateChangedCB; |
99 typedef base::Callback<void(int64)> ProgressCB; | 99 typedef base::Callback<void(int64, int64)> ProgressCB; |
100 void Start(const StartCB& start_cb, | 100 void Start(const StartCB& start_cb, |
101 const LoadingStateChangedCB& loading_cb, | 101 const LoadingStateChangedCB& loading_cb, |
102 const ProgressCB& progress_cb, | 102 const ProgressCB& progress_cb, |
103 blink::WebFrame* frame); | 103 blink::WebFrame* frame); |
104 | 104 |
105 // Stops everything associated with this loader, including active URL loads | 105 // Stops everything associated with this loader, including active URL loads |
106 // and pending callbacks. | 106 // and pending callbacks. |
107 // | 107 // |
108 // It is safe to delete a BufferedResourceLoader after calling Stop(). | 108 // It is safe to delete a BufferedResourceLoader after calling Stop(). |
109 void Stop(); | 109 void Stop(); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 float playback_rate_; | 311 float playback_rate_; |
312 | 312 |
313 scoped_refptr<MediaLog> media_log_; | 313 scoped_refptr<MediaLog> media_log_; |
314 | 314 |
315 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); | 315 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); |
316 }; | 316 }; |
317 | 317 |
318 } // namespace media | 318 } // namespace media |
319 | 319 |
320 #endif // MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ | 320 #endif // MEDIA_BLINK_BUFFERED_RESOURCE_LOADER_H_ |
OLD | NEW |