OLD | NEW |
---|---|
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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
497 if (!remoting_interstitial_) { | 497 if (!remoting_interstitial_) { |
498 remoting_interstitial_ = new MediaRemotingInterstitial(*this); | 498 remoting_interstitial_ = new MediaRemotingInterstitial(*this); |
499 ShadowRoot& shadow_root = EnsureUserAgentShadowRoot(); | 499 ShadowRoot& shadow_root = EnsureUserAgentShadowRoot(); |
500 shadow_root.InsertBefore(remoting_interstitial_, shadow_root.FirstChild()); | 500 shadow_root.InsertBefore(remoting_interstitial_, shadow_root.FirstChild()); |
501 HTMLMediaElement::AssertShadowRootChildren(shadow_root); | 501 HTMLMediaElement::AssertShadowRootChildren(shadow_root); |
502 } | 502 } |
503 remoting_interstitial_->Show(); | 503 remoting_interstitial_->Show(); |
504 } | 504 } |
505 | 505 |
506 void HTMLVideoElement::MediaRemotingStopped() { | 506 void HTMLVideoElement::MediaRemotingStopped() { |
507 if (media_remoting_status_ != MediaRemotingStatus::kDisabled) | 507 // Early return because this was already called when media remoting was |
508 media_remoting_status_ = MediaRemotingStatus::kNotStarted; | 508 // disabled. |
509 if (media_remoting_status_ == MediaRemotingStatus::kDisabled) | |
510 return; | |
511 DCHECK_EQ(media_remoting_status_, MediaRemotingStatus::kStarted); | |
mlamouri (slow - plz ping)
2017/04/19 17:58:46
nit: swap the two parameters -- Also, I can't reme
xjz
2017/04/19 18:08:10
Done. Yes, MediaRemotingStatus is an enum class. C
| |
509 DCHECK(remoting_interstitial_); | 512 DCHECK(remoting_interstitial_); |
513 media_remoting_status_ = MediaRemotingStatus::kNotStarted; | |
510 remoting_interstitial_->Hide(); | 514 remoting_interstitial_->Hide(); |
511 } | 515 } |
512 | 516 |
513 void HTMLVideoElement::DisableMediaRemoting() { | 517 void HTMLVideoElement::DisableMediaRemoting() { |
514 if (GetWebMediaPlayer()) | 518 if (GetWebMediaPlayer()) |
515 GetWebMediaPlayer()->RequestRemotePlaybackDisabled(true); | 519 GetWebMediaPlayer()->RequestRemotePlaybackDisabled(true); |
516 media_remoting_status_ = MediaRemotingStatus::kDisabled; | 520 media_remoting_status_ = MediaRemotingStatus::kDisabled; |
517 MediaRemotingStopped(); | 521 MediaRemotingStopped(); |
518 } | 522 } |
519 | 523 |
520 } // namespace blink | 524 } // namespace blink |
OLD | NEW |