Chromium Code Reviews| Index: cc/trees/layer_tree_host_impl.cc |
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
| index 2399289de05203c768f2b7755d83270ebfcb6618..532af762753c4210081057cc5af7f9718588e293 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -11,9 +11,10 @@ |
| #include <limits> |
| #include <map> |
| #include <set> |
| +#include <unordered_map> |
| +#include <utility> |
| #include "base/auto_reset.h" |
| -#include "base/containers/hash_tables.h" |
| #include "base/containers/small_map.h" |
| #include "base/json/json_writer.h" |
| #include "base/metrics/histogram.h" |
| @@ -1185,7 +1186,8 @@ void LayerTreeHostImpl::RemoveRenderPasses(FrameData* frame) { |
| std::set<RenderPassId> pass_exists; |
| // A set of RenderPassDrawQuads that we have seen (stored by the RenderPasses |
| // they refer to). |
| - base::SmallMap<base::hash_map<RenderPassId, int>> pass_references; |
| + base::SmallMap<std::unordered_map<RenderPassId, int, RenderPassIdHash>> |
| + pass_references; |
| // Iterate RenderPasses in draw order, removing empty render passes (except |
| // the root RenderPass). |
| @@ -3288,9 +3290,12 @@ void LayerTreeHostImpl::RegisterScrollbarAnimationController( |
| return; |
| if (ScrollbarAnimationControllerForId(scroll_layer_id)) |
| return; |
| - scrollbar_animation_controllers_.add( |
| + // TODO(davidben): Is this the same as using operator[]? The check above |
|
danakj
2016/01/14 21:12:32
You're worried for the case where the scroll_layer
davidben
2016/01/14 21:28:19
I'm worried about the case where scroll_layer_id e
danakj
2016/01/14 21:31:54
Yah it is a bit awkward. I think operator[] will b
davidben
2016/01/21 01:33:58
Done.
|
| + // doesn't quite work if scroll_layer_id gets modified in |
| + // ScrollbarAnimationControllerForId. |
| + scrollbar_animation_controllers_.insert(std::make_pair( |
| scroll_layer_id, |
| - active_tree_->CreateScrollbarAnimationController(scroll_layer_id)); |
| + active_tree_->CreateScrollbarAnimationController(scroll_layer_id))); |
| } |
| void LayerTreeHostImpl::UnregisterScrollbarAnimationController( |
| @@ -3307,7 +3312,7 @@ LayerTreeHostImpl::ScrollbarAnimationControllerForId( |
| auto i = scrollbar_animation_controllers_.find(scroll_layer_id); |
| if (i == scrollbar_animation_controllers_.end()) |
| return nullptr; |
| - return i->second; |
| + return i->second.get(); |
| } |
| void LayerTreeHostImpl::PostDelayedScrollbarAnimationTask( |