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

Side by Side Diff: cc/debug/devtools_instrumentation.h

Issue 16848010: Add LayerTreeHostClient::{will,did}UpdateLayer, report layer updates to DevTools (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments addressed, try run Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/trees/layer_tree_host.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_DEBUG_DEVTOOLS_INSTRUMENTATION_H_ 5 #ifndef CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_
6 #define CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_ 6 #define CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_
7 7
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 9
10 namespace cc { 10 namespace cc {
11 namespace devtools_instrumentation { 11 namespace devtools_instrumentation {
12 12
13 namespace internal { 13 namespace internal {
14 const char kCategory[] = "cc,devtools"; 14 const char kCategory[] = "cc,devtools";
15 const char kLayerId[] = "layerId"; 15 const char kLayerId[] = "layerId";
16 const char kLayerTreeId[] = "layerTreeId";
16 } 17 }
17 18
18 const char kPaintLayer[] = "PaintLayer"; 19 const char kPaintLayer[] = "PaintLayer";
19 const char kRasterTask[] = "RasterTask"; 20 const char kRasterTask[] = "RasterTask";
20 const char kImageDecodeTask[] = "ImageDecodeTask"; 21 const char kImageDecodeTask[] = "ImageDecodeTask";
21 const char kPaintSetup[] = "PaintSetup"; 22 const char kPaintSetup[] = "PaintSetup";
23 const char kUpdateLayer[] = "UpdateLayer";
22 24
23 class ScopedLayerTask { 25 class ScopedLayerTask {
24 public: 26 public:
25 explicit ScopedLayerTask(const char* event_name, int layer_id) 27 ScopedLayerTask(const char* event_name, int layer_id)
26 : event_name_(event_name) { 28 : event_name_(event_name) {
27 TRACE_EVENT_BEGIN1(internal::kCategory, event_name_, 29 TRACE_EVENT_BEGIN1(internal::kCategory, event_name_,
28 internal::kLayerId, layer_id); 30 internal::kLayerId, layer_id);
29 } 31 }
30 ~ScopedLayerTask() { 32 ~ScopedLayerTask() {
31 TRACE_EVENT_END0(internal::kCategory, event_name_); 33 TRACE_EVENT_END0(internal::kCategory, event_name_);
32 } 34 }
33 private: 35 private:
34 const char* event_name_; 36 const char* event_name_;
37
38 DISALLOW_COPY_AND_ASSIGN(ScopedLayerTask);
39 };
40
41 class ScopedLayerTreeTask {
42 public:
43 ScopedLayerTreeTask(const char* event_name,
44 int layer_id,
45 uint64 tree_id)
46 : event_name_(event_name) {
47 TRACE_EVENT_BEGIN2(internal::kCategory, event_name_,
48 internal::kLayerId, layer_id, internal::kLayerTreeId, tree_id);
49 }
50 ~ScopedLayerTreeTask() {
51 TRACE_EVENT_END0(internal::kCategory, event_name_);
52 }
53 private:
54 const char* event_name_;
55
56 DISALLOW_COPY_AND_ASSIGN(ScopedLayerTreeTask);
35 }; 57 };
36 58
37 struct ScopedLayerObjectTracker 59 struct ScopedLayerObjectTracker
38 : public base::debug::TraceScopedTrackableObject<int> { 60 : public base::debug::TraceScopedTrackableObject<int> {
39 explicit ScopedLayerObjectTracker(int layer_id) 61 explicit ScopedLayerObjectTracker(int layer_id)
40 : base::debug::TraceScopedTrackableObject<int>( 62 : base::debug::TraceScopedTrackableObject<int>(
41 internal::kCategory, 63 internal::kCategory,
42 internal::kLayerId, 64 internal::kLayerId,
43 layer_id) { 65 layer_id) {
44 } 66 }
45 67
68 private:
46 DISALLOW_COPY_AND_ASSIGN(ScopedLayerObjectTracker); 69 DISALLOW_COPY_AND_ASSIGN(ScopedLayerObjectTracker);
47 }; 70 };
48 71
49 } // namespace devtools_instrumentation 72 } // namespace devtools_instrumentation
50 } // namespace cc 73 } // namespace cc
51 74
52 #endif // CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_ 75 #endif // CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698