| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 // the request was made. This method is made virtual so as to inject a | 55 // the request was made. This method is made virtual so as to inject a |
| 56 // different number for testing purpose. | 56 // different number for testing purpose. |
| 57 virtual base::TimeDelta GetTimeoutMilliseconds(); | 57 virtual base::TimeDelta GetTimeoutMilliseconds(); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 // Posted to perform initialization on render thread and start resource | 60 // Posted to perform initialization on render thread and start resource |
| 61 // loading. | 61 // loading. |
| 62 void InitializeTask(); | 62 void InitializeTask(); |
| 63 | 63 |
| 64 // Task posted to perform actual reading on the render thread. | 64 // Task posted to perform actual reading on the render thread. |
| 65 void ReadTask(int64 position, int read_size, uint8* read_buffer, | 65 void ReadTask(int64 position, int read_size, uint8* read_buffer); |
| 66 media::DataSource::ReadCallback* read_callback); | |
| 67 | 66 |
| 68 // Task posted when Stop() is called. Stops |watch_dog_timer_| and | 67 // Task posted when Stop() is called. Stops |watch_dog_timer_| and |
| 69 // |loader_|, reset Read() variables, and set |stopped_on_render_loop_| | 68 // |loader_|, reset Read() variables, and set |stopped_on_render_loop_| |
| 70 // to signal any remaining tasks to stop. | 69 // to signal any remaining tasks to stop. |
| 71 void CleanupTask(); | 70 void CleanupTask(); |
| 72 | 71 |
| 73 // Restart resource loading on render thread. | 72 // Restart resource loading on render thread. |
| 74 void RestartLoadingTask(); | 73 void RestartLoadingTask(); |
| 75 | 74 |
| 76 // This task monitors the current active read request. If the current read | 75 // This task monitors the current active read request. If the current read |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // Keeps track of whether we used a Range header in the initialization | 197 // Keeps track of whether we used a Range header in the initialization |
| 199 // request. | 198 // request. |
| 200 bool using_range_request_; | 199 bool using_range_request_; |
| 201 | 200 |
| 202 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); | 201 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); |
| 203 }; | 202 }; |
| 204 | 203 |
| 205 } // namespace webkit_glue | 204 } // namespace webkit_glue |
| 206 | 205 |
| 207 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ | 206 #endif // WEBKIT_GLUE_MEDIA_BUFFERED_DATA_SOURCE_H_ |
| OLD | NEW |