OLD | NEW |
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[] = TRACE_DISABLED_BY_DEFAULT("devtools.timeline"); | 14 const char kCategory[] = TRACE_DISABLED_BY_DEFAULT("devtools.timeline"); |
15 const char kCategoryFrame[] = | 15 const char kCategoryFrame[] = |
16 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.frame"); | 16 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.frame"); |
17 const char kFrameId[] = "frameId"; | 17 const char kFrameId[] = "frameId"; |
18 const char kLayerId[] = "layerId"; | 18 const char kLayerId[] = "layerId"; |
19 const char kLayerTreeId[] = "layerTreeId"; | 19 const char kLayerTreeId[] = "layerTreeId"; |
20 const char kPixelRefId[] = "pixelRefId"; | 20 const char kPixelRefId[] = "pixelRefId"; |
21 | 21 |
22 const char kImageDecodeTask[] = "ImageDecodeTask"; | 22 const char kImageDecodeTask[] = "ImageDecodeTask"; |
23 const char kBeginFrame[] = "BeginFrame"; | 23 const char kBeginFrame[] = "BeginFrame"; |
24 const char kActivateLayerTree[] = "ActivateLayerTree"; | 24 const char kActivateLayerTree[] = "ActivateLayerTree"; |
25 const char kRequestMainThreadFrame[] = "RequestMainThreadFrame"; | 25 const char kRequestMainThreadFrame[] = "RequestMainThreadFrame"; |
26 const char kDrawFrame[] = "DrawFrame"; | 26 const char kDrawFrame[] = "DrawFrame"; |
27 } // namespace internal | 27 } // namespace internal |
28 | 28 |
29 const char kRasterTask[] = "RasterTask"; | |
30 const char kPaintSetup[] = "PaintSetup"; | 29 const char kPaintSetup[] = "PaintSetup"; |
31 const char kUpdateLayer[] = "UpdateLayer"; | 30 const char kUpdateLayer[] = "UpdateLayer"; |
32 | 31 |
33 class ScopedLayerTask { | 32 class ScopedLayerTask { |
34 public: | 33 public: |
35 ScopedLayerTask(const char* event_name, int layer_id) | 34 ScopedLayerTask(const char* event_name, int layer_id) |
36 : event_name_(event_name) { | 35 : event_name_(event_name) { |
37 TRACE_EVENT_BEGIN1(internal::kCategory, event_name_, | 36 TRACE_EVENT_BEGIN1(internal::kCategory, event_name_, |
38 internal::kLayerId, layer_id); | 37 internal::kLayerId, layer_id); |
39 } | 38 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 internal::kRequestMainThreadFrame, | 121 internal::kRequestMainThreadFrame, |
123 TRACE_EVENT_SCOPE_THREAD, | 122 TRACE_EVENT_SCOPE_THREAD, |
124 internal::kLayerTreeId, | 123 internal::kLayerTreeId, |
125 layer_tree_host_id); | 124 layer_tree_host_id); |
126 } | 125 } |
127 | 126 |
128 } // namespace devtools_instrumentation | 127 } // namespace devtools_instrumentation |
129 } // namespace cc | 128 } // namespace cc |
130 | 129 |
131 #endif // CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_ | 130 #endif // CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_ |
OLD | NEW |