Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Side by Side Diff: webkit/media/buffered_data_source.h

Issue 10700125: Fold RestartLoadingTask() into ReadCallback() as the method is called on the render thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase tot Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | webkit/media/buffered_data_source.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // BufferedResourceLoader for testing. 88 // BufferedResourceLoader for testing.
89 virtual BufferedResourceLoader* CreateResourceLoader( 89 virtual BufferedResourceLoader* CreateResourceLoader(
90 int64 first_byte_position, int64 last_byte_position); 90 int64 first_byte_position, int64 last_byte_position);
91 91
92 private: 92 private:
93 friend class BufferedDataSourceTest; 93 friend class BufferedDataSourceTest;
94 94
95 // Task posted to perform actual reading on the render thread. 95 // Task posted to perform actual reading on the render thread.
96 void ReadTask(int64 position, int read_size, uint8* read_buffer); 96 void ReadTask(int64 position, int read_size, uint8* read_buffer);
97 97
98 // Task posted when Stop() is called. Stops |watch_dog_timer_| and 98 // Task posted when Stop() is called. Stops |loader_|, resets Read()
99 // |loader_|, reset Read() variables, and set |stopped_on_render_loop_| 99 // variables, and sets |stopped_on_render_loop_| to signal any remaining
100 // to signal any remaining tasks to stop. 100 // tasks to stop.
101 void CleanupTask(); 101 void CleanupTask();
102 102
103 // Restart resource loading on render thread.
104 void RestartLoadingTask();
105
106 // This task uses the current playback rate with the previous playback rate 103 // This task uses the current playback rate with the previous playback rate
107 // to determine whether we are going from pause to play and play to pause, 104 // to determine whether we are going from pause to play and play to pause,
108 // and signals the buffered resource loader accordingly. 105 // and signals the buffered resource loader accordingly.
109 void SetPlaybackRateTask(float playback_rate); 106 void SetPlaybackRateTask(float playback_rate);
110 107
111 // Tells |loader_| the bitrate of the media. 108 // Tells |loader_| the bitrate of the media.
112 void SetBitrateTask(int bitrate); 109 void SetBitrateTask(int bitrate);
113 110
114 // The method that performs actual read. This method can only be executed on 111 // The method that performs actual read. This method can only be executed on
115 // the render thread. 112 // the render thread.
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 scoped_refptr<media::MediaLog> media_log_; 216 scoped_refptr<media::MediaLog> media_log_;
220 217
221 DownloadingCB downloading_cb_; 218 DownloadingCB downloading_cb_;
222 219
223 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource); 220 DISALLOW_COPY_AND_ASSIGN(BufferedDataSource);
224 }; 221 };
225 222
226 } // namespace webkit_media 223 } // namespace webkit_media
227 224
228 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_ 225 #endif // WEBKIT_MEDIA_BUFFERED_DATA_SOURCE_H_
OLDNEW
« no previous file with comments | « no previous file | webkit/media/buffered_data_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698