| 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 <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
| 8 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
| 9 #include "base/trace_event/trace_event_argument.h" | 12 #include "base/trace_event/trace_event_argument.h" |
| 10 | 13 |
| 11 namespace cc { | 14 namespace cc { |
| 12 namespace devtools_instrumentation { | 15 namespace devtools_instrumentation { |
| 13 | 16 |
| 14 namespace internal { | 17 namespace internal { |
| 15 const char kCategory[] = TRACE_DISABLED_BY_DEFAULT("devtools.timeline"); | 18 const char kCategory[] = TRACE_DISABLED_BY_DEFAULT("devtools.timeline"); |
| 16 const char kCategoryFrame[] = | 19 const char kCategoryFrame[] = |
| 17 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.frame"); | 20 TRACE_DISABLED_BY_DEFAULT("devtools.timeline.frame"); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 48 const char* event_name_; | 51 const char* event_name_; |
| 49 | 52 |
| 50 DISALLOW_COPY_AND_ASSIGN(ScopedLayerTask); | 53 DISALLOW_COPY_AND_ASSIGN(ScopedLayerTask); |
| 51 }; | 54 }; |
| 52 | 55 |
| 53 class ScopedImageDecodeTask { | 56 class ScopedImageDecodeTask { |
| 54 public: | 57 public: |
| 55 explicit ScopedImageDecodeTask(const void* imagePtr) { | 58 explicit ScopedImageDecodeTask(const void* imagePtr) { |
| 56 TRACE_EVENT_BEGIN1(internal::kCategory, internal::kImageDecodeTask, | 59 TRACE_EVENT_BEGIN1(internal::kCategory, internal::kImageDecodeTask, |
| 57 internal::kPixelRefId, | 60 internal::kPixelRefId, |
| 58 reinterpret_cast<uint64>(imagePtr)); | 61 reinterpret_cast<uint64_t>(imagePtr)); |
| 59 } | 62 } |
| 60 ~ScopedImageDecodeTask() { | 63 ~ScopedImageDecodeTask() { |
| 61 TRACE_EVENT_END0(internal::kCategory, internal::kImageDecodeTask); | 64 TRACE_EVENT_END0(internal::kCategory, internal::kImageDecodeTask); |
| 62 } | 65 } |
| 63 private: | 66 private: |
| 64 DISALLOW_COPY_AND_ASSIGN(ScopedImageDecodeTask); | 67 DISALLOW_COPY_AND_ASSIGN(ScopedImageDecodeTask); |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 class ScopedLayerTreeTask { | 70 class ScopedLayerTreeTask { |
| 68 public: | 71 public: |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 TRACE_EVENT_INSTANT2( | 174 TRACE_EVENT_INSTANT2( |
| 172 internal::kCategoryFrame, internal::kNeedsBeginFrameChanged, | 175 internal::kCategoryFrame, internal::kNeedsBeginFrameChanged, |
| 173 TRACE_EVENT_SCOPE_THREAD, internal::kLayerTreeId, layer_tree_host_id, | 176 TRACE_EVENT_SCOPE_THREAD, internal::kLayerTreeId, layer_tree_host_id, |
| 174 internal::kData, NeedsBeginFrameData(new_value)); | 177 internal::kData, NeedsBeginFrameData(new_value)); |
| 175 } | 178 } |
| 176 | 179 |
| 177 } // namespace devtools_instrumentation | 180 } // namespace devtools_instrumentation |
| 178 } // namespace cc | 181 } // namespace cc |
| 179 | 182 |
| 180 #endif // CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_ | 183 #endif // CC_DEBUG_DEVTOOLS_INSTRUMENTATION_H_ |
| OLD | NEW |