| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 WEBKIT_GLUE_MEDIA_BUFFERED_RESOURCE_LOADER_H_ | 5 #ifndef WEBKIT_GLUE_MEDIA_BUFFERED_RESOURCE_LOADER_H_ |
| 6 #define WEBKIT_GLUE_MEDIA_BUFFERED_RESOURCE_LOADER_H_ | 6 #define WEBKIT_GLUE_MEDIA_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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 void DoneRead(int error); | 200 void DoneRead(int error); |
| 201 | 201 |
| 202 // Done with start. Invokes the start callback and reset it. | 202 // Done with start. Invokes the start callback and reset it. |
| 203 void DoneStart(int error); | 203 void DoneStart(int error); |
| 204 | 204 |
| 205 // Calls |event_callback_| in terms of a network event. | 205 // Calls |event_callback_| in terms of a network event. |
| 206 void NotifyNetworkEvent(); | 206 void NotifyNetworkEvent(); |
| 207 | 207 |
| 208 bool HasPendingRead() { return read_callback_.get() != NULL; } | 208 bool HasPendingRead() { return read_callback_.get() != NULL; } |
| 209 | 209 |
| 210 // Helper function that returns true if a range is not provided | 210 // Helper function that returns true if a range request was specified. |
| 211 // or a 0- range is specified. | 211 bool IsRangeRequest() const; |
| 212 bool IsWholeFileRange() const; | |
| 213 | 212 |
| 214 // A sliding window of buffer. | 213 // A sliding window of buffer. |
| 215 scoped_ptr<media::SeekableBuffer> buffer_; | 214 scoped_ptr<media::SeekableBuffer> buffer_; |
| 216 | 215 |
| 217 // True if resource loading was deferred. | 216 // True if resource loading was deferred. |
| 218 bool deferred_; | 217 bool deferred_; |
| 219 | 218 |
| 220 // Current buffering algorithm in place for resource loading. | 219 // Current buffering algorithm in place for resource loading. |
| 221 DeferStrategy defer_strategy_; | 220 DeferStrategy defer_strategy_; |
| 222 | 221 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 259 |
| 261 // Used to ensure mocks for unittests are used instead of reset in Start(). | 260 // Used to ensure mocks for unittests are used instead of reset in Start(). |
| 262 bool keep_test_loader_; | 261 bool keep_test_loader_; |
| 263 | 262 |
| 264 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); | 263 DISALLOW_COPY_AND_ASSIGN(BufferedResourceLoader); |
| 265 }; | 264 }; |
| 266 | 265 |
| 267 } // namespace webkit_glue | 266 } // namespace webkit_glue |
| 268 | 267 |
| 269 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_RESOURCE_LOADER_H_ | 268 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_RESOURCE_LOADER_H_ |
| OLD | NEW |