Skip to content

Commit

Permalink
inspector: remove unused uv_async_t
Browse files Browse the repository at this point in the history
PR-URL: nodejs#10392
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Eugene Ostroukhov authored and italoacasas committed Jan 25, 2017
1 parent 9956612 commit 0191907
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ class InspectorAgentDelegate: public node::inspector::SocketServerDelegate {
class AgentImpl {
public:
explicit AgentImpl(node::Environment* env);
~AgentImpl();

// Start the inspector agent thread
bool Start(v8::Platform* platform, const char* path, int port, bool wait);
Expand Down Expand Up @@ -183,7 +182,6 @@ class AgentImpl {
State state_;
node::Environment* parent_env_;

uv_async_t* data_written_;
uv_async_t io_thread_req_;
V8NodeInspector* inspector_;
v8::Platform* platform_;
Expand Down Expand Up @@ -323,24 +321,13 @@ AgentImpl::AgentImpl(Environment* env) : delegate_(nullptr),
shutting_down_(false),
state_(State::kNew),
parent_env_(env),
data_written_(new uv_async_t()),
inspector_(nullptr),
platform_(nullptr),
dispatching_messages_(false),
session_id_(0),
server_(nullptr) {
CHECK_EQ(0, uv_sem_init(&start_sem_, 0));
memset(&io_thread_req_, 0, sizeof(io_thread_req_));
CHECK_EQ(0, uv_async_init(env->event_loop(), data_written_, nullptr));
uv_unref(reinterpret_cast<uv_handle_t*>(data_written_));
}

AgentImpl::~AgentImpl() {
auto close_cb = [](uv_handle_t* handle) {
delete reinterpret_cast<uv_async_t*>(handle);
};
uv_close(reinterpret_cast<uv_handle_t*>(data_written_), close_cb);
data_written_ = nullptr;
}

void InspectorConsoleCall(const v8::FunctionCallbackInfo<v8::Value>& info) {
Expand Down Expand Up @@ -606,7 +593,6 @@ void AgentImpl::PostIncomingMessage(int session_id,
platform_->CallOnForegroundThread(isolate,
new DispatchOnInspectorBackendTask(this));
isolate->RequestInterrupt(InterruptCallback, this);
uv_async_send(data_written_);
}
NotifyMessageReceived();
}
Expand Down Expand Up @@ -662,7 +648,6 @@ void AgentImpl::DispatchMessages() {
}
}
} while (!tasks.empty());
uv_async_send(data_written_);
dispatching_messages_ = false;
}

Expand Down

0 comments on commit 0191907

Please sign in to comment.