Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 TRACE_EVENT0("webkit", "DocumentTimeline::serviceAnimations"); | 67 TRACE_EVENT0("webkit", "DocumentTimeline::serviceAnimations"); |
| 68 // FIXME: The below ASSERT fires on Windows when running chrome.exe. | 68 // FIXME: The below ASSERT fires on Windows when running chrome.exe. |
| 69 // Does not fire with --single-process, or on Linux, or in | 69 // Does not fire with --single-process, or on Linux, or in |
| 70 // content_shell.exe. The assert condition has been moved up into the | 70 // content_shell.exe. The assert condition has been moved up into the |
| 71 // outer 'if' to work around this. http://crbug.com/280439. | 71 // outer 'if' to work around this. http://crbug.com/280439. |
| 72 if (!isNull(m_zeroTimeAsPerfTime) && (m_currentTime <= monotonicAnimatio nStartTime - m_zeroTimeAsPerfTime)) { | 72 if (!isNull(m_zeroTimeAsPerfTime) && (m_currentTime <= monotonicAnimatio nStartTime - m_zeroTimeAsPerfTime)) { |
| 73 ASSERT(m_currentTime <= monotonicAnimationStartTime - m_zeroTimeAsPe rfTime); | 73 ASSERT(m_currentTime <= monotonicAnimationStartTime - m_zeroTimeAsPe rfTime); |
| 74 m_currentTime = monotonicAnimationStartTime - m_zeroTimeAsPerfTime; | 74 m_currentTime = monotonicAnimationStartTime - m_zeroTimeAsPerfTime; |
| 75 } | 75 } |
| 76 | 76 |
| 77 double timeToNextEffect = -1; | |
| 77 for (int i = m_players.size() - 1; i >= 0; --i) { | 78 for (int i = m_players.size() - 1; i >= 0; --i) { |
| 78 if (!m_players[i]->update()) | 79 if (!m_players[i]->update(&timeToNextEffect)) |
|
dstockwell
2013/10/21 01:51:31
We could just not pass a param here. But I guess t
| |
| 79 m_players.remove(i); | 80 m_players.remove(i); |
| 80 } | 81 } |
| 81 | 82 |
| 82 if (m_document->view() && !m_players.isEmpty()) | 83 if (m_document->view() && !m_players.isEmpty()) |
| 83 m_document->view()->scheduleAnimation(); | 84 m_document->view()->scheduleAnimation(); |
| 84 } | 85 } |
| 85 | 86 |
| 86 dispatchEvents(); | 87 dispatchEvents(); |
| 87 } | 88 } |
| 88 | 89 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 111 } | 112 } |
| 112 | 113 |
| 113 size_t DocumentTimeline::numberOfActiveAnimationsForTesting() const | 114 size_t DocumentTimeline::numberOfActiveAnimationsForTesting() const |
| 114 { | 115 { |
| 115 // Includes all players whose directly associated timed items | 116 // Includes all players whose directly associated timed items |
| 116 // are current or in effect. | 117 // are current or in effect. |
| 117 return isNull(m_currentTime) ? 0 : m_players.size(); | 118 return isNull(m_currentTime) ? 0 : m_players.size(); |
| 118 } | 119 } |
| 119 | 120 |
| 120 } // namespace | 121 } // namespace |
| OLD | NEW |