| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 3987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3998 } | 3998 } |
| 3999 | 3999 |
| 4000 DEFINE_STATIC_LOCAL(EnumerationHistogram, histogram, | 4000 DEFINE_STATIC_LOCAL(EnumerationHistogram, histogram, |
| 4001 ("Media.Controls.Show.Audio", MediaControlsShowMax)); | 4001 ("Media.Controls.Show.Audio", MediaControlsShowMax)); |
| 4002 return histogram; | 4002 return histogram; |
| 4003 } | 4003 } |
| 4004 | 4004 |
| 4005 void HTMLMediaElement::onVisibilityChangedForAutoplay(bool isVisible) { | 4005 void HTMLMediaElement::onVisibilityChangedForAutoplay(bool isVisible) { |
| 4006 if (!isVisible) | 4006 if (!isVisible) |
| 4007 return; | 4007 return; |
| 4008 // Visibility change might be notified after stopping the observer, as it is a | |
| 4009 // delayed task. Abort the steps if this happens. | |
| 4010 if (!m_autoplayVisibilityObserver) | |
| 4011 return; | |
| 4012 | 4008 |
| 4013 if (shouldAutoplay()) { | 4009 if (shouldAutoplay()) { |
| 4014 m_paused = false; | 4010 m_paused = false; |
| 4015 scheduleEvent(EventTypeNames::play); | 4011 scheduleEvent(EventTypeNames::play); |
| 4016 scheduleNotifyPlaying(); | 4012 scheduleNotifyPlaying(); |
| 4017 m_autoplaying = false; | 4013 m_autoplaying = false; |
| 4018 | 4014 |
| 4019 updatePlayState(); | 4015 updatePlayState(); |
| 4020 } | 4016 } |
| 4021 | 4017 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4132 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4128 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
| 4133 } | 4129 } |
| 4134 | 4130 |
| 4135 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { | 4131 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { |
| 4136 m_mostlyFillingViewport = true; | 4132 m_mostlyFillingViewport = true; |
| 4137 if (m_webMediaPlayer) | 4133 if (m_webMediaPlayer) |
| 4138 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); | 4134 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); |
| 4139 } | 4135 } |
| 4140 | 4136 |
| 4141 } // namespace blink | 4137 } // namespace blink |
| OLD | NEW |