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

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

Issue 2511143006: Detect change on the intersection of video and viewport. (Closed)
Patch Set: Addressed ojan's comments. Created 4 years 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 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 void scheduleNotifyPlaying(); 537 void scheduleNotifyPlaying();
538 void resolveScheduledPlayPromises(); 538 void resolveScheduledPlayPromises();
539 void rejectScheduledPlayPromises(); 539 void rejectScheduledPlayPromises();
540 void rejectPlayPromises(ExceptionCode, const String&); 540 void rejectPlayPromises(ExceptionCode, const String&);
541 void rejectPlayPromisesInternal(ExceptionCode, const String&); 541 void rejectPlayPromisesInternal(ExceptionCode, const String&);
542 542
543 EnumerationHistogram& showControlsHistogram() const; 543 EnumerationHistogram& showControlsHistogram() const;
544 544
545 void onVisibilityChangedForAutoplay(bool isVisible); 545 void onVisibilityChangedForAutoplay(bool isVisible);
546 546
547 void checkViewportIntersectionChanged();
548 void viewportFillDebouncerTimerFired(TimerBase*);
549
547 UnthrottledThreadTimer<HTMLMediaElement> m_loadTimer; 550 UnthrottledThreadTimer<HTMLMediaElement> m_loadTimer;
548 UnthrottledThreadTimer<HTMLMediaElement> m_progressEventTimer; 551 UnthrottledThreadTimer<HTMLMediaElement> m_progressEventTimer;
549 UnthrottledThreadTimer<HTMLMediaElement> m_playbackProgressTimer; 552 UnthrottledThreadTimer<HTMLMediaElement> m_playbackProgressTimer;
550 UnthrottledThreadTimer<HTMLMediaElement> m_audioTracksTimer; 553 UnthrottledThreadTimer<HTMLMediaElement> m_audioTracksTimer;
554 UnthrottledThreadTimer<HTMLMediaElement> m_viewportFillDebouncerTimer;
551 Member<TimeRanges> m_playedTimeRanges; 555 Member<TimeRanges> m_playedTimeRanges;
552 Member<GenericEventQueue> m_asyncEventQueue; 556 Member<GenericEventQueue> m_asyncEventQueue;
553 557
554 double m_playbackRate; 558 double m_playbackRate;
555 double m_defaultPlaybackRate; 559 double m_defaultPlaybackRate;
556 NetworkState m_networkState; 560 NetworkState m_networkState;
557 ReadyState m_readyState; 561 ReadyState m_readyState;
558 ReadyState m_readyStateMaximum; 562 ReadyState m_readyStateMaximum;
559 KURL m_currentSrc; 563 KURL m_currentSrc;
560 Member<MediaStreamDescriptor> m_srcObject; 564 Member<MediaStreamDescriptor> m_srcObject;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 644
641 bool m_textTracksVisible : 1; 645 bool m_textTracksVisible : 1;
642 bool m_shouldPerformAutomaticTrackSelection : 1; 646 bool m_shouldPerformAutomaticTrackSelection : 1;
643 647
644 bool m_tracksAreReady : 1; 648 bool m_tracksAreReady : 1;
645 bool m_processingPreferenceChange : 1; 649 bool m_processingPreferenceChange : 1;
646 bool m_playingRemotely : 1; 650 bool m_playingRemotely : 1;
647 // Whether this element is in overlay fullscreen mode. 651 // Whether this element is in overlay fullscreen mode.
648 bool m_inOverlayFullscreenVideo : 1; 652 bool m_inOverlayFullscreenVideo : 1;
649 653
654 bool m_mostlyFillingViewport : 1;
655
650 TraceWrapperMember<AudioTrackList> m_audioTracks; 656 TraceWrapperMember<AudioTrackList> m_audioTracks;
651 TraceWrapperMember<VideoTrackList> m_videoTracks; 657 TraceWrapperMember<VideoTrackList> m_videoTracks;
652 TraceWrapperMember<TextTrackList> m_textTracks; 658 TraceWrapperMember<TextTrackList> m_textTracks;
653 HeapVector<Member<TextTrack>> m_textTracksWhenResourceSelectionBegan; 659 HeapVector<Member<TextTrack>> m_textTracksWhenResourceSelectionBegan;
654 660
655 Member<CueTimeline> m_cueTimeline; 661 Member<CueTimeline> m_cueTimeline;
656 662
657 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers; 663 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers;
658 std::unique_ptr<CancellableTaskFactory> m_playPromiseResolveTask; 664 std::unique_ptr<CancellableTaskFactory> m_playPromiseResolveTask;
659 std::unique_ptr<CancellableTaskFactory> m_playPromiseRejectTask; 665 std::unique_ptr<CancellableTaskFactory> m_playPromiseRejectTask;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 730
725 Member<AutoplayExperimentHelper::Client> m_autoplayHelperClient; 731 Member<AutoplayExperimentHelper::Client> m_autoplayHelperClient;
726 Member<AutoplayExperimentHelper> m_autoplayHelper; 732 Member<AutoplayExperimentHelper> m_autoplayHelper;
727 Member<AutoplayUmaHelper> m_autoplayUmaHelper; 733 Member<AutoplayUmaHelper> m_autoplayUmaHelper;
728 734
729 WebRemotePlaybackClient* m_remotePlaybackClient; 735 WebRemotePlaybackClient* m_remotePlaybackClient;
730 736
731 // class AutoplayVisibilityObserver; 737 // class AutoplayVisibilityObserver;
732 Member<ElementVisibilityObserver> m_autoplayVisibilityObserver; 738 Member<ElementVisibilityObserver> m_autoplayVisibilityObserver;
733 739
740 IntRect m_currentIntersectRect;
741
734 static URLRegistry* s_mediaStreamRegistry; 742 static URLRegistry* s_mediaStreamRegistry;
735 }; 743 };
736 744
737 inline bool isHTMLMediaElement(const HTMLElement& element) { 745 inline bool isHTMLMediaElement(const HTMLElement& element) {
738 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 746 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
739 } 747 }
740 748
741 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 749 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
742 750
743 } // namespace blink 751 } // namespace blink
744 752
745 #endif // HTMLMediaElement_h 753 #endif // HTMLMediaElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698