Skip to content

Commit af62a16

Browse files
targosMylesBorins
authored andcommitted
Revert "src: fix GetCpuProfiler() deprecation warning"
This reverts commit f02b74d. PR-URL: #19989 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matheus Marchini <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Myles Borins <[email protected]>
1 parent 4c48b69 commit af62a16

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

src/env.cc

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "node_internals.h"
22
#include "async_wrap.h"
3+
#include "v8-profiler.h"
34
#include "node_buffer.h"
45
#include "node_platform.h"
56
#include "node_file.h"
@@ -73,15 +74,6 @@ IsolateData::IsolateData(Isolate* isolate,
7374
IsolateData::~IsolateData() {
7475
if (platform_ != nullptr)
7576
platform_->UnregisterIsolate(this);
76-
if (cpu_profiler_ != nullptr)
77-
cpu_profiler_->Dispose();
78-
}
79-
80-
v8::CpuProfiler* IsolateData::GetCpuProfiler() {
81-
if (cpu_profiler_ != nullptr) return cpu_profiler_;
82-
cpu_profiler_ = v8::CpuProfiler::New(isolate());
83-
CHECK_NOT_NULL(cpu_profiler_);
84-
return cpu_profiler_;
8577
}
8678

8779

@@ -260,12 +252,12 @@ void Environment::CleanupHandles() {
260252
void Environment::StartProfilerIdleNotifier() {
261253
uv_prepare_start(&idle_prepare_handle_, [](uv_prepare_t* handle) {
262254
Environment* env = ContainerOf(&Environment::idle_prepare_handle_, handle);
263-
env->isolate_data()->GetCpuProfiler()->SetIdle(true);
255+
env->isolate()->GetCpuProfiler()->SetIdle(true);
264256
});
265257

266258
uv_check_start(&idle_check_handle_, [](uv_check_t* handle) {
267259
Environment* env = ContainerOf(&Environment::idle_check_handle_, handle);
268-
env->isolate_data()->GetCpuProfiler()->SetIdle(false);
260+
env->isolate()->GetCpuProfiler()->SetIdle(false);
269261
});
270262
}
271263

src/env.h

-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include "req_wrap.h"
3333
#include "util.h"
3434
#include "uv.h"
35-
#include "v8-profiler.h"
3635
#include "v8.h"
3736
#include "node.h"
3837
#include "node_http2_state.h"
@@ -369,8 +368,6 @@ class IsolateData {
369368
std::unordered_map<nghttp2_rcbuf*, v8::Eternal<v8::String>> http2_static_strs;
370369
inline v8::Isolate* isolate() const;
371370

372-
v8::CpuProfiler* GetCpuProfiler();
373-
374371
private:
375372
#define VP(PropertyName, StringValue) V(v8::Private, PropertyName)
376373
#define VS(PropertyName, StringValue) V(v8::String, PropertyName)
@@ -386,7 +383,6 @@ class IsolateData {
386383
uv_loop_t* const event_loop_;
387384
uint32_t* const zero_fill_field_;
388385
MultiIsolatePlatform* platform_;
389-
v8::CpuProfiler* cpu_profiler_ = nullptr;
390386

391387
DISALLOW_COPY_AND_ASSIGN(IsolateData);
392388
};

0 commit comments

Comments
 (0)