Chromium Code Reviews| 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[] = "cc,devtools"; | 14 const char kCategory[] = "cc,devtools"; |
| 15 const char kFrameId[] = "frameId"; | |
| 15 const char kLayerId[] = "layerId"; | 16 const char kLayerId[] = "layerId"; |
| 16 const char kLayerTreeId[] = "layerTreeId"; | 17 const char kLayerTreeId[] = "layerTreeId"; |
| 17 const char kPixelRefId[] = "pixelRefId"; | 18 const char kPixelRefId[] = "pixelRefId"; |
| 18 | 19 |
| 19 const char kImageDecodeTask[] = "ImageDecodeTask"; | 20 const char kImageDecodeTask[] = "ImageDecodeTask"; |
| 20 } | 21 const char kBeginFrame[] = "BeginFrame"; |
| 22 const char kCommitMainThreadFrame[] = "CommitMainThreadFrame"; | |
| 23 } // namespace internal | |
| 21 | 24 |
| 22 const char kPaintLayer[] = "PaintLayer"; | 25 const char kPaintLayer[] = "PaintLayer"; |
| 23 const char kRasterTask[] = "RasterTask"; | 26 const char kRasterTask[] = "RasterTask"; |
| 24 const char kPaintSetup[] = "PaintSetup"; | 27 const char kPaintSetup[] = "PaintSetup"; |
| 25 const char kUpdateLayer[] = "UpdateLayer"; | 28 const char kUpdateLayer[] = "UpdateLayer"; |
| 26 | 29 |
| 27 class ScopedLayerTask { | 30 class ScopedLayerTask { |
| 28 public: | 31 public: |
| 29 ScopedLayerTask(const char* event_name, int layer_id) | 32 ScopedLayerTask(const char* event_name, int layer_id) |
| 30 : event_name_(event_name) { | 33 : event_name_(event_name) { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 : base::debug::TraceScopedTrackableObject<int>( | 80 : base::debug::TraceScopedTrackableObject<int>( |
| 78 internal::kCategory, | 81 internal::kCategory, |
| 79 internal::kLayerId, | 82 internal::kLayerId, |
| 80 layer_id) { | 83 layer_id) { |
| 81 } | 84 } |
| 82 | 85 |
| 83 private: | 86 private: |
| 84 DISALLOW_COPY_AND_ASSIGN(ScopedLayerObjectTracker); | 87 DISALLOW_COPY_AND_ASSIGN(ScopedLayerObjectTracker); |
| 85 }; | 88 }; |
| 86 | 89 |
| 90 inline void didCommitMainThreadFrame(uint64 tree_id, int frame_id) { | |
|
nduca
2013/11/06 19:05:12
remind me what the tree id does?
caseq
2013/11/07 06:36:26
It's actually LTH id -- we use it on the Timeline'
| |
| 91 TRACE_EVENT_INSTANT2(internal::kCategory, | |
| 92 internal::kCommitMainThreadFrame, | |
| 93 TRACE_EVENT_SCOPE_THREAD, | |
| 94 internal::kLayerTreeId, tree_id, | |
| 95 internal::kFrameId, frame_id); | |
| 96 } | |
| 97 | |
| 98 inline void didBeginFrame(uint64 tree_id) { | |
| 99 TRACE_EVENT_INSTANT1(internal::kCategory, | |
| 100 internal::kBeginFrame, | |
| 101 TRACE_EVENT_SCOPE_THREAD, | |
| 102 internal::kLayerTreeId, tree_id); | |
| 103 } | |
| 104 | |
| 87 } // namespace devtools_instrumentation | 105 } // namespace devtools_instrumentation |
| 88 } // namespace cc | 106 } // namespace cc |
| 89 | 107 |
| 90 #endif // CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_ | 108 #endif // CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_ |
| OLD | NEW |