| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project 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 V8_TRACING_TRACING_CATEGORY_OBSERVER_H_ | 5 #ifndef V8_TRACING_TRACING_CATEGORY_OBSERVER_H_ |
| 6 #define V8_TRACING_TRACING_CATEGORY_OBSERVER_H_ | 6 #define V8_TRACING_TRACING_CATEGORY_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "include/v8-platform.h" | 8 #include "include/v8-platform.h" |
| 9 #include "src/base/lazy-instance.h" | |
| 10 | 9 |
| 11 namespace v8 { | 10 namespace v8 { |
| 12 namespace tracing { | 11 namespace tracing { |
| 13 | 12 |
| 14 class TracingCategoryObserver : public Platform::TraceStateObserver { | 13 class TracingCategoryObserver : public Platform::TraceStateObserver { |
| 15 public: | 14 public: |
| 16 enum Mode { | 15 enum Mode { |
| 17 ENABLED_BY_NATIVE = 1 << 0, | 16 ENABLED_BY_NATIVE = 1 << 0, |
| 18 ENABLED_BY_TRACING = 1 << 1, | 17 ENABLED_BY_TRACING = 1 << 1, |
| 18 ENABLED_BY_SAMPLING = 1 << 2, |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 static void SetUp(); | 21 static void SetUp(); |
| 22 static void TearDown(); | 22 static void TearDown(); |
| 23 | 23 |
| 24 // v8::Platform::TraceStateObserver | 24 // v8::Platform::TraceStateObserver |
| 25 void OnTraceEnabled() final; | 25 void OnTraceEnabled() final; |
| 26 void OnTraceDisabled() final; | 26 void OnTraceDisabled() final; |
| 27 | 27 |
| 28 TracingCategoryObserver() {} | |
| 29 ~TracingCategoryObserver() {} | |
| 30 | |
| 31 private: | 28 private: |
| 32 static TracingCategoryObserver* instance_; | 29 static TracingCategoryObserver* instance_; |
| 33 }; | 30 }; |
| 34 | 31 |
| 35 } // namespace tracing | 32 } // namespace tracing |
| 36 } // namespace v8 | 33 } // namespace v8 |
| 34 |
| 37 #endif // V8_TRACING_TRACING_CATEGORY_OBSERVER_H_ | 35 #endif // V8_TRACING_TRACING_CATEGORY_OBSERVER_H_ |
| OLD | NEW |