Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLMediaElement.h |
| diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.h b/third_party/WebKit/Source/core/html/HTMLMediaElement.h |
| index 0b731fbbd0c431616914cc58c7b831ad769ffcd3..5114949e5ed0664a88940223819fb1b54f85e1e0 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLMediaElement.h |
| +++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.h |
| @@ -26,11 +26,13 @@ |
| #ifndef HTMLMediaElement_h |
| #define HTMLMediaElement_h |
| +#include "bindings/core/v8/ScriptPromise.h" |
| #include "core/CoreExport.h" |
| #include "core/dom/ActiveDOMObject.h" |
| #include "core/events/GenericEventQueue.h" |
| #include "core/html/AutoplayExperimentHelper.h" |
| #include "core/html/HTMLElement.h" |
| +#include "core/html/MediaError.h" |
|
philipj_slow
2016/02/02 09:56:33
How about including DOMException.h and using Excep
mlamouri (slow - plz ping)
2016/02/03 19:28:58
Included ExceptionCode.h.
|
| #include "core/html/track/TextTrack.h" |
| #include "platform/Supplementable.h" |
| #include "platform/audio/AudioSourceProvider.h" |
| @@ -50,8 +52,8 @@ class HTMLSourceElement; |
| class HTMLTrackElement; |
| class KURL; |
| class MediaControls; |
| -class MediaError; |
| class HTMLMediaSource; |
| +class ScriptState; |
| class TextTrackContainer; |
| class TextTrackList; |
| class TimeRanges; |
| @@ -136,7 +138,9 @@ public: |
| bool shouldAutoplay(const RecordMetricsBehavior = RecordMetricsBehavior::DoNotRecord); |
| bool loop() const; |
| void setLoop(bool); |
| - void play(); |
| + ScriptPromise play(ScriptState*); |
| + // This does not check user gesture restrictions. |
| + void playInternal(); |
| void pause(); |
| void requestRemotePlayback(); |
| void requestRemotePlaybackControl(); |
| @@ -369,9 +373,6 @@ private: |
| void markCaptionAndSubtitleTracksAsUnconfigured(); |
| - // This does not check user gesture restrictions. |
| - void playInternal(); |
| - |
| // This does not change the buffering strategy. |
| void pauseInternal(); |
| @@ -445,6 +446,13 @@ private: |
| // TODO(liberato): remove once autoplay gesture override experiment concludes. |
| void triggerAutoplayViewportCheckForTesting(); |
| + void scheduleResolvePlayPromises(); |
| + void scheduleRejectPlayPromises(MediaError::Code); |
| + void scheduleNotifyPlaying(); |
| + |
| + void resolvePlayPromises(); |
| + void rejectPlayPromises(MediaError::Code); |
| + |
| UnthrottledTimer<HTMLMediaElement> m_loadTimer; |
| UnthrottledTimer<HTMLMediaElement> m_progressEventTimer; |
| UnthrottledTimer<HTMLMediaElement> m_playbackProgressTimer; |
| @@ -556,6 +564,8 @@ private: |
| OwnPtrWillBeMember<CueTimeline> m_cueTimeline; |
| + PersistentHeapVectorWillBeHeapVector<Member<ScriptPromiseResolver>> m_playResolvers; |
| + |
| // This is a weak reference, since m_audioSourceNode holds a reference to us. |
| // FIXME: Oilpan: Consider making this a strongly traced pointer with oilpan where strong cycles are not a problem. |
| GC_PLUGIN_IGNORE("http://crbug.com/404577") |