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

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

Issue 2075563003: [Android, Media] Don't unlock MediaStream elements; instead allow MS to autoplay without a gesture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 // media element for unrestricted autoplay / script control. Don't confuse 455 // media element for unrestricted autoplay / script control. Don't confuse
456 // this with isGestureNeededForPlayback(). The latter is usually what one 456 // this with isGestureNeededForPlayback(). The latter is usually what one
457 // should use, if checking to see if an action is allowed. 457 // should use, if checking to see if an action is allowed.
458 bool isLockedPendingUserGesture() const; 458 bool isLockedPendingUserGesture() const;
459 459
460 // If the user gesture is required, then this will remove it. Note that 460 // If the user gesture is required, then this will remove it. Note that
461 // one should not generally call this method directly; use the one on 461 // one should not generally call this method directly; use the one on
462 // m_helper and give it a reason. 462 // m_helper and give it a reason.
463 void unlockUserGesture(); 463 void unlockUserGesture();
464 464
465 // Restores the user gesture requirement for the media element.
466 void lockUserGesture();
467
468 // Returns true if and only if the media element should require user
469 // gesture to unlock within the specified document.
470 bool needToLockPendingUserGesture(const Document&) const;
471
465 // Return true if and only if a user gesture is requried for playback. Even 472 // Return true if and only if a user gesture is requried for playback. Even
466 // if isLockedPendingUserGesture() return true, this might return false if 473 // if isLockedPendingUserGesture() return true, this might return false if
467 // the requirement is currently overridden. This does not check if a user 474 // the requirement is currently overridden. This does not check if a user
468 // gesture is currently being processed. 475 // gesture is currently being processed.
469 bool isGestureNeededForPlayback() const; 476 bool isGestureNeededForPlayback() const;
470 477
471 // Return true if and only if the settings allow autoplay of media on this 478 // Return true if and only if the settings allow autoplay of media on this
472 // frame. 479 // frame.
473 bool isAutoplayAllowedPerSettings() const; 480 bool isAutoplayAllowedPerSettings() const;
474 481
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 587
581 bool m_textTracksVisible : 1; 588 bool m_textTracksVisible : 1;
582 bool m_shouldPerformAutomaticTrackSelection : 1; 589 bool m_shouldPerformAutomaticTrackSelection : 1;
583 590
584 bool m_tracksAreReady : 1; 591 bool m_tracksAreReady : 1;
585 bool m_processingPreferenceChange : 1; 592 bool m_processingPreferenceChange : 1;
586 bool m_remoteRoutesAvailable : 1; 593 bool m_remoteRoutesAvailable : 1;
587 bool m_playingRemotely : 1; 594 bool m_playingRemotely : 1;
588 // Whether this element is in overlay fullscreen mode. 595 // Whether this element is in overlay fullscreen mode.
589 bool m_inOverlayFullscreenVideo : 1; 596 bool m_inOverlayFullscreenVideo : 1;
597 bool m_unlockedUserGestureForMediaStream : 1;
foolip 2016/06/22 15:25:56 more state bits :)
590 598
591 Member<AudioTrackList> m_audioTracks; 599 Member<AudioTrackList> m_audioTracks;
592 Member<VideoTrackList> m_videoTracks; 600 Member<VideoTrackList> m_videoTracks;
593 Member<TextTrackList> m_textTracks; 601 Member<TextTrackList> m_textTracks;
594 HeapVector<Member<TextTrack>> m_textTracksWhenResourceSelectionBegan; 602 HeapVector<Member<TextTrack>> m_textTracksWhenResourceSelectionBegan;
595 603
596 Member<CueTimeline> m_cueTimeline; 604 Member<CueTimeline> m_cueTimeline;
597 605
598 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers; 606 HeapVector<Member<ScriptPromiseResolver>> m_playPromiseResolvers;
599 OwnPtr<CancellableTaskFactory> m_playPromiseResolveTask; 607 OwnPtr<CancellableTaskFactory> m_playPromiseResolveTask;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 inline bool isHTMLMediaElement(const HTMLElement& element) 682 inline bool isHTMLMediaElement(const HTMLElement& element)
675 { 683 {
676 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 684 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
677 } 685 }
678 686
679 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 687 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
680 688
681 } // namespace blink 689 } // namespace blink
682 690
683 #endif // HTMLMediaElement_h 691 #endif // HTMLMediaElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698