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

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

Issue 2896453002: Remove redundant call and early check when media remoting is disabled. (Closed)
Patch Set: Addressed comments. Created 3 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a3466a06728f0d90d5f9c40b17fdf6c67cb4c2d1..5e6d31b0c86c7203827f4ac7a40af122e48ea30b 100644
--- a/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLVideoElement.cpp
@@ -508,21 +508,18 @@ void HTMLVideoElement::MediaRemotingStarted() {
}
void HTMLVideoElement::MediaRemotingStopped() {
- // 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(media_remoting_status_ == MediaRemotingStatus::kDisabled ||
+ media_remoting_status_ == MediaRemotingStatus::kStarted);
+ if (media_remoting_status_ != MediaRemotingStatus::kDisabled)
+ media_remoting_status_ = MediaRemotingStatus::kNotStarted;
DCHECK(remoting_interstitial_);
- media_remoting_status_ = MediaRemotingStatus::kNotStarted;
remoting_interstitial_->Hide();
}
void HTMLVideoElement::DisableMediaRemoting() {
+ media_remoting_status_ = MediaRemotingStatus::kDisabled;
if (GetWebMediaPlayer())
GetWebMediaPlayer()->RequestRemotePlaybackDisabled(true);
- media_remoting_status_ = MediaRemotingStatus::kDisabled;
- MediaRemotingStopped();
}
} // namespace blink
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698