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

Unified Diff: webkit/media/android/webmediaplayer_proxy_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: webkit/media/android/webmediaplayer_proxy_android.h
diff --git a/webkit/media/android/webmediaplayer_proxy_android.h b/webkit/media/android/webmediaplayer_proxy_android.h
index 2b491ffd88a14ef575971f07a954c8d98098cfc9..aeabe787641ec16315b923bdee29bdee2d95925a 100644
--- a/webkit/media/android/webmediaplayer_proxy_android.h
+++ b/webkit/media/android/webmediaplayer_proxy_android.h
@@ -5,68 +5,38 @@
#ifndef WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_PROXY_ANDROID_H_
#define WEBKIT_MEDIA_ANDROID_WEBMEDIAPLAYER_PROXY_ANDROID_H_
-#include "base/memory/ref_counted.h"
-#include "base/memory/weak_ptr.h"
+#include <string>
-namespace base {
-class MessageLoopProxy;
-}
+#include "base/time.h"
namespace webkit_media {
-class WebMediaPlayerAndroid;
-
-// Acts as a thread proxy between media::MediaPlayerBridge and
-// WebMediaPlayerAndroid so that callbacks are posted onto the render thread.
-class WebMediaPlayerProxyAndroid
- : public base::RefCountedThreadSafe<WebMediaPlayerProxyAndroid> {
+// An interface to facilitate the IPC between the browser side
+// android::MediaPlayer and the WebMediaPlayerImplAndroid in the renderer
+// process.
+// Implementation is provided by content::WebMediaPlayerProxyImplAndroid.
+class WebMediaPlayerProxyAndroid {
public:
- WebMediaPlayerProxyAndroid(
- const scoped_refptr<base::MessageLoopProxy>& render_loop,
- base::WeakPtr<WebMediaPlayerAndroid> webmediaplayer);
-
- // Callbacks from media::MediaPlayerBridge to WebMediaPlayerAndroid.
- void MediaErrorCallback(int error_type);
- void MediaInfoCallback(int info_type);
- void VideoSizeChangedCallback(int width, int height);
- void BufferingUpdateCallback(int percent);
- void PlaybackCompleteCallback();
- void SeekCompleteCallback();
- void MediaPreparedCallback();
-
- private:
- friend class base::RefCountedThreadSafe<WebMediaPlayerProxyAndroid>;
virtual ~WebMediaPlayerProxyAndroid();
- // Notify |webmediaplayer_| that an error has occured.
- void MediaErrorTask(int error_type);
-
- // Notify |webmediaplayer_| that some info has been received from
- // media::MediaPlayerBridge.
- void MediaInfoTask(int info_type);
-
- // Notify |webmediaplayer_| that the video size has changed.
- void VideoSizeChangedTask(int width, int height);
-
- // Notify |webmediaplayer_| that an update in buffering has occured.
- void BufferingUpdateTask(int percent);
-
- // Notify |webmediaplayer_| that playback has completed.
- void PlaybackCompleteTask();
+ // Initialize a MediaPlayerBridge object in browser process
+ virtual void Initialize(int player_id, const std::string& url,
+ const std::string& first_party_for_cookies) = 0;
- // Notify |webmediaplayer_| that seek has completed.
- void SeekCompleteTask();
+ // Start the player.
+ virtual void Start(int player_id) = 0;
- // Notify |webmediaplayer_| that media has been prepared successfully.
- void MediaPreparedTask();
+ // Pause the player.
+ virtual void Pause(int player_id) = 0;
- // The render message loop where WebKit lives.
- scoped_refptr<base::MessageLoopProxy> render_loop_;
+ // Perform seek on the player.
+ virtual void Seek(int player_id, base::TimeDelta time) = 0;
- // The WebMediaPlayerAndroid object all the callbacks should be send to.
- base::WeakPtr<WebMediaPlayerAndroid> webmediaplayer_;
+ // Release resources for the player.
+ virtual void ReleaseResources(int player_id) = 0;
- DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerProxyAndroid);
+ // Destroy the player in the browser process
+ virtual void DestroyPlayer(int player_id) = 0;
};
} // namespace webkit_media
« no previous file with comments | « webkit/media/android/webmediaplayer_manager_android.cc ('k') | webkit/media/android/webmediaplayer_proxy_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698