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

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

Issue 632613002: [C++11 Allowed Features] Declares a type-safe null pointer converting from NULL to nullptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | cc/animation/layer_animation_controller.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 "cc/animation/layer_animation_controller.h" 7 #include "cc/animation/layer_animation_controller.h"
8 8
9 namespace cc { 9 namespace cc {
10 10
11 AnimationRegistrar::AnimationRegistrar() : supports_scroll_animations_(false) { 11 AnimationRegistrar::AnimationRegistrar() : supports_scroll_animations_(false) {
12 } 12 }
13 13
14 AnimationRegistrar::~AnimationRegistrar() { 14 AnimationRegistrar::~AnimationRegistrar() {
15 AnimationControllerMap copy = all_animation_controllers_; 15 AnimationControllerMap copy = all_animation_controllers_;
16 for (AnimationControllerMap::iterator iter = copy.begin(); 16 for (AnimationControllerMap::iterator iter = copy.begin();
17 iter != copy.end(); 17 iter != copy.end();
18 ++iter) 18 ++iter)
19 (*iter).second->SetAnimationRegistrar(NULL); 19 (*iter).second->SetAnimationRegistrar(nullptr);
20 } 20 }
21 21
22 scoped_refptr<LayerAnimationController> 22 scoped_refptr<LayerAnimationController>
23 AnimationRegistrar::GetAnimationControllerForId(int id) { 23 AnimationRegistrar::GetAnimationControllerForId(int id) {
24 scoped_refptr<LayerAnimationController> to_return; 24 scoped_refptr<LayerAnimationController> to_return;
25 if (!ContainsKey(all_animation_controllers_, id)) { 25 if (!ContainsKey(all_animation_controllers_, id)) {
26 to_return = LayerAnimationController::Create(id); 26 to_return = LayerAnimationController::Create(id);
27 to_return->SetAnimationRegistrar(this); 27 to_return->SetAnimationRegistrar(this);
28 all_animation_controllers_[id] = to_return.get(); 28 all_animation_controllers_[id] = to_return.get();
29 } else { 29 } else {
(...skipping 19 matching lines...) Expand all
49 } 49 }
50 50
51 void AnimationRegistrar::UnregisterAnimationController( 51 void AnimationRegistrar::UnregisterAnimationController(
52 LayerAnimationController* controller) { 52 LayerAnimationController* controller) {
53 if (ContainsKey(all_animation_controllers_, controller->id())) 53 if (ContainsKey(all_animation_controllers_, controller->id()))
54 all_animation_controllers_.erase(controller->id()); 54 all_animation_controllers_.erase(controller->id());
55 DidDeactivateAnimationController(controller); 55 DidDeactivateAnimationController(controller);
56 } 56 }
57 57
58 } // namespace cc 58 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/animation/layer_animation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698