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

Side by Side Diff: webkit/glue/webmediaplayer_impl.h

Issue 269002: Report stalled event correctly for <video> (Closed)
Patch Set: comments Created 11 years, 2 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
OLDNEW
1 // Copyright (c) 2008-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be found 2 // Use of this source code is governed by a BSD-style license that can be found
3 // in the LICENSE file. 3 // in the LICENSE file.
4 // 4 //
5 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. 5 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome'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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect); 101 void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect);
102 void SetSize(const gfx::Rect& rect); 102 void SetSize(const gfx::Rect& rect);
103 void Detach(); 103 void Detach();
104 104
105 // Public methods called from the pipeline via callback issued by 105 // Public methods called from the pipeline via callback issued by
106 // WebMediaPlayerImpl. 106 // WebMediaPlayerImpl.
107 void PipelineInitializationCallback(); 107 void PipelineInitializationCallback();
108 void PipelineSeekCallback(); 108 void PipelineSeekCallback();
109 void PipelineEndedCallback(); 109 void PipelineEndedCallback();
110 void PipelineErrorCallback(); 110 void PipelineErrorCallback();
111 void NetworkEventCallback();
111 112
112 private: 113 private:
113 // Invoke |webmediaplayer_| to perform a repaint. 114 // Invoke |webmediaplayer_| to perform a repaint.
114 void RepaintTask(); 115 void RepaintTask();
115 116
116 // Notify |webmediaplayer_| that initialization has finished. 117 // Notify |webmediaplayer_| that initialization has finished.
117 void PipelineInitializationTask(); 118 void PipelineInitializationTask();
118 119
119 // Notify |webmediaplayer_| that a seek has finished. 120 // Notify |webmediaplayer_| that a seek has finished.
120 void PipelineSeekTask(); 121 void PipelineSeekTask();
121 122
122 // Notify |webmediaplayer_| that the media has ended. 123 // Notify |webmediaplayer_| that the media has ended.
123 void PipelineEndedTask(); 124 void PipelineEndedTask();
124 125
125 // Notify |webmediaplayer_| that a pipeline error has been set. 126 // Notify |webmediaplayer_| that a pipeline error has been set.
126 void PipelineErrorTask(); 127 void PipelineErrorTask();
127 128
129 // Notify |webmediaplayer_| that there's a network event.
130 void NetworkEventTask();
131
128 // The render message loop where WebKit lives. 132 // The render message loop where WebKit lives.
129 MessageLoop* render_loop_; 133 MessageLoop* render_loop_;
130 WebMediaPlayerImpl* webmediaplayer_; 134 WebMediaPlayerImpl* webmediaplayer_;
131 scoped_refptr<VideoRendererImpl> video_renderer_; 135 scoped_refptr<VideoRendererImpl> video_renderer_;
132 136
133 Lock lock_; 137 Lock lock_;
134 int outstanding_repaints_; 138 int outstanding_repaints_;
135 }; 139 };
136 140
137 // Construct a WebMediaPlayerImpl with reference to the client, and media 141 // Construct a WebMediaPlayerImpl with reference to the client, and media
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 void Repaint(); 226 void Repaint();
223 227
224 void OnPipelineInitialize(); 228 void OnPipelineInitialize();
225 229
226 void OnPipelineSeek(); 230 void OnPipelineSeek();
227 231
228 void OnPipelineEnded(); 232 void OnPipelineEnded();
229 233
230 void OnPipelineError(); 234 void OnPipelineError();
231 235
236 void OnNetworkEvent();
237
232 private: 238 private:
233 // Helpers that set the network/ready state and notifies the client if 239 // Helpers that set the network/ready state and notifies the client if
234 // they've changed. 240 // they've changed.
235 void SetNetworkState(WebKit::WebMediaPlayer::NetworkState state); 241 void SetNetworkState(WebKit::WebMediaPlayer::NetworkState state);
236 void SetReadyState(WebKit::WebMediaPlayer::ReadyState state); 242 void SetReadyState(WebKit::WebMediaPlayer::ReadyState state);
237 243
238 // Destroy resources held. 244 // Destroy resources held.
239 void Destroy(); 245 void Destroy();
240 246
241 // Getter method to |client_|. 247 // Getter method to |client_|.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 #if WEBKIT_USING_CG 281 #if WEBKIT_USING_CG
276 scoped_ptr<skia::PlatformCanvas> skia_canvas_; 282 scoped_ptr<skia::PlatformCanvas> skia_canvas_;
277 #endif 283 #endif
278 284
279 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); 285 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
280 }; 286 };
281 287
282 } // namespace webkit_glue 288 } // namespace webkit_glue
283 289
284 #endif // WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_ 290 #endif // WEBKIT_GLUE_WEBMEDIAPLAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698