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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/webmediaplayer_proxy_impl_android.h
diff --git a/content/renderer/media/webmediaplayer_proxy_impl_android.h b/content/renderer/media/webmediaplayer_proxy_impl_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..c6ac682390931a22f02d303c78dff8504f9ae92a
--- /dev/null
+++ b/content/renderer/media/webmediaplayer_proxy_impl_android.h
@@ -0,0 +1,66 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_
+#define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_
+
+#include <map>
+
+#include "content/public/renderer/render_view_observer.h"
+#include "webkit/media/android/webmediaplayer_proxy_android.h"
+
+namespace webkit_media {
+class WebMediaPlayerImplAndroid;
+class WebMediaPlayerManagerAndroid;
+}
+
+namespace content {
+
+// This class manages all the IPC communications between
+// WebMediaPlayerImplAndroid and the MediaPlayerManagerAndroid in the browser
+// process.
+class WebMediaPlayerProxyImplAndroid
+ : public RenderViewObserver,
+ public webkit_media::WebMediaPlayerProxyAndroid {
+ public:
+ // Construct a WebMediaPlayerProxyImplAndroid object for the |render_view|.
+ // |manager| is passed to this class so that it can find the right
+ // WebMediaPlayerImplAndroid using player IDs.
+ WebMediaPlayerProxyImplAndroid(
+ RenderView* render_view,
+ webkit_media::WebMediaPlayerManagerAndroid* manager);
+ virtual ~WebMediaPlayerProxyImplAndroid();
+
+ bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
+
+ // Methods inherited from WebMediaPlayerProxyAndroid.
+ virtual void Initialize(int player_id, const std::string& url,
+ const std::string& first_party_for_cookies) OVERRIDE;
+ virtual void Start(int player_id) OVERRIDE;
+ virtual void Pause(int player_id) OVERRIDE;
+ virtual void Seek(int player_id, base::TimeDelta time) OVERRIDE;
+ virtual void ReleaseResources(int player_id) OVERRIDE;
+ virtual void DestroyPlayer(int player_id) OVERRIDE;
+
+ private:
+ webkit_media::WebMediaPlayerImplAndroid* GetWebMediaPlayer(int player_id);
+
+ // Message handlers.
+ void OnMediaPrepared(int player_id, base::TimeDelta duration);
+ void OnMediaPlaybackCompleted(int player_id);
+ void OnMediaBufferingUpdate(int player_id, int percent);
+ void OnMediaSeekCompleted(int player_id, base::TimeDelta current_time);
+ void OnMediaError(int player_id, int error);
+ void OnVideoSizeChanged(int player_id, int width, int height);
+ void OnTimeUpdate(int player_id, base::TimeDelta current_time);
+ void OnMediaPlayerReleased(int player_id);
+
+ webkit_media::WebMediaPlayerManagerAndroid* manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerProxyImplAndroid);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_
« 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