| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_TRACE_EVENT_BLAME_CONTEXT_H_ | 5 #ifndef BASE_TRACE_EVENT_BLAME_CONTEXT_H_ |
| 6 #define BASE_TRACE_EVENT_BLAME_CONTEXT_H_ | 6 #define BASE_TRACE_EVENT_BLAME_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <inttypes.h> | 8 #include <inttypes.h> |
| 9 | 9 |
| 10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // enabled. Must be called before any other methods on this class. | 75 // enabled. Must be called before any other methods on this class. |
| 76 void Initialize(); | 76 void Initialize(); |
| 77 | 77 |
| 78 // Indicate that the current thread is now doing work which should count | 78 // Indicate that the current thread is now doing work which should count |
| 79 // against this blame context. This function is allowed to be called in a | 79 // against this blame context. This function is allowed to be called in a |
| 80 // thread different from where the blame context was created; However, any | 80 // thread different from where the blame context was created; However, any |
| 81 // client doing that must be fully responsible for ensuring thready safety. | 81 // client doing that must be fully responsible for ensuring thready safety. |
| 82 void Enter(); | 82 void Enter(); |
| 83 | 83 |
| 84 // Leave and stop doing work for a previously entered blame context. If | 84 // Leave and stop doing work for a previously entered blame context. If |
| 85 // another blame context belongin to the same tree was entered prior to this | 85 // another blame context belonging to the same tree was entered prior to this |
| 86 // one, it becomes the active blame context for this thread again. Similar | 86 // one, it becomes the active blame context for this thread again. Similar |
| 87 // to Enter(), this function can be called in a thread different from where | 87 // to Enter(), this function can be called in a thread different from where |
| 88 // the blame context was created, and the same requirement on thread safety | 88 // the blame context was created, and the same requirement on thread safety |
| 89 // must be satisfied. | 89 // must be satisfied. |
| 90 void Leave(); | 90 void Leave(); |
| 91 | 91 |
| 92 // Record a snapshot of the blame context. This is normally only needed if a | 92 // Record a snapshot of the blame context. This is normally only needed if a |
| 93 // blame context subclass defines custom properties (see AsValueInto) and one | 93 // blame context subclass defines custom properties (see AsValueInto) and one |
| 94 // or more of those properties have changed. | 94 // or more of those properties have changed. |
| 95 void TakeSnapshot(); | 95 void TakeSnapshot(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 ThreadChecker thread_checker_; | 129 ThreadChecker thread_checker_; |
| 130 WeakPtrFactory<BlameContext> weak_factory_; | 130 WeakPtrFactory<BlameContext> weak_factory_; |
| 131 | 131 |
| 132 DISALLOW_COPY_AND_ASSIGN(BlameContext); | 132 DISALLOW_COPY_AND_ASSIGN(BlameContext); |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 } // namespace trace_event | 135 } // namespace trace_event |
| 136 } // namespace base | 136 } // namespace base |
| 137 | 137 |
| 138 #endif // BASE_TRACE_EVENT_BLAME_CONTEXT_H_ | 138 #endif // BASE_TRACE_EVENT_BLAME_CONTEXT_H_ |
| OLD | NEW |