Fix build break
[chromium-blink-merge.git] / cc / debug / devtools_instrumentation.h
blob4b2136672b34e50afe24ce7666e49385f5174f7b
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
3 // found in the LICENSE file.
5 #ifndef CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_
6 #define CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_
8 #include "base/debug/trace_event.h"
10 namespace cc {
11 namespace devtools_instrumentation {
13 namespace internal {
14 const char kCategory[] = "cc,devtools";
15 const char kLayerId[] = "layerId";
16 const char kPaintLayer[] = "PaintLayer";
17 const char kRasterTask[] = "RasterTask";
20 struct ScopedPaintLayer {
21 explicit ScopedPaintLayer(int layer_id) {
22 TRACE_EVENT_BEGIN1(internal::kCategory, internal::kPaintLayer,
23 internal::kLayerId, layer_id);
25 ~ScopedPaintLayer() {
26 TRACE_EVENT_END0(internal::kCategory, internal::kPaintLayer);
29 DISALLOW_COPY_AND_ASSIGN(ScopedPaintLayer);
32 struct ScopedRasterTask {
33 explicit ScopedRasterTask(int layer_id) {
34 TRACE_EVENT_BEGIN1(internal::kCategory, internal::kRasterTask,
35 internal::kLayerId, layer_id);
37 ~ScopedRasterTask() {
38 TRACE_EVENT_END0(internal::kCategory, internal::kRasterTask);
41 DISALLOW_COPY_AND_ASSIGN(ScopedRasterTask);
44 struct ScopedLayerObjectTracker
45 : public base::debug::TraceScopedTrackableObject<int> {
46 explicit ScopedLayerObjectTracker(int layer_id)
47 : base::debug::TraceScopedTrackableObject<int>(
48 internal::kCategory,
49 internal::kLayerId,
50 layer_id) {
53 DISALLOW_COPY_AND_ASSIGN(ScopedLayerObjectTracker);
56 } // namespace devtools_instrumentation
57 } // namespace cc
59 #endif // CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_