diff --git a/src/env.cc b/src/env.cc index 608bada5d78..f13af94db90 100644 --- a/src/env.cc +++ b/src/env.cc @@ -119,7 +119,7 @@ void InitThreadLocalOnce() { CHECK_EQ(0, uv_key_create(&Environment::thread_local_env)); } -void Environment::TrackingTraceStateObserver::UpdateTraceCategoryState() { +void TrackingTraceStateObserver::UpdateTraceCategoryState() { if (!env_->owns_process_state()) { // Ideally, we’d have a consistent story that treats all threads/Environment // instances equally here. However, tracing is essentially global, and this diff --git a/src/env.h b/src/env.h index c7ec9670a9f..02063303910 100644 --- a/src/env.h +++ b/src/env.h @@ -665,6 +665,25 @@ class TickInfo { AliasedBuffer fields_; }; +class TrackingTraceStateObserver : + public v8::TracingController::TraceStateObserver { + public: + explicit TrackingTraceStateObserver(Environment* env) : env_(env) {} + + void OnTraceEnabled() override { + UpdateTraceCategoryState(); + } + + void OnTraceDisabled() override { + UpdateTraceCategoryState(); + } + + private: + void UpdateTraceCategoryState(); + + Environment* env_; +}; + class Environment { public: Environment(const Environment&) = delete; @@ -979,25 +998,6 @@ class Environment { // This needs to be available for the JS-land setImmediate(). void ToggleImmediateRef(bool ref); - class TrackingTraceStateObserver : - public v8::TracingController::TraceStateObserver { - public: - explicit TrackingTraceStateObserver(Environment* env) : env_(env) {} - - void OnTraceEnabled() override { - UpdateTraceCategoryState(); - } - - void OnTraceDisabled() override { - UpdateTraceCategoryState(); - } - - private: - void UpdateTraceCategoryState(); - - Environment* env_; - }; - class ShouldNotAbortOnUncaughtScope { public: explicit inline ShouldNotAbortOnUncaughtScope(Environment* env);