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_MEDIA_BUFFERED_DATA_SOURCE_H_ | 5 #ifndef WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ |
6 #define WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ | 6 #define WEBKIT_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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 virtual void Abort() OVERRIDE; | 62 virtual void Abort() OVERRIDE; |
63 | 63 |
64 protected: | 64 protected: |
65 // A factory method to create a BufferedResourceLoader based on the read | 65 // A factory method to create a BufferedResourceLoader based on the read |
66 // parameters. We can override this file to object a mock | 66 // parameters. We can override this file to object a mock |
67 // BufferedResourceLoader for testing. | 67 // BufferedResourceLoader for testing. |
68 virtual BufferedResourceLoader* CreateResourceLoader( | 68 virtual BufferedResourceLoader* CreateResourceLoader( |
69 int64 first_byte_position, int64 last_byte_position); | 69 int64 first_byte_position, int64 last_byte_position); |
70 | 70 |
71 private: | 71 private: |
72 friend class BufferedDataSourceTest2; | 72 friend class BufferedDataSourceTest; |
73 | 73 |
74 // Posted to perform initialization on render thread and start resource | 74 // Posted to perform initialization on render thread and start resource |
75 // loading. | 75 // loading. |
76 void InitializeTask(); | 76 void InitializeTask(); |
77 | 77 |
78 // Task posted to perform actual reading on the render thread. | 78 // Task posted to perform actual reading on the render thread. |
79 void ReadTask(int64 position, int read_size, uint8* read_buffer); | 79 void ReadTask(int64 position, int read_size, uint8* read_buffer); |
80 | 80 |
81 // Task posted when Stop() is called. Stops |watch_dog_timer_| and | 81 // Task posted when Stop() is called. Stops |watch_dog_timer_| and |
82 // |loader_|, reset Read() variables, and set |stopped_on_render_loop_| | 82 // |loader_|, reset Read() variables, and set |stopped_on_render_loop_| |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 float playback_rate_; | 226 float playback_rate_; |
227 | 227 |
228 scoped_refptr<media::MediaLog> media_log_; | 228 scoped_refptr<media::MediaLog> media_log_; |
229 | 229 |
230 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); | 230 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); |
231 }; | 231 }; |
232 | 232 |
233 } // namespace webkit_media | 233 } // namespace webkit_media |
234 | 234 |
235 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ | 235 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ |
OLD | NEW |