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

Side by Side Diff: content/renderer/media/webmediaplayer_proxy_impl_android.h

Issue 10919075: Move android mediaplayer from render process to browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding cookie policy check and fix the threading issue for CookieGetterImpl Created 8 years, 3 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_
6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_
7
8 #include <map>
9
10 #include "content/public/renderer/render_view_observer.h"
11 #include "ipc/ipc_channel_proxy.h"
12 #include "webkit/media/android/webmediaplayer_proxy_android.h"
13
14 namespace webkit_media {
15 class WebMediaPlayerImplAndroid;
16 class WebMediaPlayerManagerAndroid;
17 }
18
19 namespace content {
20
21 // This class manages all the IPC communications between
22 // WebMediaPlayerImplAndroid and the MediaplayerManagerAndroid in the browser
Yaron 2012/09/13 00:14:48 Nit: MediaPlayerManagerAndroid
qinmin 2012/09/13 18:51:16 Done.
23 // process.
24 class WebMediaPlayerProxyImplAndroid
25 : public RenderViewObserver,
26 public webkit_media::WebMediaPlayerProxyAndroid {
27 public:
28 // Construct a WebMediaPlayerProxyImplAndroid object for the |render_view|.
29 // |manager| is passed to this class so that it can find the right
30 // WebMediaPlayerImplAndroid using player IDs.
31 WebMediaPlayerProxyImplAndroid(
32 RenderView* render_view,
33 webkit_media::WebMediaPlayerManagerAndroid* manager);
34 virtual ~WebMediaPlayerProxyImplAndroid();
35
36 bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
37
38 // Methods inherited from WebMediaPlayerProxyAndroid.
39 virtual void Initialize(int player_id, const std::string& url,
40 const std::string& first_party_for_cookies) OVERRIDE;
41 virtual void Start(int player_id) OVERRIDE;
42 virtual void Pause(int player_id) OVERRIDE;
43 virtual void Seek(int player_id, base::TimeDelta time) OVERRIDE;
44 virtual void ReleaseResources(int player_id) OVERRIDE;
45 virtual void DestroyPlayer(int player_id) OVERRIDE;
46
47 private:
48 webkit_media::WebMediaPlayerImplAndroid* GetWebMediaPlayer(int player_id);
49
50 // Message handlers.
51 void OnMediaPrepared(int player_id, base::TimeDelta duration);
52 void OnMediaPlaybackCompleted(int player_id);
53 void OnMediaBufferingUpdate(int player_id, int percent);
54 void OnMediaSeekCompleted(int player_id, base::TimeDelta current_time);
55 void OnMediaError(int player_id, int error);
56 void OnVideoSizeChanged(int player_id, int width, int height);
57 void OnTimeUpdate(int player_id, base::TimeDelta current_time);
58 void OnMediaPlayerReleased(int player_id);
59
60 webkit_media::WebMediaPlayerManagerAndroid* manager_;
61
62 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerProxyImplAndroid);
63 };
64
65 } // namespace content
66
67 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698