From d25ca1936863e7275948cbee0fbecbb875d2de61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Thu, 12 Apr 2018 09:13:06 +0200 Subject: [PATCH] Revert "src: fix GetCpuProfiler() deprecation warning" This reverts commit f02b74dfdb364e1ccfa59ba7ee22790fe65548c3. --- src/env.cc | 14 +++----------- src/env.h | 4 ---- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/env.cc b/src/env.cc index 1f47ea21af21b8..9010966a3623cc 100644 --- a/src/env.cc +++ b/src/env.cc @@ -1,5 +1,6 @@ #include "node_internals.h" #include "async_wrap.h" +#include "v8-profiler.h" #include "node_buffer.h" #include "node_platform.h" #include "node_file.h" @@ -71,15 +72,6 @@ IsolateData::IsolateData(Isolate* isolate, IsolateData::~IsolateData() { if (platform_ != nullptr) platform_->UnregisterIsolate(this); - if (cpu_profiler_ != nullptr) - cpu_profiler_->Dispose(); -} - -v8::CpuProfiler* IsolateData::GetCpuProfiler() { - if (cpu_profiler_ != nullptr) return cpu_profiler_; - cpu_profiler_ = v8::CpuProfiler::New(isolate()); - CHECK_NE(cpu_profiler_, nullptr); - return cpu_profiler_; } @@ -244,12 +236,12 @@ void Environment::CleanupHandles() { void Environment::StartProfilerIdleNotifier() { uv_prepare_start(&idle_prepare_handle_, [](uv_prepare_t* handle) { Environment* env = ContainerOf(&Environment::idle_prepare_handle_, handle); - env->isolate_data()->GetCpuProfiler()->SetIdle(true); + env->isolate()->GetCpuProfiler()->SetIdle(true); }); uv_check_start(&idle_check_handle_, [](uv_check_t* handle) { Environment* env = ContainerOf(&Environment::idle_check_handle_, handle); - env->isolate_data()->GetCpuProfiler()->SetIdle(false); + env->isolate()->GetCpuProfiler()->SetIdle(false); }); } diff --git a/src/env.h b/src/env.h index af4470ad8632fe..52e1a19f952c9e 100644 --- a/src/env.h +++ b/src/env.h @@ -32,7 +32,6 @@ #include "req_wrap.h" #include "util.h" #include "uv.h" -#include "v8-profiler.h" #include "v8.h" #include "node.h" #include "node_http2_state.h" @@ -368,8 +367,6 @@ class IsolateData { std::unordered_map> http2_static_strs; inline v8::Isolate* isolate() const; - v8::CpuProfiler* GetCpuProfiler(); - private: #define VP(PropertyName, StringValue) V(v8::Private, PropertyName) #define VS(PropertyName, StringValue) V(v8::String, PropertyName) @@ -385,7 +382,6 @@ class IsolateData { uv_loop_t* const event_loop_; uint32_t* const zero_fill_field_; MultiIsolatePlatform* platform_; - v8::CpuProfiler* cpu_profiler_ = nullptr; DISALLOW_COPY_AND_ASSIGN(IsolateData); };