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

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

Issue 2091253002: When autoplaying muted video, record when unmute happen and the result. (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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 void didMoveToNewDocument(Document& oldDocument) override; 291 void didMoveToNewDocument(Document& oldDocument) override;
292 virtual KURL posterImageURL() const { return KURL(); } 292 virtual KURL posterImageURL() const { return KURL(); }
293 293
294 enum DisplayMode { Unknown, Poster, Video }; 294 enum DisplayMode { Unknown, Poster, Video };
295 DisplayMode getDisplayMode() const { return m_displayMode; } 295 DisplayMode getDisplayMode() const { return m_displayMode; }
296 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } 296 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; }
297 297
298 void recordAutoplayMetric(AutoplayMetrics); 298 void recordAutoplayMetric(AutoplayMetrics);
299 299
300 private: 300 private:
301 enum class AutoplayUnmuteStatus { Failure, Success };
whywhat 2016/06/28 10:20:59 nit: do we really need two enums for this? this on
mlamouri (slow - plz ping) 2016/06/28 13:58:27 I moved to one enum in the header used for histogr
302
301 void resetMediaPlayerAndMediaSource(); 303 void resetMediaPlayerAndMediaSource();
302 304
303 bool alwaysCreateUserAgentShadowRoot() const final { return true; } 305 bool alwaysCreateUserAgentShadowRoot() const final { return true; }
304 bool areAuthorShadowsAllowed() const final { return false; } 306 bool areAuthorShadowsAllowed() const final { return false; }
305 307
306 bool supportsFocus() const final; 308 bool supportsFocus() const final;
307 bool isMouseFocusable() const final; 309 bool isMouseFocusable() const final;
308 bool layoutObjectIsNeeded(const ComputedStyle&) override; 310 bool layoutObjectIsNeeded(const ComputedStyle&) override;
309 LayoutObject* createLayoutObject(const ComputedStyle&) override; 311 LayoutObject* createLayoutObject(const ComputedStyle&) override;
310 InsertionNotificationRequest insertedInto(ContainerNode*) final; 312 InsertionNotificationRequest insertedInto(ContainerNode*) final;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 void scheduleRejectPlayPromises(ExceptionCode); 487 void scheduleRejectPlayPromises(ExceptionCode);
486 void scheduleNotifyPlaying(); 488 void scheduleNotifyPlaying();
487 void resolveScheduledPlayPromises(); 489 void resolveScheduledPlayPromises();
488 void rejectScheduledPlayPromises(); 490 void rejectScheduledPlayPromises();
489 void rejectPlayPromises(ExceptionCode, const String&); 491 void rejectPlayPromises(ExceptionCode, const String&);
490 void rejectPlayPromisesInternal(ExceptionCode, const String&); 492 void rejectPlayPromisesInternal(ExceptionCode, const String&);
491 493
492 EnumerationHistogram& showControlsHistogram() const; 494 EnumerationHistogram& showControlsHistogram() const;
493 495
494 void recordAutoplaySourceMetric(int source); 496 void recordAutoplaySourceMetric(int source);
497 void recordAutoplayUnmuteStatus(AutoplayUnmuteStatus);
495 498
496 void onVisibilityChangedForAutoplay(bool isVisible); 499 void onVisibilityChangedForAutoplay(bool isVisible);
497 500
498 UnthrottledTimer<HTMLMediaElement> m_loadTimer; 501 UnthrottledTimer<HTMLMediaElement> m_loadTimer;
499 UnthrottledTimer<HTMLMediaElement> m_progressEventTimer; 502 UnthrottledTimer<HTMLMediaElement> m_progressEventTimer;
500 UnthrottledTimer<HTMLMediaElement> m_playbackProgressTimer; 503 UnthrottledTimer<HTMLMediaElement> m_playbackProgressTimer;
501 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer; 504 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer;
502 Member<TimeRanges> m_playedTimeRanges; 505 Member<TimeRanges> m_playedTimeRanges;
503 Member<GenericEventQueue> m_asyncEventQueue; 506 Member<GenericEventQueue> m_asyncEventQueue;
504 507
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 inline bool isHTMLMediaElement(const HTMLElement& element) 684 inline bool isHTMLMediaElement(const HTMLElement& element)
682 { 685 {
683 return isHTMLAudioElement(element) || isHTMLVideoElement(element); 686 return isHTMLAudioElement(element) || isHTMLVideoElement(element);
684 } 687 }
685 688
686 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); 689 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement);
687 690
688 } // namespace blink 691 } // namespace blink
689 692
690 #endif // HTMLMediaElement_h 693 #endif // HTMLMediaElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698