Chromium Code Reviews| 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 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 822 | 822 |
| 823 DCHECK(!m_paused || m_playPromiseResolvers.isEmpty()); | 823 DCHECK(!m_paused || m_playPromiseResolvers.isEmpty()); |
| 824 | 824 |
| 825 // 4.6 - If the paused attribute is false, then run these substeps | 825 // 4.6 - If the paused attribute is false, then run these substeps |
| 826 if (!m_paused) { | 826 if (!m_paused) { |
| 827 // 4.6.1 - Set the paused attribute to true. | 827 // 4.6.1 - Set the paused attribute to true. |
| 828 m_paused = true; | 828 m_paused = true; |
| 829 | 829 |
| 830 // 4.6.2 - Take pending play promises and reject pending play promises | 830 // 4.6.2 - Take pending play promises and reject pending play promises |
| 831 // with the result and an "AbortError" DOMException. | 831 // with the result and an "AbortError" DOMException. |
| 832 if (!ScriptForbiddenScope::isScriptForbidden()) { | 832 rejectPlayPromises( |
| 833 rejectPlayPromises( | 833 AbortError, |
|
haraken
2017/01/21 01:51:09
I'm asking the question in https://codereview.chro
| |
| 834 AbortError, | 834 "The play() request was interrupted by a new load request."); |
| 835 "The play() request was interrupted by a new load request."); | |
| 836 } | |
| 837 } | 835 } |
| 838 | 836 |
| 839 // 4.7 - If seeking is true, set it to false. | 837 // 4.7 - If seeking is true, set it to false. |
| 840 m_seeking = false; | 838 m_seeking = false; |
| 841 | 839 |
| 842 // 4.8 - Set the current playback position to 0. | 840 // 4.8 - Set the current playback position to 0. |
| 843 // Set the official playback position to 0. | 841 // Set the official playback position to 0. |
| 844 // If this changed the official playback position, then queue a task | 842 // If this changed the official playback position, then queue a task |
| 845 // to fire a simple event named timeupdate at the media element. | 843 // to fire a simple event named timeupdate at the media element. |
| 846 // 4.9 - Set the initial playback position to 0. | 844 // 4.9 - Set the initial playback position to 0. |
| (...skipping 3281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4128 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4126 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
| 4129 } | 4127 } |
| 4130 | 4128 |
| 4131 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { | 4129 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { |
| 4132 m_mostlyFillingViewport = true; | 4130 m_mostlyFillingViewport = true; |
| 4133 if (m_webMediaPlayer) | 4131 if (m_webMediaPlayer) |
| 4134 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); | 4132 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); |
| 4135 } | 4133 } |
| 4136 | 4134 |
| 4137 } // namespace blink | 4135 } // namespace blink |
| OLD | NEW |