| OLD | NEW |
| 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } | 374 } |
| 375 | 375 |
| 376 void HTMLMediaElement::onMediaControlsEnabledChange(Document* document) { | 376 void HTMLMediaElement::onMediaControlsEnabledChange(Document* document) { |
| 377 auto it = documentToElementSetMap().find(document); | 377 auto it = documentToElementSetMap().find(document); |
| 378 if (it == documentToElementSetMap().end()) | 378 if (it == documentToElementSetMap().end()) |
| 379 return; | 379 return; |
| 380 DCHECK(it->value); | 380 DCHECK(it->value); |
| 381 WeakMediaElementSet& elements = *it->value; | 381 WeakMediaElementSet& elements = *it->value; |
| 382 for (const auto& element : elements) { | 382 for (const auto& element : elements) { |
| 383 element->updateControlsVisibility(); | 383 element->updateControlsVisibility(); |
| 384 element->mediaControls()->onMediaControlsEnabledChange(); | 384 if (element->mediaControls()) |
| 385 element->mediaControls()->onMediaControlsEnabledChange(); |
| 385 } | 386 } |
| 386 } | 387 } |
| 387 | 388 |
| 388 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, | 389 HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, |
| 389 Document& document) | 390 Document& document) |
| 390 : HTMLElement(tagName, document), | 391 : HTMLElement(tagName, document), |
| 391 SuspendableObject(&document), | 392 SuspendableObject(&document), |
| 392 m_loadTimer(TaskRunnerHelper::get(TaskType::Unthrottled, &document), | 393 m_loadTimer(TaskRunnerHelper::get(TaskType::Unthrottled, &document), |
| 393 this, | 394 this, |
| 394 &HTMLMediaElement::loadTimerFired), | 395 &HTMLMediaElement::loadTimerFired), |
| (...skipping 3774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4169 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4170 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
| 4170 } | 4171 } |
| 4171 | 4172 |
| 4172 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { | 4173 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { |
| 4173 m_mostlyFillingViewport = true; | 4174 m_mostlyFillingViewport = true; |
| 4174 if (m_webMediaPlayer) | 4175 if (m_webMediaPlayer) |
| 4175 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); | 4176 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); |
| 4176 } | 4177 } |
| 4177 | 4178 |
| 4178 } // namespace blink | 4179 } // namespace blink |
| OLD | NEW |