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

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: addressing comments and resolving merge conflicts 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 "webkit/media/android/webmediaplayer_proxy_android.h"
12
13 namespace webkit_media {
14 class WebMediaPlayerImplAndroid;
15 class WebMediaPlayerManagerAndroid;
16 }
17
18 namespace content {
19
20 // This class manages all the IPC communications between
21 // WebMediaPlayerImplAndroid and the MediaPlayerManagerAndroid in the browser
22 // process.
23 class WebMediaPlayerProxyImplAndroid
24 : public RenderViewObserver,
25 public webkit_media::WebMediaPlayerProxyAndroid {
26 public:
27 // Construct a WebMediaPlayerProxyImplAndroid object for the |render_view|.
28 // |manager| is passed to this class so that it can find the right
29 // WebMediaPlayerImplAndroid using player IDs.
30 WebMediaPlayerProxyImplAndroid(
31 RenderView* render_view,
32 webkit_media::WebMediaPlayerManagerAndroid* manager);
33 virtual ~WebMediaPlayerProxyImplAndroid();
34
35 bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
36
37 // Methods inherited from WebMediaPlayerProxyAndroid.
38 virtual void Initialize(int player_id, const std::string& url,
39 const std::string& first_party_for_cookies) OVERRIDE;
40 virtual void Start(int player_id) OVERRIDE;
41 virtual void Pause(int player_id) OVERRIDE;
42 virtual void Seek(int player_id, base::TimeDelta time) OVERRIDE;
43 virtual void ReleaseResources(int player_id) OVERRIDE;
44 virtual void DestroyPlayer(int player_id) OVERRIDE;
45
46 private:
47 webkit_media::WebMediaPlayerImplAndroid* GetWebMediaPlayer(int player_id);
48
49 // Message handlers.
50 void OnMediaPrepared(int player_id, base::TimeDelta duration);
51 void OnMediaPlaybackCompleted(int player_id);
52 void OnMediaBufferingUpdate(int player_id, int percent);
53 void OnMediaSeekCompleted(int player_id, base::TimeDelta current_time);
54 void OnMediaError(int player_id, int error);
55 void OnVideoSizeChanged(int player_id, int width, int height);
56 void OnTimeUpdate(int player_id, base::TimeDelta current_time);
57 void OnMediaPlayerReleased(int player_id);
58
59 webkit_media::WebMediaPlayerManagerAndroid* manager_;
60
61 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerProxyImplAndroid);
62 };
63
64 } // namespace content
65
66 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_
OLDNEW
« no previous file with comments | « content/public/common/content_switches.cc ('k') | content/renderer/media/webmediaplayer_proxy_impl_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698