| 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_DATA_SOURCE_H_ | 5 #ifndef WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ |
| 6 #define WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ | 6 #define WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 virtual void Abort(); | 60 virtual void Abort(); |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 // A factory method to create a BufferedResourceLoader based on the read | 63 // A factory method to create a BufferedResourceLoader based on the read |
| 64 // parameters. We can override this file to object a mock | 64 // parameters. We can override this file to object a mock |
| 65 // BufferedResourceLoader for testing. | 65 // BufferedResourceLoader for testing. |
| 66 virtual BufferedResourceLoader* CreateResourceLoader( | 66 virtual BufferedResourceLoader* CreateResourceLoader( |
| 67 int64 first_byte_position, int64 last_byte_position); | 67 int64 first_byte_position, int64 last_byte_position); |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 friend class BufferedDataSourceTest2; |
| 71 |
| 70 // Posted to perform initialization on render thread and start resource | 72 // Posted to perform initialization on render thread and start resource |
| 71 // loading. | 73 // loading. |
| 72 void InitializeTask(); | 74 void InitializeTask(); |
| 73 | 75 |
| 74 // Task posted to perform actual reading on the render thread. | 76 // Task posted to perform actual reading on the render thread. |
| 75 void ReadTask(int64 position, int read_size, uint8* read_buffer); | 77 void ReadTask(int64 position, int read_size, uint8* read_buffer); |
| 76 | 78 |
| 77 // Task posted when Stop() is called. Stops |watch_dog_timer_| and | 79 // Task posted when Stop() is called. Stops |watch_dog_timer_| and |
| 78 // |loader_|, reset Read() variables, and set |stopped_on_render_loop_| | 80 // |loader_|, reset Read() variables, and set |stopped_on_render_loop_| |
| 79 // to signal any remaining tasks to stop. | 81 // to signal any remaining tasks to stop. |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 // element. | 210 // element. |
| 209 media::Preload preload_; | 211 media::Preload preload_; |
| 210 | 212 |
| 211 // Keeps track of whether we used a Range header in the initialization | 213 // Keeps track of whether we used a Range header in the initialization |
| 212 // request. | 214 // request. |
| 213 bool using_range_request_; | 215 bool using_range_request_; |
| 214 | 216 |
| 215 // Number of cache miss retries left. | 217 // Number of cache miss retries left. |
| 216 int cache_miss_retries_left_; | 218 int cache_miss_retries_left_; |
| 217 | 219 |
| 220 // Bitrate of the content, 0 if unknown. |
| 221 int bitrate_; |
| 222 |
| 223 // Current playback rate. |
| 224 float playback_rate_; |
| 225 |
| 218 scoped_refptr<media::MediaLog> media_log_; | 226 scoped_refptr<media::MediaLog> media_log_; |
| 219 | 227 |
| 220 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); | 228 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); |
| 221 }; | 229 }; |
| 222 | 230 |
| 223 } // namespace webkit_glue | 231 } // namespace webkit_glue |
| 224 | 232 |
| 225 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ | 233 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ |
| OLD | NEW |