Chromium Code Reviews| 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 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 421 m_readyStateMaximum(kHaveNothing), | 421 m_readyStateMaximum(kHaveNothing), |
| 422 m_volume(1.0f), | 422 m_volume(1.0f), |
| 423 m_lastSeekTime(0), | 423 m_lastSeekTime(0), |
| 424 m_previousProgressTime(std::numeric_limits<double>::max()), | 424 m_previousProgressTime(std::numeric_limits<double>::max()), |
| 425 m_duration(std::numeric_limits<double>::quiet_NaN()), | 425 m_duration(std::numeric_limits<double>::quiet_NaN()), |
| 426 m_lastTimeUpdateEventWallTime(0), | 426 m_lastTimeUpdateEventWallTime(0), |
| 427 m_lastTimeUpdateEventMediaTime(std::numeric_limits<double>::quiet_NaN()), | 427 m_lastTimeUpdateEventMediaTime(std::numeric_limits<double>::quiet_NaN()), |
| 428 m_defaultPlaybackStartPosition(0), | 428 m_defaultPlaybackStartPosition(0), |
| 429 m_loadState(WaitingForSource), | 429 m_loadState(WaitingForSource), |
| 430 m_deferredLoadState(NotDeferred), | 430 m_deferredLoadState(NotDeferred), |
| 431 m_deferredLoadTimer(this, &HTMLMediaElement::deferredLoadTimerFired), | 431 m_deferredLoadTimer( |
| 432 TaskRunnerHelper::get(TaskType::Unthrottled, &document), | |
| 433 this, | |
| 434 &HTMLMediaElement::deferredLoadTimerFired), | |
| 432 m_webLayer(nullptr), | 435 m_webLayer(nullptr), |
| 433 m_displayMode(Unknown), | 436 m_displayMode(Unknown), |
| 434 m_officialPlaybackPosition(0), | 437 m_officialPlaybackPosition(0), |
| 435 m_officialPlaybackPositionNeedsUpdate(true), | 438 m_officialPlaybackPositionNeedsUpdate(true), |
| 436 m_fragmentEndTime(std::numeric_limits<double>::quiet_NaN()), | 439 m_fragmentEndTime(std::numeric_limits<double>::quiet_NaN()), |
| 437 m_pendingActionFlags(0), | 440 m_pendingActionFlags(0), |
| 438 m_lockedPendingUserGesture(false), | 441 m_lockedPendingUserGesture(false), |
| 439 m_lockedPendingUserGestureIfCrossOriginExperimentEnabled(true), | 442 m_lockedPendingUserGestureIfCrossOriginExperimentEnabled(true), |
| 440 m_playing(false), | 443 m_playing(false), |
| 441 m_shouldDelayLoadEvent(false), | 444 m_shouldDelayLoadEvent(false), |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 499 // doesn't get dispatched during the object destruction. | 502 // doesn't get dispatched during the object destruction. |
| 500 // See Document::isDelayingLoadEvent(). | 503 // See Document::isDelayingLoadEvent(). |
| 501 // Also see http://crbug.com/275223 for more details. | 504 // Also see http://crbug.com/275223 for more details. |
| 502 clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); | 505 clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); |
| 503 } | 506 } |
| 504 | 507 |
| 505 void HTMLMediaElement::didMoveToNewDocument(Document& oldDocument) { | 508 void HTMLMediaElement::didMoveToNewDocument(Document& oldDocument) { |
| 506 BLINK_MEDIA_LOG << "didMoveToNewDocument(" << (void*)this << ")"; | 509 BLINK_MEDIA_LOG << "didMoveToNewDocument(" << (void*)this << ")"; |
| 507 | 510 |
| 508 m_loadTimer.moveToNewTaskRunner( | 511 m_loadTimer.moveToNewTaskRunner( |
| 509 TaskRunnerHelper::get(TaskType::Unthrottled, &document())); | 512 TaskRunnerHelper::get(TaskType::MediaElementEvent, &document())); |
| 510 m_progressEventTimer.moveToNewTaskRunner( | 513 m_progressEventTimer.moveToNewTaskRunner( |
| 511 TaskRunnerHelper::get(TaskType::Unthrottled, &document())); | 514 TaskRunnerHelper::get(TaskType::MediaElementEvent, &document())); |
| 512 m_playbackProgressTimer.moveToNewTaskRunner( | 515 m_playbackProgressTimer.moveToNewTaskRunner( |
| 513 TaskRunnerHelper::get(TaskType::Unthrottled, &document())); | 516 TaskRunnerHelper::get(TaskType::MediaElementEvent, &document())); |
| 514 m_audioTracksTimer.moveToNewTaskRunner( | 517 m_audioTracksTimer.moveToNewTaskRunner( |
| 515 TaskRunnerHelper::get(TaskType::Unthrottled, &document())); | 518 TaskRunnerHelper::get(TaskType::MediaElementEvent, &document())); |
| 516 m_viewportFillDebouncerTimer.moveToNewTaskRunner( | 519 m_viewportFillDebouncerTimer.moveToNewTaskRunner( |
| 517 TaskRunnerHelper::get(TaskType::Unthrottled, &document())); | 520 TaskRunnerHelper::get(TaskType::MediaElementEvent, &document())); |
| 518 m_checkViewportIntersectionTimer.moveToNewTaskRunner( | 521 m_checkViewportIntersectionTimer.moveToNewTaskRunner( |
| 519 TaskRunnerHelper::get(TaskType::Unthrottled, &document())); | 522 TaskRunnerHelper::get(TaskType::MediaElementEvent, &document())); |
|
haraken
2017/02/27 07:50:45
Is this your intentional change? You're changing e
foolip
2017/02/27 15:39:08
Most of these changes are probably correct, but so
| |
| 523 m_deferredLoadTimer.moveToNewTaskRunner( | |
| 524 TaskRunnerHelper::get(TaskType::MediaElementEvent, &document())); | |
|
foolip
2017/02/27 15:39:08
At the m_deferredLoadTimer.startOneShot call site
| |
| 520 | 525 |
| 521 m_autoplayUmaHelper->didMoveToNewDocument(oldDocument); | 526 m_autoplayUmaHelper->didMoveToNewDocument(oldDocument); |
| 522 // If any experiment is enabled, then we want to enable a user gesture by | 527 // If any experiment is enabled, then we want to enable a user gesture by |
| 523 // default, otherwise the experiment does nothing. | 528 // default, otherwise the experiment does nothing. |
| 524 bool oldDocumentRequiresUserGesture = | 529 bool oldDocumentRequiresUserGesture = |
| 525 computeLockedPendingUserGesture(oldDocument); | 530 computeLockedPendingUserGesture(oldDocument); |
| 526 bool newDocumentRequiresUserGesture = | 531 bool newDocumentRequiresUserGesture = |
| 527 computeLockedPendingUserGesture(document()); | 532 computeLockedPendingUserGesture(document()); |
| 528 if (newDocumentRequiresUserGesture && !oldDocumentRequiresUserGesture) | 533 if (newDocumentRequiresUserGesture && !oldDocumentRequiresUserGesture) |
| 529 m_lockedPendingUserGesture = true; | 534 m_lockedPendingUserGesture = true; |
| (...skipping 3639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4169 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); | 4174 kMostlyFillViewportBecomeStableSeconds, BLINK_FROM_HERE); |
| 4170 } | 4175 } |
| 4171 | 4176 |
| 4172 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { | 4177 void HTMLMediaElement::viewportFillDebouncerTimerFired(TimerBase*) { |
| 4173 m_mostlyFillingViewport = true; | 4178 m_mostlyFillingViewport = true; |
| 4174 if (m_webMediaPlayer) | 4179 if (m_webMediaPlayer) |
| 4175 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); | 4180 m_webMediaPlayer->becameDominantVisibleContent(m_mostlyFillingViewport); |
| 4176 } | 4181 } |
| 4177 | 4182 |
| 4178 } // namespace blink | 4183 } // namespace blink |
| OLD | NEW |