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

Unified Diff: content/renderer/media/android/webmediaplayer_android.h

Issue 557593002: Clean up WebMediaPlayerAndroid needs_establish_peer_ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: needs_establish_peer_ Created 6 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
« no previous file with comments | « no previous file | content/renderer/media/android/webmediaplayer_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/android/webmediaplayer_android.h
diff --git a/content/renderer/media/android/webmediaplayer_android.h b/content/renderer/media/android/webmediaplayer_android.h
index bf290b71229ca958d8c356398b03be1238f6589e..ee4998715d1c8255a1ffb6ba32f1bbe46cc4dec9 100644
--- a/content/renderer/media/android/webmediaplayer_android.h
+++ b/content/renderer/media/android/webmediaplayer_android.h
@@ -266,12 +266,9 @@ class WebMediaPlayerAndroid : public blink::WebMediaPlayer,
void TryCreateStreamTextureProxyIfNeeded();
void DoCreateStreamTexture();
- // Helper method to reestablish the surface texture peer for android
- // media player.
- void EstablishSurfaceTexturePeer();
-
- // Requesting whether the surface texture peer needs to be reestablished.
- void SetNeedsEstablishPeer(bool needs_establish_peer);
+ // This method is meant to be idempotent. Should be called whenever any of
+ // conditions changes and it is ok to establish peer.
+ void EstablishSurfaceTexturePeerIfNeeded();
private:
void InitializePlayer(const GURL& url,
@@ -408,8 +405,15 @@ class WebMediaPlayerAndroid : public blink::WebMediaPlayer,
bool is_playing_;
// Whether media player needs to re-establish the surface texture peer.
+ // This should be unset in EstablishSurfaceTexturePeerIfNeeded only, and set
qinmin 2014/09/09 22:44:38 nit:s/EstablishSurfaceTexturePeerIfNeeded/Establis
+ // we believe peer is disconnected that we need to establish it again.
+ // Setting this should not be conditioned on additional state, eg playing
+ // or full screen.
bool needs_establish_peer_;
+ // This is a helper state used in EstablishSurfaceTexturePeerIfNeeded.
qinmin 2014/09/09 22:44:38 nit:s/EstablishSurfaceTexturePeerIfNeeded/Establis
+ bool in_fullscreen_;
+
// Whether |stream_texture_proxy_| is initialized.
bool stream_texture_proxy_initialized_;
« no previous file with comments | « no previous file | content/renderer/media/android/webmediaplayer_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698