| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 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 | 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 : m_document(document) | 46 : m_document(document) |
| 47 , m_nextCallbackId(0) | 47 , m_nextCallbackId(0) |
| 48 , m_suspendCount(0) | 48 , m_suspendCount(0) |
| 49 { | 49 { |
| 50 } | 50 } |
| 51 | 51 |
| 52 ScriptedAnimationController::~ScriptedAnimationController() | 52 ScriptedAnimationController::~ScriptedAnimationController() |
| 53 { | 53 { |
| 54 } | 54 } |
| 55 | 55 |
| 56 void ScriptedAnimationController::trace(Visitor* visitor) |
| 57 { |
| 58 visitor->trace(m_document); |
| 59 visitor->trace(m_eventQueue); |
| 60 #if ENABLE(OILPAN) |
| 61 visitor->trace(m_perFrameEvents); |
| 62 #endif |
| 63 } |
| 64 |
| 56 void ScriptedAnimationController::suspend() | 65 void ScriptedAnimationController::suspend() |
| 57 { | 66 { |
| 58 ++m_suspendCount; | 67 ++m_suspendCount; |
| 59 } | 68 } |
| 60 | 69 |
| 61 void ScriptedAnimationController::resume() | 70 void ScriptedAnimationController::resume() |
| 62 { | 71 { |
| 63 // It would be nice to put an ASSERT(m_suspendCount > 0) here, but in WK1 re
sume() can be called | 72 // It would be nice to put an ASSERT(m_suspendCount > 0) here, but in WK1 re
sume() can be called |
| 64 // even when suspend hasn't (if a tab was created in the background). | 73 // even when suspend hasn't (if a tab was created in the background). |
| 65 if (m_suspendCount > 0) | 74 if (m_suspendCount > 0) |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } | 170 } |
| 162 | 171 |
| 163 void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTime
Now) | 172 void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTime
Now) |
| 164 { | 173 { |
| 165 if (!m_callbacks.size() && !m_eventQueue.size()) | 174 if (!m_callbacks.size() && !m_eventQueue.size()) |
| 166 return; | 175 return; |
| 167 | 176 |
| 168 if (m_suspendCount) | 177 if (m_suspendCount) |
| 169 return; | 178 return; |
| 170 | 179 |
| 171 RefPtr<ScriptedAnimationController> protect(this); | 180 RefPtrWillBeRawPtr<ScriptedAnimationController> protect(this); |
| 172 | 181 |
| 173 dispatchEvents(); | 182 dispatchEvents(); |
| 174 executeCallbacks(monotonicTimeNow); | 183 executeCallbacks(monotonicTimeNow); |
| 175 | 184 |
| 176 scheduleAnimationIfNeeded(); | 185 scheduleAnimationIfNeeded(); |
| 177 } | 186 } |
| 178 | 187 |
| 179 void ScriptedAnimationController::enqueueEvent(PassRefPtrWillBeRawPtr<Event> eve
nt) | 188 void ScriptedAnimationController::enqueueEvent(PassRefPtrWillBeRawPtr<Event> eve
nt) |
| 180 { | 189 { |
| 181 InspectorInstrumentation::didEnqueueEvent(event->target(), event.get()); | 190 InspectorInstrumentation::didEnqueueEvent(event->target(), event.get()); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 199 return; | 208 return; |
| 200 | 209 |
| 201 if (!m_callbacks.size() && !m_eventQueue.size()) | 210 if (!m_callbacks.size() && !m_eventQueue.size()) |
| 202 return; | 211 return; |
| 203 | 212 |
| 204 if (FrameView* frameView = m_document->view()) | 213 if (FrameView* frameView = m_document->view()) |
| 205 frameView->scheduleAnimation(); | 214 frameView->scheduleAnimation(); |
| 206 } | 215 } |
| 207 | 216 |
| 208 } | 217 } |
| OLD | NEW |