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

Side by Side Diff: Source/core/html/HTMLMediaElement.cpp

Issue 25516002: Remove npr.org quirk in HTMLMediaElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 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
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 , m_inActiveDocument(true) 276 , m_inActiveDocument(true)
277 , m_autoplaying(true) 277 , m_autoplaying(true)
278 , m_muted(false) 278 , m_muted(false)
279 , m_paused(true) 279 , m_paused(true)
280 , m_seeking(false) 280 , m_seeking(false)
281 , m_sentStalledEvent(false) 281 , m_sentStalledEvent(false)
282 , m_sentEndEvent(false) 282 , m_sentEndEvent(false)
283 , m_pausedInternal(false) 283 , m_pausedInternal(false)
284 , m_sendProgressEvents(true) 284 , m_sendProgressEvents(true)
285 , m_closedCaptionsVisible(false) 285 , m_closedCaptionsVisible(false)
286 , m_dispatchingCanPlayEvent(false)
287 , m_loadInitiatedByUserGesture(false) 286 , m_loadInitiatedByUserGesture(false)
288 , m_completelyLoaded(false) 287 , m_completelyLoaded(false)
289 , m_havePreparedToPlay(false) 288 , m_havePreparedToPlay(false)
290 , m_parsingInProgress(createdByParser) 289 , m_parsingInProgress(createdByParser)
291 , m_tracksAreReady(true) 290 , m_tracksAreReady(true)
292 , m_haveVisibleTextTrack(false) 291 , m_haveVisibleTextTrack(false)
293 , m_processingPreferenceChange(false) 292 , m_processingPreferenceChange(false)
294 , m_lastTextTrackUpdateTime(-1) 293 , m_lastTextTrackUpdateTime(-1)
295 , m_textTracks(0) 294 , m_textTracks(0)
296 , m_ignoreTrackDisplayUpdate(0) 295 , m_ignoreTrackDisplayUpdate(0)
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after
2149 2148
2150 void HTMLMediaElement::play() 2149 void HTMLMediaElement::play()
2151 { 2150 {
2152 LOG(Media, "HTMLMediaElement::play()"); 2151 LOG(Media, "HTMLMediaElement::play()");
2153 2152
2154 if (userGestureRequiredForRateChange() && !UserGestureIndicator::processingU serGesture()) 2153 if (userGestureRequiredForRateChange() && !UserGestureIndicator::processingU serGesture())
2155 return; 2154 return;
2156 if (UserGestureIndicator::processingUserGesture()) 2155 if (UserGestureIndicator::processingUserGesture())
2157 removeBehaviorsRestrictionsAfterFirstUserGesture(); 2156 removeBehaviorsRestrictionsAfterFirstUserGesture();
2158 2157
2159 Settings* settings = document().settings();
2160 if (settings && settings->needsSiteSpecificQuirks() && m_dispatchingCanPlayE vent && !m_loadInitiatedByUserGesture) {
2161 // It should be impossible to be processing the canplay event while hand ling a user gesture
2162 // since it is dispatched asynchronously.
2163 ASSERT(!UserGestureIndicator::processingUserGesture());
2164 String host = document().baseURL().host();
2165 if (host.endsWith(".npr.org", false) || equalIgnoringCase(host, "npr.org "))
2166 return;
2167 }
2168
2169 playInternal(); 2158 playInternal();
2170 } 2159 }
2171 2160
2172 void HTMLMediaElement::playInternal() 2161 void HTMLMediaElement::playInternal()
2173 { 2162 {
2174 LOG(Media, "HTMLMediaElement::playInternal"); 2163 LOG(Media, "HTMLMediaElement::playInternal");
2175 2164
2176 // 4.8.10.9. Playing the media resource 2165 // 4.8.10.9. Playing the media resource
2177 if (!m_player || m_networkState == NETWORK_EMPTY) 2166 if (!m_player || m_networkState == NETWORK_EMPTY)
2178 scheduleDelayedAction(LoadMediaResource); 2167 scheduleDelayedAction(LoadMediaResource);
(...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after
3895 if (hasMediaControls()) 3884 if (hasMediaControls())
3896 mediaControls()->setMediaController(m_mediaController ? m_mediaControlle r.get() : static_cast<MediaControllerInterface*>(this)); 3885 mediaControls()->setMediaController(m_mediaController ? m_mediaControlle r.get() : static_cast<MediaControllerInterface*>(this));
3897 } 3886 }
3898 3887
3899 void HTMLMediaElement::updateMediaController() 3888 void HTMLMediaElement::updateMediaController()
3900 { 3889 {
3901 if (m_mediaController) 3890 if (m_mediaController)
3902 m_mediaController->reportControllerState(); 3891 m_mediaController->reportControllerState();
3903 } 3892 }
3904 3893
3905 bool HTMLMediaElement::dispatchEvent(PassRefPtr<Event> event)
3906 {
3907 bool dispatchResult;
3908 bool isCanPlayEvent;
3909
3910 isCanPlayEvent = (event->type() == eventNames().canplayEvent);
3911
3912 if (isCanPlayEvent)
3913 m_dispatchingCanPlayEvent = true;
3914
3915 dispatchResult = HTMLElement::dispatchEvent(event);
3916
3917 if (isCanPlayEvent)
3918 m_dispatchingCanPlayEvent = false;
3919
3920 return dispatchResult;
3921 }
3922
3923 bool HTMLMediaElement::isBlocked() const 3894 bool HTMLMediaElement::isBlocked() const
3924 { 3895 {
3925 // A media element is a blocked media element if its readyState attribute is in the 3896 // A media element is a blocked media element if its readyState attribute is in the
3926 // HAVE_NOTHING state, the HAVE_METADATA state, or the HAVE_CURRENT_DATA sta te, 3897 // HAVE_NOTHING state, the HAVE_METADATA state, or the HAVE_CURRENT_DATA sta te,
3927 if (m_readyState <= HAVE_CURRENT_DATA) 3898 if (m_readyState <= HAVE_CURRENT_DATA)
3928 return true; 3899 return true;
3929 3900
3930 // or if the element has paused for user interaction. 3901 // or if the element has paused for user interaction.
3931 return pausedForUserInteraction(); 3902 return pausedForUserInteraction();
3932 } 3903 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
3997 { 3968 {
3998 m_restrictions = NoRestrictions; 3969 m_restrictions = NoRestrictions;
3999 } 3970 }
4000 3971
4001 void HTMLMediaElement::mediaPlayerScheduleLayerUpdate() 3972 void HTMLMediaElement::mediaPlayerScheduleLayerUpdate()
4002 { 3973 {
4003 scheduleLayerUpdate(); 3974 scheduleLayerUpdate();
4004 } 3975 }
4005 3976
4006 } 3977 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698