Skip to content

Commit

Permalink
Revert "src: fix GetCpuProfiler() deprecation warning"
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
targos authored and MylesBorins committed Jun 1, 2018
1 parent 4c48b69 commit af62a16
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
14 changes: 3 additions & 11 deletions src/env.cc
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -73,15 +74,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_NOT_NULL(cpu_profiler_);
return cpu_profiler_;
}


Expand Down Expand Up @@ -260,12 +252,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);
});
}

Expand Down
4 changes: 0 additions & 4 deletions src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -369,8 +368,6 @@ class IsolateData {
std::unordered_map<nghttp2_rcbuf*, v8::Eternal<v8::String>> 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)
Expand All @@ -386,7 +383,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);
};
Expand Down

0 comments on commit af62a16

Please sign in to comment.