| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 175 } |
| 176 | 176 |
| 177 void ScriptedAnimationController::enqueueEvent(Event* event) { | 177 void ScriptedAnimationController::enqueueEvent(Event* event) { |
| 178 InspectorInstrumentation::asyncTaskScheduled( | 178 InspectorInstrumentation::asyncTaskScheduled( |
| 179 event->target()->getExecutionContext(), event->type(), event); | 179 event->target()->getExecutionContext(), event->type(), event); |
| 180 m_eventQueue.push_back(event); | 180 m_eventQueue.push_back(event); |
| 181 scheduleAnimationIfNeeded(); | 181 scheduleAnimationIfNeeded(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void ScriptedAnimationController::enqueuePerFrameEvent(Event* event) { | 184 void ScriptedAnimationController::enqueuePerFrameEvent(Event* event) { |
| 185 if (!m_perFrameEvents.add(eventTargetKey(event)).isNewEntry) | 185 if (!m_perFrameEvents.insert(eventTargetKey(event)).isNewEntry) |
| 186 return; | 186 return; |
| 187 enqueueEvent(event); | 187 enqueueEvent(event); |
| 188 } | 188 } |
| 189 | 189 |
| 190 void ScriptedAnimationController::enqueueMediaQueryChangeListeners( | 190 void ScriptedAnimationController::enqueueMediaQueryChangeListeners( |
| 191 HeapVector<Member<MediaQueryListListener>>& listeners) { | 191 HeapVector<Member<MediaQueryListListener>>& listeners) { |
| 192 for (const auto& listener : listeners) { | 192 for (const auto& listener : listeners) { |
| 193 m_mediaQueryListListeners.add(listener); | 193 m_mediaQueryListListeners.insert(listener); |
| 194 } | 194 } |
| 195 scheduleAnimationIfNeeded(); | 195 scheduleAnimationIfNeeded(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void ScriptedAnimationController::scheduleAnimationIfNeeded() { | 198 void ScriptedAnimationController::scheduleAnimationIfNeeded() { |
| 199 if (!hasScheduledItems()) | 199 if (!hasScheduledItems()) |
| 200 return; | 200 return; |
| 201 | 201 |
| 202 if (!m_document) | 202 if (!m_document) |
| 203 return; | 203 return; |
| 204 | 204 |
| 205 if (FrameView* frameView = m_document->view()) | 205 if (FrameView* frameView = m_document->view()) |
| 206 frameView->scheduleAnimation(); | 206 frameView->scheduleAnimation(); |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace blink | 209 } // namespace blink |
| OLD | NEW |