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

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

Issue 1329853004: Include viewport visibility checks for autoplay experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@autoplay_step1
Patch Set: Rebased onto merged blink repo. Created 5 years, 2 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 void scheduleEvent(PassRefPtrWillBeRawPtr<Event>); 258 void scheduleEvent(PassRefPtrWillBeRawPtr<Event>);
259 void scheduleTimeupdateEvent(bool periodicEvent); 259 void scheduleTimeupdateEvent(bool periodicEvent);
260 260
261 // Returns the "effective media volume" value as specified in the HTML5 spec . 261 // Returns the "effective media volume" value as specified in the HTML5 spec .
262 double effectiveMediaVolume() const; 262 double effectiveMediaVolume() const;
263 263
264 // Predicates also used when dispatching wrapper creation (cf. [SpecialWrapF or] IDL attribute usage.) 264 // Predicates also used when dispatching wrapper creation (cf. [SpecialWrapF or] IDL attribute usage.)
265 virtual bool isHTMLAudioElement() const { return false; } 265 virtual bool isHTMLAudioElement() const { return false; }
266 virtual bool isHTMLVideoElement() const { return false; } 266 virtual bool isHTMLVideoElement() const { return false; }
267 267
268 // Temporary callback for crbug.com/487345,402044
269 void notifyPositionMayHaveChanged();
270
268 protected: 271 protected:
269 HTMLMediaElement(const QualifiedName&, Document&); 272 HTMLMediaElement(const QualifiedName&, Document&);
270 ~HTMLMediaElement() override; 273 ~HTMLMediaElement() override;
271 #if ENABLE(OILPAN) 274 #if ENABLE(OILPAN)
272 void dispose(); 275 void dispose();
273 #endif 276 #endif
274 277
275 void parseAttribute(const QualifiedName&, const AtomicString&) override; 278 void parseAttribute(const QualifiedName&, const AtomicString&) override;
276 void finishParsingChildren() final; 279 void finishParsingChildren() final;
277 bool isURLAttribute(const Attribute&) const override; 280 bool isURLAttribute(const Attribute&) const override;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 void selectInitialTracksIfNecessary(); 458 void selectInitialTracksIfNecessary();
456 459
457 // Return true if and only if we require a user gesture before letting 460 // Return true if and only if we require a user gesture before letting
458 // the media play. 461 // the media play.
459 bool isUserGestureRequiredForPlay() const; 462 bool isUserGestureRequiredForPlay() const;
460 void removeUserGestureRequirement(); 463 void removeUserGestureRequirement();
461 void setInitialPlayWithoutUserGestures(bool); 464 void setInitialPlayWithoutUserGestures(bool);
462 465
463 void audioTracksTimerFired(Timer<HTMLMediaElement>*); 466 void audioTracksTimerFired(Timer<HTMLMediaElement>*);
464 467
468 // For tests.
469 void triggerAutoplayViewportCheck();
470
465 Timer<HTMLMediaElement> m_loadTimer; 471 Timer<HTMLMediaElement> m_loadTimer;
466 Timer<HTMLMediaElement> m_progressEventTimer; 472 Timer<HTMLMediaElement> m_progressEventTimer;
467 Timer<HTMLMediaElement> m_playbackProgressTimer; 473 Timer<HTMLMediaElement> m_playbackProgressTimer;
468 Timer<HTMLMediaElement> m_audioTracksTimer; 474 Timer<HTMLMediaElement> m_audioTracksTimer;
469 PersistentWillBeMember<TimeRanges> m_playedTimeRanges; 475 PersistentWillBeMember<TimeRanges> m_playedTimeRanges;
470 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; 476 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue;
471 477
472 double m_playbackRate; 478 double m_playbackRate;
473 double m_defaultPlaybackRate; 479 double m_defaultPlaybackRate;
474 NetworkState m_networkState; 480 NetworkState m_networkState;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 inline bool isHTMLMediaElement(const HTMLElement& element) 650 inline bool isHTMLMediaElement(const HTMLElement& element)
645 { 651 {
646 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 652 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
647 } 653 }
648 654
649 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 655 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
650 656
651 } // namespace blink 657 } // namespace blink
652 658
653 #endif // HTMLMediaElement_h 659 #endif // HTMLMediaElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698