Chromium Code Reviews| Index: cc/trees/layer_tree_host.cc |
| diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc |
| index e91980543c5a2912e95731e1db7b2849a4fc6b52..623f35353c065c0845d99845383c3c1791f32ff0 100644 |
| --- a/cc/trees/layer_tree_host.cc |
| +++ b/cc/trees/layer_tree_host.cc |
| @@ -8,15 +8,14 @@ |
| #include <stack> |
| #include <string> |
| +#include "base/atomic_sequence_num.h" |
| #include "base/bind.h" |
| #include "base/command_line.h" |
| #include "base/debug/trace_event.h" |
| -#include "base/lazy_instance.h" |
| #include "base/message_loop/message_loop.h" |
| #include "base/metrics/histogram.h" |
| #include "base/stl_util.h" |
| #include "base/strings/string_number_conversions.h" |
| -#include "base/synchronization/lock.h" |
| #include "cc/animation/animation_registrar.h" |
| #include "cc/animation/layer_animation_controller.h" |
| #include "cc/base/math_util.h" |
| @@ -43,14 +42,7 @@ |
| #include "ui/gfx/size_conversions.h" |
| namespace { |
| -static base::LazyInstance<base::Lock>::Leaky |
| - s_next_tree_id_lock = LAZY_INSTANCE_INITIALIZER; |
| - |
| -inline int GetNextTreeId() { |
| - static int s_next_tree_id = 1; |
| - base::AutoLock lock(s_next_tree_id_lock.Get()); |
| - return s_next_tree_id++; |
| -} |
| +static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number; |
|
dshwang
2013/11/07 10:28:51
oh, great! thx.
|
| } |
| namespace cc { |
| @@ -153,7 +145,7 @@ LayerTreeHost::LayerTreeHost( |
| partial_texture_update_requests_(0), |
| in_paint_layer_contents_(false), |
| total_frames_used_for_lcd_text_metrics_(0), |
| - tree_id_(GetNextTreeId()), |
| + id_(s_layer_tree_host_sequence_number.GetNext() + 1), |
| next_commit_forces_redraw_(false), |
| shared_bitmap_manager_(manager) { |
| if (settings_.accelerated_animation_enabled) |
| @@ -452,6 +444,7 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) { |
| // considered active. |
| sync_tree->DidBecomeActive(); |
| } |
| + devtools_instrumentation::didCommitMainThreadFrame(id_, source_frame_number_); |
| source_frame_number_++; |
| } |