OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this |
2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
3 // LICENSE file. | 3 // LICENSE file. |
4 // | 4 // |
5 // Delegate calls from WebCore::MediaPlayerPrivate to google's video player. | 5 // Delegate calls from WebCore::MediaPlayerPrivate to google's video player. |
6 // It contains PipelineImpl which is the actual media player pipeline, it glues | 6 // It contains PipelineImpl which is the actual media player pipeline, it glues |
7 // the media player pipeline, data source, audio renderer and renderer. | 7 // the media player pipeline, data source, audio renderer and renderer. |
8 // PipelineImpl would creates multiple threads and access some public methods | 8 // PipelineImpl would creates multiple threads and access some public methods |
9 // of this class, so we need to be extra careful about concurrent access of | 9 // of this class, so we need to be extra careful about concurrent access of |
10 // methods and members. | 10 // methods and members. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 void PostTask(int index, WebMediaPlayerMethod method); | 157 void PostTask(int index, WebMediaPlayerMethod method); |
158 | 158 |
159 // Cancel all tasks currently lives in |main_loop_|. | 159 // Cancel all tasks currently lives in |main_loop_|. |
160 void CancelAllTasks(); | 160 void CancelAllTasks(); |
161 | 161 |
162 // Indexes for tasks. | 162 // Indexes for tasks. |
163 enum { | 163 enum { |
164 kRepaintTaskIndex = 0, | 164 kRepaintTaskIndex = 0, |
165 kReadyStateTaskIndex, | 165 kReadyStateTaskIndex, |
166 kNetworkStateTaskIndex, | 166 kNetworkStateTaskIndex, |
| 167 kTimeChangedTaskIndex, |
167 kLastTaskIndex | 168 kLastTaskIndex |
168 }; | 169 }; |
169 | 170 |
170 // TODO(hclam): get rid of these members and read from the pipeline directly. | 171 // TODO(hclam): get rid of these members and read from the pipeline directly. |
171 webkit_glue::WebMediaPlayer::NetworkState network_state_; | 172 webkit_glue::WebMediaPlayer::NetworkState network_state_; |
172 webkit_glue::WebMediaPlayer::ReadyState ready_state_; | 173 webkit_glue::WebMediaPlayer::ReadyState ready_state_; |
173 | 174 |
174 // Message loops for posting tasks between Chrome's main thread. Also used | 175 // Message loops for posting tasks between Chrome's main thread. Also used |
175 // for DCHECKs so methods calls won't execute in the wrong thread. | 176 // for DCHECKs so methods calls won't execute in the wrong thread. |
176 MessageLoop* main_loop_; | 177 MessageLoop* main_loop_; |
(...skipping 16 matching lines...) Expand all Loading... |
193 // |main_loop_|. |tasks_| can be access from main thread or the media threads | 194 // |main_loop_|. |tasks_| can be access from main thread or the media threads |
194 // we need a lock for protecting it. | 195 // we need a lock for protecting it. |
195 Lock task_lock_; | 196 Lock task_lock_; |
196 typedef std::vector<CancelableTask*> CancelableTaskList; | 197 typedef std::vector<CancelableTask*> CancelableTaskList; |
197 CancelableTaskList tasks_; | 198 CancelableTaskList tasks_; |
198 | 199 |
199 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerDelegateImpl); | 200 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerDelegateImpl); |
200 }; | 201 }; |
201 | 202 |
202 #endif // ifndef CHROME_RENDERER_WEBMEDIAPLAYER_DELEGATE_IMPL_H_ | 203 #endif // ifndef CHROME_RENDERER_WEBMEDIAPLAYER_DELEGATE_IMPL_H_ |
OLD | NEW |