Chromium Code Reviews| 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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 485 return ScriptPromise(); | 485 return ScriptPromise(); |
| 486 if (!ImageBitmap::IsResizeOptionValid(options, exception_state)) | 486 if (!ImageBitmap::IsResizeOptionValid(options, exception_state)) |
| 487 return ScriptPromise(); | 487 return ScriptPromise(); |
| 488 return ImageBitmapSource::FulfillImageBitmap( | 488 return ImageBitmapSource::FulfillImageBitmap( |
| 489 script_state, ImageBitmap::Create( | 489 script_state, ImageBitmap::Create( |
| 490 this, crop_rect, | 490 this, crop_rect, |
| 491 event_target.ToLocalDOMWindow()->document(), options)); | 491 event_target.ToLocalDOMWindow()->document(), options)); |
| 492 } | 492 } |
| 493 | 493 |
| 494 void HTMLVideoElement::MediaRemotingStarted() { | 494 void HTMLVideoElement::MediaRemotingStarted() { |
| 495 DCHECK_EQ(media_remoting_status_, MediaRemotingStatus::kNotStarted); | 495 DCHECK(media_remoting_status_ == MediaRemotingStatus::kNotStarted); |
| 496 media_remoting_status_ = MediaRemotingStatus::kStarted; | 496 media_remoting_status_ = MediaRemotingStatus::kStarted; |
| 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(media_remoting_status_ == MediaRemotingStatus::kStarted); | |
| 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(); |
|
whywhat
2017/05/18 16:31:36
This line seems to be either out of order or obsol
xjz
2017/05/18 18:37:23
Yes, you are right. This call does nothing. With a
| |
| 518 } | 522 } |
| 519 | 523 |
| 520 } // namespace blink | 524 } // namespace blink |
| OLD | NEW |