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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 if (!remoting_interstitial_) { 501 if (!remoting_interstitial_) {
502 remoting_interstitial_ = new MediaRemotingInterstitial(*this); 502 remoting_interstitial_ = new MediaRemotingInterstitial(*this);
503 ShadowRoot& shadow_root = EnsureUserAgentShadowRoot(); 503 ShadowRoot& shadow_root = EnsureUserAgentShadowRoot();
504 shadow_root.InsertBefore(remoting_interstitial_, shadow_root.firstChild()); 504 shadow_root.InsertBefore(remoting_interstitial_, shadow_root.firstChild());
505 HTMLMediaElement::AssertShadowRootChildren(shadow_root); 505 HTMLMediaElement::AssertShadowRootChildren(shadow_root);
506 } 506 }
507 remoting_interstitial_->Show(); 507 remoting_interstitial_->Show();
508 } 508 }
509 509
510 void HTMLVideoElement::MediaRemotingStopped() { 510 void HTMLVideoElement::MediaRemotingStopped() {
511 // Early return because this was already called when media remoting was 511 DCHECK(media_remoting_status_ == MediaRemotingStatus::kDisabled ||
512 // disabled. 512 media_remoting_status_ == MediaRemotingStatus::kStarted);
513 if (media_remoting_status_ == MediaRemotingStatus::kDisabled) 513 if (media_remoting_status_ != MediaRemotingStatus::kDisabled)
514 return; 514 media_remoting_status_ = MediaRemotingStatus::kNotStarted;
515 DCHECK(media_remoting_status_ == MediaRemotingStatus::kStarted);
516 DCHECK(remoting_interstitial_); 515 DCHECK(remoting_interstitial_);
517 media_remoting_status_ = MediaRemotingStatus::kNotStarted;
518 remoting_interstitial_->Hide(); 516 remoting_interstitial_->Hide();
519 } 517 }
520 518
521 void HTMLVideoElement::DisableMediaRemoting() { 519 void HTMLVideoElement::DisableMediaRemoting() {
520 media_remoting_status_ = MediaRemotingStatus::kDisabled;
522 if (GetWebMediaPlayer()) 521 if (GetWebMediaPlayer())
523 GetWebMediaPlayer()->RequestRemotePlaybackDisabled(true); 522 GetWebMediaPlayer()->RequestRemotePlaybackDisabled(true);
524 media_remoting_status_ = MediaRemotingStatus::kDisabled;
525 MediaRemotingStopped();
526 } 523 }
527 524
528 } // namespace blink 525 } // namespace blink
OLDNEW
« 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