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