Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 #include "core/html/shadow/MediaControls.h" | 52 #include "core/html/shadow/MediaControls.h" |
| 53 #include "core/html/track/AudioTrack.h" | 53 #include "core/html/track/AudioTrack.h" |
| 54 #include "core/html/track/AudioTrackList.h" | 54 #include "core/html/track/AudioTrackList.h" |
| 55 #include "core/html/track/AutomaticTrackSelection.h" | 55 #include "core/html/track/AutomaticTrackSelection.h" |
| 56 #include "core/html/track/CueTimeline.h" | 56 #include "core/html/track/CueTimeline.h" |
| 57 #include "core/html/track/InbandTextTrack.h" | 57 #include "core/html/track/InbandTextTrack.h" |
| 58 #include "core/html/track/TextTrackContainer.h" | 58 #include "core/html/track/TextTrackContainer.h" |
| 59 #include "core/html/track/TextTrackList.h" | 59 #include "core/html/track/TextTrackList.h" |
| 60 #include "core/html/track/VideoTrack.h" | 60 #include "core/html/track/VideoTrack.h" |
| 61 #include "core/html/track/VideoTrackList.h" | 61 #include "core/html/track/VideoTrackList.h" |
| 62 #include "core/inspector/ConsoleMessage.h" | |
| 62 #include "core/layout/LayoutVideo.h" | 63 #include "core/layout/LayoutVideo.h" |
| 63 #include "core/layout/LayoutView.h" | 64 #include "core/layout/LayoutView.h" |
| 64 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" | 65 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" |
| 65 #include "core/loader/FrameLoader.h" | 66 #include "core/loader/FrameLoader.h" |
| 66 #include "platform/ContentType.h" | 67 #include "platform/ContentType.h" |
| 67 #include "platform/Logging.h" | 68 #include "platform/Logging.h" |
| 68 #include "platform/MIMETypeFromURL.h" | 69 #include "platform/MIMETypeFromURL.h" |
| 69 #include "platform/MIMETypeRegistry.h" | 70 #include "platform/MIMETypeRegistry.h" |
| 70 #include "platform/RuntimeEnabledFeatures.h" | 71 #include "platform/RuntimeEnabledFeatures.h" |
| 71 #include "platform/UserGestureIndicator.h" | 72 #include "platform/UserGestureIndicator.h" |
| (...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1907 { | 1908 { |
| 1908 return autoplay() ? MediaPlayer::Auto : m_preload; | 1909 return autoplay() ? MediaPlayer::Auto : m_preload; |
| 1909 } | 1910 } |
| 1910 | 1911 |
| 1911 void HTMLMediaElement::play() | 1912 void HTMLMediaElement::play() |
| 1912 { | 1913 { |
| 1913 WTF_LOG(Media, "HTMLMediaElement::play(%p)", this); | 1914 WTF_LOG(Media, "HTMLMediaElement::play(%p)", this); |
| 1914 | 1915 |
| 1915 if (!UserGestureIndicator::processingUserGesture()) { | 1916 if (!UserGestureIndicator::processingUserGesture()) { |
| 1916 autoplayMediaEncountered(); | 1917 autoplayMediaEncountered(); |
| 1917 if (m_userGestureRequiredForPlay) | 1918 if (m_userGestureRequiredForPlay) { |
| 1919 String message = ExceptionMessages::failedToExecute("play", "MediaEl ement", "API can only be initiated by a user gesture."); | |
|
philipj_slow
2015/06/04 08:16:38
This should say "HTMLMediaElement", there's no int
| |
| 1920 document().executionContext()->addConsoleMessage(ConsoleMessage::cre ate(JSMessageSource, WarningMessageLevel, message)); | |
| 1918 return; | 1921 return; |
| 1922 } | |
| 1919 } else if (m_userGestureRequiredForPlay) { | 1923 } else if (m_userGestureRequiredForPlay) { |
| 1920 if (m_autoplayMediaCounted) | 1924 if (m_autoplayMediaCounted) |
| 1921 recordAutoplayMetric(AutoplayManualStart); | 1925 recordAutoplayMetric(AutoplayManualStart); |
| 1922 m_userGestureRequiredForPlay = false; | 1926 m_userGestureRequiredForPlay = false; |
| 1923 } | 1927 } |
| 1924 | 1928 |
| 1925 playInternal(); | 1929 playInternal(); |
| 1926 } | 1930 } |
| 1927 | 1931 |
| 1928 void HTMLMediaElement::playInternal() | 1932 void HTMLMediaElement::playInternal() |
| (...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3660 | 3664 |
| 3661 #if ENABLE(WEB_AUDIO) | 3665 #if ENABLE(WEB_AUDIO) |
| 3662 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) | 3666 void HTMLMediaElement::clearWeakMembers(Visitor* visitor) |
| 3663 { | 3667 { |
| 3664 if (!Heap::isHeapObjectAlive(m_audioSourceNode) && audioSourceProvider()) | 3668 if (!Heap::isHeapObjectAlive(m_audioSourceNode) && audioSourceProvider()) |
| 3665 audioSourceProvider()->setClient(nullptr); | 3669 audioSourceProvider()->setClient(nullptr); |
| 3666 } | 3670 } |
| 3667 #endif | 3671 #endif |
| 3668 | 3672 |
| 3669 } | 3673 } |
| OLD | NEW |