Browse Source

inspector: remove unused uv_async_t

PR-URL: https://github.com/nodejs/node/pull/10392
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6
Eugene Ostroukhov 8 years ago
parent
commit
3e76364be3
  1. 15
      src/inspector_agent.cc

15
src/inspector_agent.cc

@ -135,7 +135,6 @@ class InspectorAgentDelegate: public node::inspector::SocketServerDelegate {
class AgentImpl { class AgentImpl {
public: public:
explicit AgentImpl(node::Environment* env); explicit AgentImpl(node::Environment* env);
~AgentImpl();
// Start the inspector agent thread // Start the inspector agent thread
bool Start(v8::Platform* platform, const char* path, bool Start(v8::Platform* platform, const char* path,
@ -194,7 +193,6 @@ class AgentImpl {
State state_; State state_;
node::Environment* parent_env_; node::Environment* parent_env_;
uv_async_t* data_written_;
uv_async_t io_thread_req_; uv_async_t io_thread_req_;
V8NodeInspector* inspector_; V8NodeInspector* inspector_;
v8::Platform* platform_; v8::Platform* platform_;
@ -335,7 +333,6 @@ AgentImpl::AgentImpl(Environment* env) : delegate_(nullptr),
shutting_down_(false), shutting_down_(false),
state_(State::kNew), state_(State::kNew),
parent_env_(env), parent_env_(env),
data_written_(new uv_async_t()),
inspector_(nullptr), inspector_(nullptr),
platform_(nullptr), platform_(nullptr),
dispatching_messages_(false), dispatching_messages_(false),
@ -343,16 +340,6 @@ AgentImpl::AgentImpl(Environment* env) : delegate_(nullptr),
server_(nullptr) { server_(nullptr) {
CHECK_EQ(0, uv_sem_init(&start_sem_, 0)); CHECK_EQ(0, uv_sem_init(&start_sem_, 0));
memset(&io_thread_req_, 0, sizeof(io_thread_req_)); 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) { void InspectorConsoleCall(const v8::FunctionCallbackInfo<v8::Value>& info) {
@ -622,7 +609,6 @@ void AgentImpl::PostIncomingMessage(InspectorAction action, int session_id,
platform_->CallOnForegroundThread(isolate, platform_->CallOnForegroundThread(isolate,
new DispatchOnInspectorBackendTask(this)); new DispatchOnInspectorBackendTask(this));
isolate->RequestInterrupt(InterruptCallback, this); isolate->RequestInterrupt(InterruptCallback, this);
uv_async_send(data_written_);
} }
NotifyMessageReceived(); NotifyMessageReceived();
} }
@ -676,7 +662,6 @@ void AgentImpl::DispatchMessages() {
} }
} }
} while (!tasks.empty()); } while (!tasks.empty());
uv_async_send(data_written_);
dispatching_messages_ = false; dispatching_messages_ = false;
} }

Loading…
Cancel
Save