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

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

Issue 2141093003: Revert "Measure whether muted videos that started playing with play() become visible at some point" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 28 matching lines...) Expand all
39 #include "platform/audio/AudioSourceProvider.h" 39 #include "platform/audio/AudioSourceProvider.h"
40 #include "public/platform/WebAudioSourceProviderClient.h" 40 #include "public/platform/WebAudioSourceProviderClient.h"
41 #include "public/platform/WebMediaPlayerClient.h" 41 #include "public/platform/WebMediaPlayerClient.h"
42 #include "public/platform/WebMimeRegistry.h" 42 #include "public/platform/WebMimeRegistry.h"
43 #include <memory> 43 #include <memory>
44 44
45 namespace blink { 45 namespace blink {
46 46
47 class AudioSourceProviderClient; 47 class AudioSourceProviderClient;
48 class AudioTrackList; 48 class AudioTrackList;
49 class AutoplayUmaHelper;
50 class ContentType; 49 class ContentType;
51 class CueTimeline; 50 class CueTimeline;
52 class ElementVisibilityObserver; 51 class ElementVisibilityObserver;
53 class EnumerationHistogram; 52 class EnumerationHistogram;
54 class Event; 53 class Event;
55 class ExceptionState; 54 class ExceptionState;
56 class HTMLSourceElement; 55 class HTMLSourceElement;
57 class HTMLTrackElement; 56 class HTMLTrackElement;
58 class KURL; 57 class KURL;
59 class MediaControls; 58 class MediaControls;
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 void didMoveToNewDocument(Document& oldDocument) override; 291 void didMoveToNewDocument(Document& oldDocument) override;
293 virtual KURL posterImageURL() const { return KURL(); } 292 virtual KURL posterImageURL() const { return KURL(); }
294 293
295 enum DisplayMode { Unknown, Poster, Video }; 294 enum DisplayMode { Unknown, Poster, Video };
296 DisplayMode getDisplayMode() const { return m_displayMode; } 295 DisplayMode getDisplayMode() const { return m_displayMode; }
297 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } 296 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; }
298 297
299 void recordAutoplayMetric(AutoplayMetrics); 298 void recordAutoplayMetric(AutoplayMetrics);
300 299
301 private: 300 private:
301 // These values are used for histograms. Do not reorder.
302 enum AutoplayUnmuteActionStatus {
303 AutoplayUnmuteActionFailure = 0,
304 AutoplayUnmuteActionSuccess = 1,
305 AutoplayUnmuteActionMax
306 };
307
302 void resetMediaPlayerAndMediaSource(); 308 void resetMediaPlayerAndMediaSource();
303 309
304 bool alwaysCreateUserAgentShadowRoot() const final { return true; } 310 bool alwaysCreateUserAgentShadowRoot() const final { return true; }
305 bool areAuthorShadowsAllowed() const final { return false; } 311 bool areAuthorShadowsAllowed() const final { return false; }
306 312
307 bool supportsFocus() const final; 313 bool supportsFocus() const final;
308 bool isMouseFocusable() const final; 314 bool isMouseFocusable() const final;
309 bool layoutObjectIsNeeded(const ComputedStyle&) override; 315 bool layoutObjectIsNeeded(const ComputedStyle&) override;
310 LayoutObject* createLayoutObject(const ComputedStyle&) override; 316 LayoutObject* createLayoutObject(const ComputedStyle&) override;
311 InsertionNotificationRequest insertedInto(ContainerNode*) final; 317 InsertionNotificationRequest insertedInto(ContainerNode*) final;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 void scheduleResolvePlayPromises(); 492 void scheduleResolvePlayPromises();
487 void scheduleRejectPlayPromises(ExceptionCode); 493 void scheduleRejectPlayPromises(ExceptionCode);
488 void scheduleNotifyPlaying(); 494 void scheduleNotifyPlaying();
489 void resolveScheduledPlayPromises(); 495 void resolveScheduledPlayPromises();
490 void rejectScheduledPlayPromises(); 496 void rejectScheduledPlayPromises();
491 void rejectPlayPromises(ExceptionCode, const String&); 497 void rejectPlayPromises(ExceptionCode, const String&);
492 void rejectPlayPromisesInternal(ExceptionCode, const String&); 498 void rejectPlayPromisesInternal(ExceptionCode, const String&);
493 499
494 EnumerationHistogram& showControlsHistogram() const; 500 EnumerationHistogram& showControlsHistogram() const;
495 501
502 void recordAutoplaySourceMetric(int source);
503 void recordAutoplayUnmuteStatus(AutoplayUnmuteActionStatus);
504
496 void onVisibilityChangedForAutoplay(bool isVisible); 505 void onVisibilityChangedForAutoplay(bool isVisible);
497 506
498 UnthrottledTimer<HTMLMediaElement> m_loadTimer; 507 UnthrottledTimer<HTMLMediaElement> m_loadTimer;
499 UnthrottledTimer<HTMLMediaElement> m_progressEventTimer; 508 UnthrottledTimer<HTMLMediaElement> m_progressEventTimer;
500 UnthrottledTimer<HTMLMediaElement> m_playbackProgressTimer; 509 UnthrottledTimer<HTMLMediaElement> m_playbackProgressTimer;
501 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer; 510 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer;
502 Member<TimeRanges> m_playedTimeRanges; 511 Member<TimeRanges> m_playedTimeRanges;
503 Member<GenericEventQueue> m_asyncEventQueue; 512 Member<GenericEventQueue> m_asyncEventQueue;
504 513
505 double m_playbackRate; 514 double m_playbackRate;
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 671
663 class AutoplayHelperClientImpl; 672 class AutoplayHelperClientImpl;
664 673
665 friend class Internals; 674 friend class Internals;
666 friend class TrackDisplayUpdateScope; 675 friend class TrackDisplayUpdateScope;
667 friend class AutoplayExperimentHelper; 676 friend class AutoplayExperimentHelper;
668 friend class MediaControlsTest; 677 friend class MediaControlsTest;
669 678
670 Member<AutoplayExperimentHelper::Client> m_autoplayHelperClient; 679 Member<AutoplayExperimentHelper::Client> m_autoplayHelperClient;
671 Member<AutoplayExperimentHelper> m_autoplayHelper; 680 Member<AutoplayExperimentHelper> m_autoplayHelper;
672 Member<AutoplayUmaHelper> m_autoplayUmaHelper;
673 681
674 WebRemotePlaybackClient* m_remotePlaybackClient; 682 WebRemotePlaybackClient* m_remotePlaybackClient;
675 683
676 // class AutoplayVisibilityObserver; 684 // class AutoplayVisibilityObserver;
677 Member<ElementVisibilityObserver> m_autoplayVisibilityObserver; 685 Member<ElementVisibilityObserver> m_autoplayVisibilityObserver;
678 686
679 static URLRegistry* s_mediaStreamRegistry; 687 static URLRegistry* s_mediaStreamRegistry;
680 }; 688 };
681 689
682 inline bool isHTMLMediaElement(const HTMLElement& element) 690 inline bool isHTMLMediaElement(const HTMLElement& element)
683 { 691 {
684 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 692 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
685 } 693 }
686 694
687 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 695 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
688 696
689 } // namespace blink 697 } // namespace blink
690 698
691 #endif // HTMLMediaElement_h 699 #endif // HTMLMediaElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/AutoplayUmaHelper.cpp ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698