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 3// found in the LICENSE file. 4 5#ifndef V8_TRACING_TRACING_CATEGORY_OBSERVER_H_ 6#define V8_TRACING_TRACING_CATEGORY_OBSERVER_H_ 7 8#include "include/v8-platform.h" 9 10namespace v8 { 11namespace tracing { 12 13class TracingCategoryObserver : public Platform::TraceStateObserver { 14 public: 15 enum Mode { 16 ENABLED_BY_NATIVE = 1 << 0, 17 ENABLED_BY_TRACING = 1 << 1, 18 ENABLED_BY_SAMPLING = 1 << 2, 19 }; 20 21 static void SetUp(); 22 static void TearDown(); 23 24 // v8::Platform::TraceStateObserver 25 void OnTraceEnabled() final; 26 void OnTraceDisabled() final; 27 28 private: 29 static TracingCategoryObserver* instance_; 30}; 31 32} // namespace tracing 33} // namespace v8 34 35#endif // V8_TRACING_TRACING_CATEGORY_OBSERVER_H_ 36