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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 60353002: cc: add DevTools instrumentation for impl-side frames (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index b5c368b72dfdcbf15e642caa849a2cc604d4792d..c1e1d4bef5d2b4e181b441ccece32f8d19cc3180 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;
}
namespace cc {
@@ -125,7 +117,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)
@@ -423,6 +415,7 @@ void LayerTreeHost::FinishCommitOnImplThread(LayerTreeHostImpl* host_impl) {
// If we're not in impl-side painting, the tree is immediately
// considered active.
sync_tree->DidBecomeActive();
+ devtools_instrumentation::didActivateLayerTree(id_, source_frame_number_);
}
micro_benchmark_controller_.ScheduleImplBenchmarks(host_impl);
@@ -463,7 +456,8 @@ scoped_ptr<LayerTreeHostImpl> LayerTreeHost::CreateLayerTreeHostImpl(
client,
proxy_.get(),
rendering_stats_instrumentation_.get(),
- shared_bitmap_manager_);
+ shared_bitmap_manager_,
+ id_);
shared_bitmap_manager_ = NULL;
if (settings_.calculate_top_controls_position &&
host_impl->top_controls_manager()) {
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698