Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| index a43e6d66f8ee0b4559685b200eeaa299fc9e97a8..caa74795f478b099fb9287f3227341133efff92a 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp |
| @@ -4005,6 +4005,10 @@ EnumerationHistogram& HTMLMediaElement::showControlsHistogram() const { |
| void HTMLMediaElement::onVisibilityChangedForAutoplay(bool isVisible) { |
| if (!isVisible) |
| return; |
| + // Visibility change might be notified after stopping the observer, as it is a |
| + // delayed task. Abort the steps if this happens. |
| + if (!m_autoplayVisibilityObserver) |
| + return; |
|
mlamouri (slow - plz ping)
2017/02/06 12:55:43
Why should we early return here? Shouldn't we inst
Zhiqiang Zhang (Slow)
2017/02/06 14:17:14
I think we should assume visibility change will ne
mlamouri (slow - plz ping)
2017/02/07 12:36:27
I see. That makes sense :)
|
| if (shouldAutoplay()) { |
| m_paused = false; |