OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MULTIBUFFER_READER_H_ | 5 #ifndef MEDIA_BLINK_MULTIBUFFER_READER_H_ |
6 #define MEDIA_BLINK_MULTIBUFFER_READER_H_ | 6 #define MEDIA_BLINK_MULTIBUFFER_READER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <limits> | 10 #include <limits> |
11 #include <map> | 11 #include <map> |
12 #include <set> | 12 #include <set> |
13 | 13 |
| 14 #include "base/memory/linked_ptr.h" |
14 #include "media/blink/multibuffer.h" | 15 #include "media/blink/multibuffer.h" |
15 | 16 |
16 namespace media { | 17 namespace media { |
17 | 18 |
18 // Wrapper for MultiBuffer that offers a simple byte-reading | 19 // Wrapper for MultiBuffer that offers a simple byte-reading |
19 // interface with prefetch. | 20 // interface with prefetch. |
20 class MEDIA_EXPORT MultiBufferReader | 21 class MEDIA_BLINK_EXPORT MultiBufferReader |
21 : NON_EXPORTED_BASE(public MultiBuffer::Reader) { | 22 : NON_EXPORTED_BASE(public MultiBuffer::Reader) { |
22 public: | 23 public: |
23 // Note that |progress_callback| is guaranteed to be called if | 24 // Note that |progress_callback| is guaranteed to be called if |
24 // a redirect happens and the url_data is updated. Otherwise | 25 // a redirect happens and the url_data is updated. Otherwise |
25 // origin checks will become insecure. | 26 // origin checks will become insecure. |
26 // Users probably want to call SetMaxBuffer & SetPreload after | 27 // Users probably want to call SetMaxBuffer & SetPreload after |
27 // creating the a MultiBufferReader. | 28 // creating the a MultiBufferReader. |
28 // The progress callback will be called when the "available range" | 29 // The progress callback will be called when the "available range" |
29 // changes. (The number of bytes available for reading before and | 30 // changes. (The number of bytes available for reading before and |
30 // after the current position.) The arguments for the progress | 31 // after the current position.) The arguments for the progress |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // Progress callback. | 145 // Progress callback. |
145 base::Callback<void(int64_t, int64_t)> progress_callback_; | 146 base::Callback<void(int64_t, int64_t)> progress_callback_; |
146 | 147 |
147 // Hack to let us detect if we've been deleted when calling a callback. | 148 // Hack to let us detect if we've been deleted when calling a callback. |
148 bool* clear_on_delete_; | 149 bool* clear_on_delete_; |
149 }; | 150 }; |
150 | 151 |
151 } // namespace media | 152 } // namespace media |
152 | 153 |
153 #endif // MEDIA_BLINK_MULTIBUFFER_READER_H_ | 154 #endif // MEDIA_BLINK_MULTIBUFFER_READER_H_ |
OLD | NEW |