Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.h

Issue 2245613002: Revert "Simplify ElementVisibilityObserver implementation." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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"
34 #include "core/dom/ExceptionCode.h" 33 #include "core/dom/ExceptionCode.h"
35 #include "core/events/GenericEventQueue.h" 34 #include "core/events/GenericEventQueue.h"
36 #include "core/html/AutoplayExperimentHelper.h" 35 #include "core/html/AutoplayExperimentHelper.h"
37 #include "core/html/HTMLElement.h" 36 #include "core/html/HTMLElement.h"
38 #include "core/html/track/TextTrack.h" 37 #include "core/html/track/TextTrack.h"
39 #include "platform/Supplementable.h" 38 #include "platform/Supplementable.h"
40 #include "platform/audio/AudioSourceProvider.h" 39 #include "platform/audio/AudioSourceProvider.h"
41 #include "public/platform/WebAudioSourceProviderClient.h" 40 #include "public/platform/WebAudioSourceProviderClient.h"
42 #include "public/platform/WebMediaPlayerClient.h" 41 #include "public/platform/WebMediaPlayerClient.h"
43 #include "public/platform/WebMimeRegistry.h" 42 #include "public/platform/WebMimeRegistry.h"
(...skipping 20 matching lines...) Expand all
64 class TextTrackContainer; 63 class TextTrackContainer;
65 class TextTrackList; 64 class TextTrackList;
66 class TimeRanges; 65 class TimeRanges;
67 class URLRegistry; 66 class URLRegistry;
68 class VideoTrackList; 67 class VideoTrackList;
69 class WebAudioSourceProvider; 68 class WebAudioSourceProvider;
70 class WebInbandTextTrack; 69 class WebInbandTextTrack;
71 class WebLayer; 70 class WebLayer;
72 class WebRemotePlaybackClient; 71 class WebRemotePlaybackClient;
73 72
74 class CORE_EXPORT HTMLMediaElement : public HTMLElement, public Supplementable<H TMLMediaElement>, public ActiveScriptWrappable, public ActiveDOMObject, private WebMediaPlayerClient, private ElementVisibilityObserver::Client { 73 class CORE_EXPORT HTMLMediaElement : public HTMLElement, public Supplementable<H TMLMediaElement>, public ActiveScriptWrappable, public ActiveDOMObject, private WebMediaPlayerClient {
75 DEFINE_WRAPPERTYPEINFO(); 74 DEFINE_WRAPPERTYPEINFO();
76 USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement); 75 USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement);
77 USING_PRE_FINALIZER(HTMLMediaElement, dispose); 76 USING_PRE_FINALIZER(HTMLMediaElement, dispose);
78 public: 77 public:
79 static WebMimeRegistry::SupportsType supportsType(const ContentType&); 78 static WebMimeRegistry::SupportsType supportsType(const ContentType&);
80 79
81 enum class RecordMetricsBehavior { 80 enum class RecordMetricsBehavior {
82 DoNotRecord, 81 DoNotRecord,
83 DoRecord 82 DoRecord
84 }; 83 };
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 void resolveScheduledPlayPromises(); 495 void resolveScheduledPlayPromises();
497 void rejectScheduledPlayPromises(); 496 void rejectScheduledPlayPromises();
498 void rejectPlayPromises(ExceptionCode, const String&); 497 void rejectPlayPromises(ExceptionCode, const String&);
499 void rejectPlayPromisesInternal(ExceptionCode, const String&); 498 void rejectPlayPromisesInternal(ExceptionCode, const String&);
500 499
501 EnumerationHistogram& showControlsHistogram() const; 500 EnumerationHistogram& showControlsHistogram() const;
502 501
503 void recordAutoplaySourceMetric(int source); 502 void recordAutoplaySourceMetric(int source);
504 void recordAutoplayUnmuteStatus(AutoplayUnmuteActionStatus); 503 void recordAutoplayUnmuteStatus(AutoplayUnmuteActionStatus);
505 504
506 // ElementVisibilityObserver::Client implementation 505 void onVisibilityChangedForAutoplay(bool isVisible);
507 void onVisibilityChanged(bool isVisible) override;
508 ExecutionContext* getElementVisibilityExecutionContext() const override { re turn getExecutionContext(); }
509 506
510 UnthrottledThreadTimer<HTMLMediaElement> m_loadTimer; 507 UnthrottledThreadTimer<HTMLMediaElement> m_loadTimer;
511 UnthrottledThreadTimer<HTMLMediaElement> m_progressEventTimer; 508 UnthrottledThreadTimer<HTMLMediaElement> m_progressEventTimer;
512 UnthrottledThreadTimer<HTMLMediaElement> m_playbackProgressTimer; 509 UnthrottledThreadTimer<HTMLMediaElement> m_playbackProgressTimer;
513 UnthrottledThreadTimer<HTMLMediaElement> m_audioTracksTimer; 510 UnthrottledThreadTimer<HTMLMediaElement> m_audioTracksTimer;
514 Member<TimeRanges> m_playedTimeRanges; 511 Member<TimeRanges> m_playedTimeRanges;
515 Member<GenericEventQueue> m_asyncEventQueue; 512 Member<GenericEventQueue> m_asyncEventQueue;
516 513
517 double m_playbackRate; 514 double m_playbackRate;
518 double m_defaultPlaybackRate; 515 double m_defaultPlaybackRate;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 inline bool isHTMLMediaElement(const HTMLElement& element) 690 inline bool isHTMLMediaElement(const HTMLElement& element)
694 { 691 {
695 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 692 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
696 } 693 }
697 694
698 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 695 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
699 696
700 } // namespace blink 697 } // namespace blink
701 698
702 #endif // HTMLMediaElement_h 699 #endif // HTMLMediaElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/IntersectionObserver.h ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698