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

Side by Side Diff: cc/animation/animation_registrar.cc

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « cc/animation/animation_registrar.h ('k') | cc/animation/animation_timeline.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/animation/animation_registrar.h" 5 #include "cc/animation/animation_registrar.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/memory/ptr_util.h"
9 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
10 #include "base/trace_event/trace_event_argument.h" 11 #include "base/trace_event/trace_event_argument.h"
11 #include "cc/animation/animation_events.h" 12 #include "cc/animation/animation_events.h"
12 #include "cc/animation/layer_animation_controller.h" 13 #include "cc/animation/layer_animation_controller.h"
13 14
14 namespace cc { 15 namespace cc {
15 16
16 AnimationRegistrar::AnimationRegistrar() : supports_scroll_animations_(false) { 17 AnimationRegistrar::AnimationRegistrar() : supports_scroll_animations_(false) {
17 } 18 }
18 19
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 93
93 TRACE_EVENT0("cc", "AnimationRegistrar::UpdateAnimationState"); 94 TRACE_EVENT0("cc", "AnimationRegistrar::UpdateAnimationState");
94 AnimationControllerMap active_controllers_copy = 95 AnimationControllerMap active_controllers_copy =
95 active_animation_controllers_; 96 active_animation_controllers_;
96 for (auto& it : active_controllers_copy) 97 for (auto& it : active_controllers_copy)
97 it.second->UpdateState(start_ready_animations, events); 98 it.second->UpdateState(start_ready_animations, events);
98 99
99 return true; 100 return true;
100 } 101 }
101 102
102 scoped_ptr<AnimationEvents> AnimationRegistrar::CreateEvents() { 103 std::unique_ptr<AnimationEvents> AnimationRegistrar::CreateEvents() {
103 return make_scoped_ptr(new AnimationEvents()); 104 return base::WrapUnique(new AnimationEvents());
104 } 105 }
105 106
106 void AnimationRegistrar::SetAnimationEvents( 107 void AnimationRegistrar::SetAnimationEvents(
107 scoped_ptr<AnimationEvents> events) { 108 std::unique_ptr<AnimationEvents> events) {
108 for (size_t event_index = 0; event_index < events->events_.size(); 109 for (size_t event_index = 0; event_index < events->events_.size();
109 ++event_index) { 110 ++event_index) {
110 int event_layer_id = events->events_[event_index].layer_id; 111 int event_layer_id = events->events_[event_index].layer_id;
111 112
112 // Use the map of all controllers, not just active ones, since non-active 113 // Use the map of all controllers, not just active ones, since non-active
113 // controllers may still receive events for impl-only animations. 114 // controllers may still receive events for impl-only animations.
114 const AnimationRegistrar::AnimationControllerMap& animation_controllers = 115 const AnimationRegistrar::AnimationControllerMap& animation_controllers =
115 all_animation_controllers_; 116 all_animation_controllers_;
116 auto iter = animation_controllers.find(event_layer_id); 117 auto iter = animation_controllers.find(event_layer_id);
117 if (iter != animation_controllers.end()) { 118 if (iter != animation_controllers.end()) {
(...skipping 17 matching lines...) Expand all
135 136
136 case AnimationEvent::TAKEOVER: 137 case AnimationEvent::TAKEOVER:
137 (*iter).second->NotifyAnimationTakeover(events->events_[event_index]); 138 (*iter).second->NotifyAnimationTakeover(events->events_[event_index]);
138 break; 139 break;
139 } 140 }
140 } 141 }
141 } 142 }
142 } 143 }
143 144
144 } // namespace cc 145 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/animation_registrar.h ('k') | cc/animation/animation_timeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698