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

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

Issue 2567913002: Rename ActiveDOMObject to SuspendableObject (Closed)
Patch Set: Created 4 years 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 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 354
355 bool HTMLMediaElement::mediaTracksEnabledInternally() { 355 bool HTMLMediaElement::mediaTracksEnabledInternally() {
356 return RuntimeEnabledFeatures::audioVideoTracksEnabled() || 356 return RuntimeEnabledFeatures::audioVideoTracksEnabled() ||
357 RuntimeEnabledFeatures::backgroundVideoTrackOptimizationEnabled(); 357 RuntimeEnabledFeatures::backgroundVideoTrackOptimizationEnabled();
358 } 358 }
359 359
360 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, 360 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName,
361 Document& document) 361 Document& document)
362 : HTMLElement(tagName, document), 362 : HTMLElement(tagName, document),
363 ActiveScriptWrappable(this), 363 ActiveScriptWrappable(this),
364 ActiveDOMObject(&document), 364 SuspendableObject(&document),
365 m_loadTimer(this, &HTMLMediaElement::loadTimerFired), 365 m_loadTimer(this, &HTMLMediaElement::loadTimerFired),
366 m_progressEventTimer(this, &HTMLMediaElement::progressEventTimerFired), 366 m_progressEventTimer(this, &HTMLMediaElement::progressEventTimerFired),
367 m_playbackProgressTimer(this, 367 m_playbackProgressTimer(this,
368 &HTMLMediaElement::playbackProgressTimerFired), 368 &HTMLMediaElement::playbackProgressTimerFired),
369 m_audioTracksTimer(this, &HTMLMediaElement::audioTracksTimerFired), 369 m_audioTracksTimer(this, &HTMLMediaElement::audioTracksTimerFired),
370 m_viewportFillDebouncerTimer( 370 m_viewportFillDebouncerTimer(
371 this, 371 this,
372 &HTMLMediaElement::viewportFillDebouncerTimerFired), 372 &HTMLMediaElement::viewportFillDebouncerTimerFired),
373 m_playedTimeRanges(), 373 m_playedTimeRanges(),
374 m_asyncEventQueue(GenericEventQueue::create(this)), 374 m_asyncEventQueue(GenericEventQueue::create(this)),
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 // refresh the MediaPlayer's LocalFrame and FrameLoader references on document 493 // refresh the MediaPlayer's LocalFrame and FrameLoader references on document
494 // changes so that playback can be resumed properly. 494 // changes so that playback can be resumed properly.
495 m_ignorePreloadNone = false; 495 m_ignorePreloadNone = false;
496 invokeLoadAlgorithm(); 496 invokeLoadAlgorithm();
497 497
498 // Decrement the load event delay count on oldDocument now that 498 // Decrement the load event delay count on oldDocument now that
499 // m_webMediaPlayer has been destroyed and there is no risk of dispatching a 499 // m_webMediaPlayer has been destroyed and there is no risk of dispatching a
500 // load event from within the destructor. 500 // load event from within the destructor.
501 oldDocument.decrementLoadEventDelayCount(); 501 oldDocument.decrementLoadEventDelayCount();
502 502
503 ActiveDOMObject::didMoveToNewExecutionContext(&document()); 503 SuspendableObject::didMoveToNewExecutionContext(&document());
504 HTMLElement::didMoveToNewDocument(oldDocument); 504 HTMLElement::didMoveToNewDocument(oldDocument);
505 } 505 }
506 506
507 bool HTMLMediaElement::supportsFocus() const { 507 bool HTMLMediaElement::supportsFocus() const {
508 if (ownerDocument()->isMediaDocument()) 508 if (ownerDocument()->isMediaDocument())
509 return false; 509 return false;
510 510
511 // If no controls specified, we should still be able to focus the element if 511 // If no controls specified, we should still be able to focus the element if
512 // it has tabIndex. 512 // it has tabIndex.
513 return shouldShowControls() || HTMLElement::supportsFocus(); 513 return shouldShowControls() || HTMLElement::supportsFocus();
(...skipping 3217 matching lines...) Expand 10 before | Expand all | Expand 10 after
3731 visitor->trace(m_playPromiseRejectList); 3731 visitor->trace(m_playPromiseRejectList);
3732 visitor->trace(m_audioSourceProvider); 3732 visitor->trace(m_audioSourceProvider);
3733 visitor->trace(m_autoplayUmaHelper); 3733 visitor->trace(m_autoplayUmaHelper);
3734 visitor->trace(m_srcObject); 3734 visitor->trace(m_srcObject);
3735 visitor->trace(m_autoplayVisibilityObserver); 3735 visitor->trace(m_autoplayVisibilityObserver);
3736 visitor->template registerWeakMembers<HTMLMediaElement, 3736 visitor->template registerWeakMembers<HTMLMediaElement,
3737 &HTMLMediaElement::clearWeakMembers>( 3737 &HTMLMediaElement::clearWeakMembers>(
3738 this); 3738 this);
3739 Supplementable<HTMLMediaElement>::trace(visitor); 3739 Supplementable<HTMLMediaElement>::trace(visitor);
3740 HTMLElement::trace(visitor); 3740 HTMLElement::trace(visitor);
3741 ActiveDOMObject::trace(visitor); 3741 SuspendableObject::trace(visitor);
3742 } 3742 }
3743 3743
3744 DEFINE_TRACE_WRAPPERS(HTMLMediaElement) { 3744 DEFINE_TRACE_WRAPPERS(HTMLMediaElement) {
3745 visitor->traceWrappers(m_videoTracks); 3745 visitor->traceWrappers(m_videoTracks);
3746 visitor->traceWrappers(m_audioTracks); 3746 visitor->traceWrappers(m_audioTracks);
3747 visitor->traceWrappers(m_textTracks); 3747 visitor->traceWrappers(m_textTracks);
3748 HTMLElement::traceWrappers(visitor); 3748 HTMLElement::traceWrappers(visitor);
3749 } 3749 }
3750 3750
3751 void HTMLMediaElement::createPlaceholderTracksIfNecessary() { 3751 void HTMLMediaElement::createPlaceholderTracksIfNecessary() {
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
4065 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); 4065 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE);
4066 } 4066 }
4067 4067
4068 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { 4068 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) {
4069 m_mostlyFillingViewport = true; 4069 m_mostlyFillingViewport = true;
4070 if (m_webMediaPlayer) 4070 if (m_webMediaPlayer)
4071 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); 4071 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport);
4072 } 4072 }
4073 4073
4074 } // namespace blink 4074 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698