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

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 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..38e89cfd41ae9caefc43f67dcd551ea00b1d8dcd
--- /dev/null
+++ b/content/renderer/media/webmediaplayer_proxy_impl_android.h
@@ -0,0 +1,62 @@
+// 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 "ipc/ipc_channel_proxy.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,
scherkus (not reviewing) 2012/09/07 13:17:35 initializer list style class A : public B,
qinmin 2012/09/07 22:48:27 Done.
+ public webkit_media::WebMediaPlayerProxyAndroid {
+ public:
+ 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) 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);
+
+ webkit_media::WebMediaPlayerManagerAndroid* manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerProxyImplAndroid);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PROXY_IMPL_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698