Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Unified Diff: cc/animation/animation_host.cc

Issue 1973083002: Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: cc/animation/animation_host.cc
diff --git a/cc/animation/animation_host.cc b/cc/animation/animation_host.cc
index f03ae70a2d989a99ed30b9d67da7e27c0ea04e05..1bc8f2d980cd806e41c750682f0bfa98236aaa97 100644
--- a/cc/animation/animation_host.cc
+++ b/cc/animation/animation_host.cc
@@ -217,7 +217,8 @@ void AnimationHost::PushPropertiesToImplThread(AnimationHost* host_impl) {
scoped_refptr<ElementAnimations>
AnimationHost::GetElementAnimationsForElementId(ElementId element_id) const {
- DCHECK(element_id);
+ if (!element_id)
+ return nullptr;
auto iter = element_to_animations_map_.find(element_id);
return iter == element_to_animations_map_.end() ? nullptr : iter->second;
}
@@ -283,14 +284,14 @@ void AnimationHost::SetAnimationEvents(
std::unique_ptr<AnimationEvents> events) {
for (size_t event_index = 0; event_index < events->events_.size();
++event_index) {
- int event_layer_id = events->events_[event_index].element_id;
+ ElementId element_id = events->events_[event_index].element_id;
// Use the map of all ElementAnimations, not just active ones, since
// non-active ElementAnimations may still receive events for impl-only
// animations.
const ElementToAnimationsMap& all_element_animations =
element_to_animations_map_;
- auto iter = all_element_animations.find(event_layer_id);
+ auto iter = all_element_animations.find(element_id);
if (iter != all_element_animations.end()) {
switch (events->events_[event_index].type) {
case AnimationEvent::STARTED:

Powered by Google App Engine
This is Rietveld 408576698