Chromium Code Reviews| Index: Source/core/html/HTMLMediaElement.cpp |
| diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp |
| index e1c3961c68b756d4b96bf7d23f996e93d3a0049f..85c4184f17470e656bb20187d762d23eff56b713 100644 |
| --- a/Source/core/html/HTMLMediaElement.cpp |
| +++ b/Source/core/html/HTMLMediaElement.cpp |
| @@ -261,6 +261,8 @@ enum AutoplayMetrics { |
| AutoplayManualStart = 3, |
| // Autoplay was (re)enabled through a user-gesture triggered load() |
| AutoplayEnabledThroughLoad = 4, |
| + // Autoplay disabled by sandbox flags. |
| + AutoplayDisableddBySandbox = 5, |
|
fs
2015/06/18 08:18:39
Drive-by nit: Disabledd
|
| // This enum value must be last. |
| NumberOfAutoplayMetrics, |
| }; |
| @@ -1536,9 +1538,12 @@ void HTMLMediaElement::setReadyState(ReadyState state) |
| scheduleEvent(EventTypeNames::playing); |
| } |
| - if (m_autoplaying && m_paused && autoplay() && !document().isSandboxed(SandboxAutomaticFeatures)) { |
| + if (m_autoplaying && m_paused && autoplay()) { |
| autoplayMediaEncountered(); |
| - if (!m_userGestureRequiredForPlay) { |
| + |
| + if (document().isSandboxed(SandboxAutomaticFeatures)) { |
| + recordAutoplayMetric(AutoplayDisableddBySandbox); |
| + } else if (!m_userGestureRequiredForPlay) { |
| m_paused = false; |
| invalidateCachedTime(); |
| scheduleEvent(EventTypeNames::play); |