OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 BASE_PROFILER_SCOPED_TRACKER_H_ | 5 #ifndef BASE_PROFILER_SCOPED_TRACKER_H_ |
6 #define BASE_PROFILER_SCOPED_TRACKER_H_ | 6 #define BASE_PROFILER_SCOPED_TRACKER_H_ |
7 | 7 |
8 //------------------------------------------------------------------------------ | 8 //------------------------------------------------------------------------------ |
9 // Utilities for temporarily instrumenting code to dig into issues that were | 9 // Utilities for temporarily instrumenting code to dig into issues that were |
10 // found using profiler data. | 10 // found using profiler data. |
11 | 11 |
12 #include "base/base_export.h" | 12 #include "base/base_export.h" |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
15 #include "base/location.h" | 15 #include "base/location.h" |
| 16 #include "base/macros.h" |
16 #include "base/profiler/scoped_profile.h" | 17 #include "base/profiler/scoped_profile.h" |
17 | 18 |
18 namespace tracked_objects { | 19 namespace tracked_objects { |
19 | 20 |
20 // ScopedTracker instruments a region within the code if the instrumentation is | 21 // ScopedTracker instruments a region within the code if the instrumentation is |
21 // enabled. It can be used, for example, to find out if a source of jankiness is | 22 // enabled. It can be used, for example, to find out if a source of jankiness is |
22 // inside the instrumented code region. | 23 // inside the instrumented code region. |
23 // Details: | 24 // Details: |
24 // 1. This class creates a task (like ones created by PostTask calls or IPC | 25 // 1. This class creates a task (like ones created by PostTask calls or IPC |
25 // message handlers). This task can be seen in chrome://profiler and is sent as | 26 // message handlers). This task can be seen in chrome://profiler and is sent as |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } | 68 } |
68 | 69 |
69 const ScopedProfile scoped_profile_; | 70 const ScopedProfile scoped_profile_; |
70 | 71 |
71 DISALLOW_COPY_AND_ASSIGN(ScopedTracker); | 72 DISALLOW_COPY_AND_ASSIGN(ScopedTracker); |
72 }; | 73 }; |
73 | 74 |
74 } // namespace tracked_objects | 75 } // namespace tracked_objects |
75 | 76 |
76 #endif // BASE_PROFILER_SCOPED_TRACKER_H_ | 77 #endif // BASE_PROFILER_SCOPED_TRACKER_H_ |
OLD | NEW |