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

Unified Diff: webkit/media/android/webmediaplayer_android.h

Issue 10533049: Adding the logic for releasing decoder resources in WebMediaPlayerManagerAndroid (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing feedbacks Created 8 years, 6 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
« no previous file with comments | « no previous file | webkit/media/android/webmediaplayer_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/android/webmediaplayer_android.h
diff --git a/webkit/media/android/webmediaplayer_android.h b/webkit/media/android/webmediaplayer_android.h
index b948d362f6f4ced83d07cb6a3417f6e5ebf2bc96..9dbb7f392db5a4ef6b4b92411c0d75e4f6da9762 100644
--- a/webkit/media/android/webmediaplayer_android.h
+++ b/webkit/media/android/webmediaplayer_android.h
@@ -9,7 +9,7 @@
#include <jni.h>
#include "base/basictypes.h"
-#include "base/message_loop_proxy.h"
+#include "base/message_loop.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h"
@@ -38,6 +38,7 @@ class WebMediaPlayerProxyAndroid;
// media player, and reports player state changes to the webkit.
class WebMediaPlayerAndroid :
public WebKit::WebMediaPlayer,
+ public MessageLoop::DestructionObserver,
public base::SupportsWeakPtr<WebMediaPlayerAndroid> {
public:
WebMediaPlayerAndroid(WebKit::WebFrame* frame,
@@ -130,6 +131,12 @@ class WebMediaPlayerAndroid :
// However, the actual GlTexture is not released to keep the video screenshot.
void ReleaseMediaResources();
+ // Whether |media_player_| has been initialized.
+ bool IsInitialized() const;
+
+ // Method inherited from DestructionObserver.
+ virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
+
private:
// Create a media player to load the |url_| and prepare for playback.
// Because of limited decoding resources on mobile devices, idle media players
@@ -172,6 +179,9 @@ class WebMediaPlayerAndroid :
// The video frame object used for renderering by WebKit.
scoped_ptr<WebKit::WebVideoFrame> video_frame_;
+ // Message loops for main renderer thread.
+ MessageLoop* main_loop_;
+
// Proxy object that delegates method calls on Render Thread.
// This object is created on the Render Thread and is only called in the
// destructor.
« no previous file with comments | « no previous file | webkit/media/android/webmediaplayer_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698