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 12 matching lines...) Expand all Loading... |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef HTMLMediaElement_h | 26 #ifndef HTMLMediaElement_h |
27 #define HTMLMediaElement_h | 27 #define HTMLMediaElement_h |
28 | 28 |
29 #include "bindings/core/v8/ActiveScriptWrappable.h" | 29 #include "bindings/core/v8/ActiveScriptWrappable.h" |
30 #include "bindings/core/v8/ScriptPromise.h" | 30 #include "bindings/core/v8/ScriptPromise.h" |
31 #include "core/CoreExport.h" | 31 #include "core/CoreExport.h" |
32 #include "core/dom/ActiveDOMObject.h" | 32 #include "core/dom/ActiveDOMObject.h" |
| 33 #include "core/dom/ElementVisibilityObserver.h" |
33 #include "core/dom/ExceptionCode.h" | 34 #include "core/dom/ExceptionCode.h" |
34 #include "core/events/GenericEventQueue.h" | 35 #include "core/events/GenericEventQueue.h" |
35 #include "core/html/AutoplayExperimentHelper.h" | 36 #include "core/html/AutoplayExperimentHelper.h" |
36 #include "core/html/HTMLElement.h" | 37 #include "core/html/HTMLElement.h" |
37 #include "core/html/track/TextTrack.h" | 38 #include "core/html/track/TextTrack.h" |
38 #include "platform/Supplementable.h" | 39 #include "platform/Supplementable.h" |
39 #include "platform/audio/AudioSourceProvider.h" | 40 #include "platform/audio/AudioSourceProvider.h" |
40 #include "public/platform/WebAudioSourceProviderClient.h" | 41 #include "public/platform/WebAudioSourceProviderClient.h" |
41 #include "public/platform/WebMediaPlayerClient.h" | 42 #include "public/platform/WebMediaPlayerClient.h" |
42 #include "public/platform/WebMimeRegistry.h" | 43 #include "public/platform/WebMimeRegistry.h" |
(...skipping 20 matching lines...) Expand all Loading... |
63 class TextTrackContainer; | 64 class TextTrackContainer; |
64 class TextTrackList; | 65 class TextTrackList; |
65 class TimeRanges; | 66 class TimeRanges; |
66 class URLRegistry; | 67 class URLRegistry; |
67 class VideoTrackList; | 68 class VideoTrackList; |
68 class WebAudioSourceProvider; | 69 class WebAudioSourceProvider; |
69 class WebInbandTextTrack; | 70 class WebInbandTextTrack; |
70 class WebLayer; | 71 class WebLayer; |
71 class WebRemotePlaybackClient; | 72 class WebRemotePlaybackClient; |
72 | 73 |
73 class CORE_EXPORT HTMLMediaElement : public HTMLElement, public Supplementable<H
TMLMediaElement>, public ActiveScriptWrappable, public ActiveDOMObject, private
WebMediaPlayerClient { | 74 class CORE_EXPORT HTMLMediaElement : public HTMLElement, public Supplementable<H
TMLMediaElement>, public ActiveScriptWrappable, public ActiveDOMObject, private
WebMediaPlayerClient, private ElementVisibilityObserver::Client { |
74 DEFINE_WRAPPERTYPEINFO(); | 75 DEFINE_WRAPPERTYPEINFO(); |
75 USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement); | 76 USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement); |
76 USING_PRE_FINALIZER(HTMLMediaElement, dispose); | 77 USING_PRE_FINALIZER(HTMLMediaElement, dispose); |
77 public: | 78 public: |
78 static WebMimeRegistry::SupportsType supportsType(const ContentType&); | 79 static WebMimeRegistry::SupportsType supportsType(const ContentType&); |
79 | 80 |
80 enum class RecordMetricsBehavior { | 81 enum class RecordMetricsBehavior { |
81 DoNotRecord, | 82 DoNotRecord, |
82 DoRecord | 83 DoRecord |
83 }; | 84 }; |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 void resolveScheduledPlayPromises(); | 496 void resolveScheduledPlayPromises(); |
496 void rejectScheduledPlayPromises(); | 497 void rejectScheduledPlayPromises(); |
497 void rejectPlayPromises(ExceptionCode, const String&); | 498 void rejectPlayPromises(ExceptionCode, const String&); |
498 void rejectPlayPromisesInternal(ExceptionCode, const String&); | 499 void rejectPlayPromisesInternal(ExceptionCode, const String&); |
499 | 500 |
500 EnumerationHistogram& showControlsHistogram() const; | 501 EnumerationHistogram& showControlsHistogram() const; |
501 | 502 |
502 void recordAutoplaySourceMetric(int source); | 503 void recordAutoplaySourceMetric(int source); |
503 void recordAutoplayUnmuteStatus(AutoplayUnmuteActionStatus); | 504 void recordAutoplayUnmuteStatus(AutoplayUnmuteActionStatus); |
504 | 505 |
505 void onVisibilityChangedForAutoplay(bool isVisible); | 506 // ElementVisibilityObserver::Client implementation |
| 507 void onVisibilityChanged(bool isVisible) override; |
| 508 ExecutionContext* getElementVisibilityExecutionContext() const override { re
turn getExecutionContext(); } |
506 | 509 |
507 UnthrottledTimer<HTMLMediaElement> m_loadTimer; | 510 UnthrottledTimer<HTMLMediaElement> m_loadTimer; |
508 UnthrottledTimer<HTMLMediaElement> m_progressEventTimer; | 511 UnthrottledTimer<HTMLMediaElement> m_progressEventTimer; |
509 UnthrottledTimer<HTMLMediaElement> m_playbackProgressTimer; | 512 UnthrottledTimer<HTMLMediaElement> m_playbackProgressTimer; |
510 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer; | 513 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer; |
511 Member<TimeRanges> m_playedTimeRanges; | 514 Member<TimeRanges> m_playedTimeRanges; |
512 Member<GenericEventQueue> m_asyncEventQueue; | 515 Member<GenericEventQueue> m_asyncEventQueue; |
513 | 516 |
514 double m_playbackRate; | 517 double m_playbackRate; |
515 double m_defaultPlaybackRate; | 518 double m_defaultPlaybackRate; |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 inline bool isHTMLMediaElement(const HTMLElement& element) | 693 inline bool isHTMLMediaElement(const HTMLElement& element) |
691 { | 694 { |
692 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 695 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
693 } | 696 } |
694 | 697 |
695 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 698 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
696 | 699 |
697 } // namespace blink | 700 } // namespace blink |
698 | 701 |
699 #endif // HTMLMediaElement_h | 702 #endif // HTMLMediaElement_h |
OLD | NEW |