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

Unified Diff: third_party/WebKit/Source/core/html/HTMLVideoElement.cpp

Issue 2825493005: Enable smooth transition when show/hide media remoting interstitial. (Closed)
Patch Set: Fix nits. Created 3 years, 8 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: third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp b/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
index c8fa9d8076710e439c8767005e9b61272a3308c3..8bb6dad5d80d2e7538a71592ca671a067332264c 100644
--- a/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
@@ -492,7 +492,7 @@ ScriptPromise HTMLVideoElement::CreateImageBitmap(
}
void HTMLVideoElement::MediaRemotingStarted() {
- DCHECK_EQ(media_remoting_status_, MediaRemotingStatus::kNotStarted);
+ DCHECK(media_remoting_status_ == MediaRemotingStatus::kNotStarted);
media_remoting_status_ = MediaRemotingStatus::kStarted;
if (!remoting_interstitial_) {
remoting_interstitial_ = new MediaRemotingInterstitial(*this);
@@ -504,9 +504,13 @@ void HTMLVideoElement::MediaRemotingStarted() {
}
void HTMLVideoElement::MediaRemotingStopped() {
- if (media_remoting_status_ != MediaRemotingStatus::kDisabled)
- media_remoting_status_ = MediaRemotingStatus::kNotStarted;
+ // Early return because this was already called when media remoting was
+ // disabled.
+ if (media_remoting_status_ == MediaRemotingStatus::kDisabled)
+ return;
+ DCHECK(media_remoting_status_ == MediaRemotingStatus::kStarted);
DCHECK(remoting_interstitial_);
+ media_remoting_status_ = MediaRemotingStatus::kNotStarted;
remoting_interstitial_->Hide();
}

Powered by Google App Engine
This is Rietveld 408576698