Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef CC_ANIMATION_ANIMATION_REGISTRAR_H_ | 5 #ifndef CC_ANIMATION_ANIMATION_REGISTRAR_H_ |
| 6 #define CC_ANIMATION_ANIMATION_REGISTRAR_H_ | 6 #define CC_ANIMATION_ANIMATION_REGISTRAR_H_ |
| 7 | 7 |
| 8 #include "base/containers/hash_tables.h" | 8 #include <unordered_map> |
| 9 | |
| 9 #include "base/macros.h" | 10 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "cc/animation/animation_events.h" | 13 #include "cc/animation/animation_events.h" |
| 13 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 14 | 15 |
| 15 namespace cc { | 16 namespace cc { |
| 16 | 17 |
| 17 class LayerAnimationController; | 18 class LayerAnimationController; |
| 18 | 19 |
| 19 class CC_EXPORT AnimationRegistrar { | 20 class CC_EXPORT AnimationRegistrar { |
| 20 public: | 21 public: |
| 21 typedef base::hash_map<int, LayerAnimationController*> AnimationControllerMap; | 22 typedef std::unordered_map<int, LayerAnimationController*> |
|
danakj
2016/01/14 21:12:32
would you mind changing "typedef" to "using" when
davidben
2016/01/21 01:33:57
Done. There's actually quite a lot of those...
| |
| 23 AnimationControllerMap; | |
| 22 | 24 |
| 23 static scoped_ptr<AnimationRegistrar> Create() { | 25 static scoped_ptr<AnimationRegistrar> Create() { |
| 24 return make_scoped_ptr(new AnimationRegistrar()); | 26 return make_scoped_ptr(new AnimationRegistrar()); |
| 25 } | 27 } |
| 26 | 28 |
| 27 virtual ~AnimationRegistrar(); | 29 virtual ~AnimationRegistrar(); |
| 28 | 30 |
| 29 // If an animation has been registered for the given id, return it. Otherwise | 31 // If an animation has been registered for the given id, return it. Otherwise |
| 30 // creates a new one and returns a scoped_refptr to it. | 32 // creates a new one and returns a scoped_refptr to it. |
| 31 scoped_refptr<LayerAnimationController> GetAnimationControllerForId(int id); | 33 scoped_refptr<LayerAnimationController> GetAnimationControllerForId(int id); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 AnimationControllerMap all_animation_controllers_; | 84 AnimationControllerMap all_animation_controllers_; |
| 83 | 85 |
| 84 bool supports_scroll_animations_; | 86 bool supports_scroll_animations_; |
| 85 | 87 |
| 86 DISALLOW_COPY_AND_ASSIGN(AnimationRegistrar); | 88 DISALLOW_COPY_AND_ASSIGN(AnimationRegistrar); |
| 87 }; | 89 }; |
| 88 | 90 |
| 89 } // namespace cc | 91 } // namespace cc |
| 90 | 92 |
| 91 #endif // CC_ANIMATION_ANIMATION_REGISTRAR_H_ | 93 #endif // CC_ANIMATION_ANIMATION_REGISTRAR_H_ |
| OLD | NEW |