Skip to content

Commit 42b9343

Browse files
saghulindutny
authored andcommitted
src: update uv callbacks after API changes
async, timer, prepare, idle and check handles no longer get a status parameter since they can never fail.
1 parent 962f96d commit 42b9343

8 files changed

Lines changed: 18 additions & 20 deletions

File tree

src/cares_wrap.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ RB_GENERATE_STATIC(ares_task_list, ares_task_t, node, cmp_ares_tasks)
8080

8181
/* This is called once per second by loop->timer. It is used to constantly */
8282
/* call back into c-ares for possibly processing timeouts. */
83-
static void ares_timeout(uv_timer_t* handle, int status) {
83+
static void ares_timeout(uv_timer_t* handle) {
8484
Environment* env = Environment::from_cares_timer_handle(handle);
8585
assert(!RB_EMPTY(env->cares_task_list()));
8686
ares_process_fd(env->cares_channel(), ARES_SOCKET_BAD, ARES_SOCKET_BAD);

src/node.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,15 @@ void ArrayBufferAllocator::Free(void* data, size_t length) {
185185
}
186186

187187

188-
static void CheckImmediate(uv_check_t* handle, int status) {
188+
static void CheckImmediate(uv_check_t* handle) {
189189
Environment* env = Environment::from_immediate_check_handle(handle);
190190
HandleScope scope(env->isolate());
191191
Context::Scope context_scope(env->context());
192192
MakeCallback(env, env->process_object(), env->immediate_callback_string());
193193
}
194194

195195

196-
static void IdleImmediateDummy(uv_idle_t*, int) {
196+
static void IdleImmediateDummy(uv_idle_t* handle) {
197197
// Do nothing. Only for maintaining event loop.
198198
// TODO(bnoordhuis) Maybe make libuv accept NULL idle callbacks.
199199
}
@@ -2520,13 +2520,13 @@ static void NeedImmediateCallbackSetter(
25202520
}
25212521

25222522

2523-
void SetIdle(uv_prepare_t* handle, int) {
2523+
void SetIdle(uv_prepare_t* handle) {
25242524
Environment* env = Environment::from_idle_prepare_handle(handle);
25252525
env->isolate()->GetCpuProfiler()->SetIdle(true);
25262526
}
25272527

25282528

2529-
void ClearIdle(uv_check_t* handle, int) {
2529+
void ClearIdle(uv_check_t* handle) {
25302530
Environment* env = Environment::from_idle_check_handle(handle);
25312531
env->isolate()->GetCpuProfiler()->SetIdle(false);
25322532
}
@@ -3103,7 +3103,7 @@ static void EnableDebug(Isolate* isolate, bool wait_connect) {
31033103

31043104

31053105
// Called from the main thread.
3106-
static void DispatchDebugMessagesAsyncCallback(uv_async_t* handle, int status) {
3106+
static void DispatchDebugMessagesAsyncCallback(uv_async_t* handle) {
31073107
if (debugger_running == false) {
31083108
fprintf(stderr, "Starting debugger agent.\n");
31093109
EnableDebug(node_isolate, false);

src/node_watchdog.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ void Watchdog::Run(void* arg) {
9393
}
9494

9595

96-
void Watchdog::Async(uv_async_t* async, int status) {
96+
void Watchdog::Async(uv_async_t* async) {
9797
}
9898

9999

100-
void Watchdog::Timer(uv_timer_t* timer, int status) {
100+
void Watchdog::Timer(uv_timer_t* timer) {
101101
V8::TerminateExecution();
102102
}
103103

src/node_watchdog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class Watchdog {
3838
void Destroy();
3939

4040
static void Run(void* arg);
41-
static void Async(uv_async_t* async, int status);
42-
static void Timer(uv_timer_t* timer, int status);
41+
static void Async(uv_async_t* async);
42+
static void Timer(uv_timer_t* timer);
4343

4444
uv_thread_t thread_;
4545
uv_loop_t* loop_;

src/node_win32_etw_provider.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void CodeAddressNotification(const JitCodeEvent* jevent) {
124124
// Note: It is possible to call v8 from ETW thread, but then
125125
// event callbacks are received in the same thread. Attempts
126126
// to write ETW events in this thread will fail.
127-
void etw_events_change_async(uv_async_t* handle, int status) {
127+
void etw_events_change_async(uv_async_t* handle) {
128128
if (events_enabled > 0) {
129129
NODE_V8SYMBOL_RESET();
130130
V8::SetJitCodeEventHandler(v8::kJitCodeEventEnumExisting,

src/spawn_sync.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,7 @@ void SyncProcessRunner::OnExit(int64_t exit_status, int term_signal) {
617617
}
618618

619619

620-
void SyncProcessRunner::OnKillTimerTimeout(int status) {
621-
assert(status == 0);
620+
void SyncProcessRunner::OnKillTimerTimeout() {
622621
SetError(UV_ETIMEDOUT);
623622
Kill();
624623
}
@@ -1037,9 +1036,9 @@ void SyncProcessRunner::ExitCallback(uv_process_t* handle,
10371036
}
10381037

10391038

1040-
void SyncProcessRunner::KillTimerCallback(uv_timer_t* handle, int status) {
1039+
void SyncProcessRunner::KillTimerCallback(uv_timer_t* handle) {
10411040
SyncProcessRunner* self = reinterpret_cast<SyncProcessRunner*>(handle->data);
1042-
self->OnKillTimerTimeout(status);
1041+
self->OnKillTimerTimeout();
10431042
}
10441043

10451044

src/spawn_sync.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class SyncProcessRunner {
174174
void IncrementBufferSizeAndCheckOverflow(ssize_t length);
175175

176176
void OnExit(int64_t exit_status, int term_signal);
177-
void OnKillTimerTimeout(int status);
177+
void OnKillTimerTimeout();
178178

179179
int GetError();
180180
void SetError(int error);
@@ -202,7 +202,7 @@ class SyncProcessRunner {
202202
static void ExitCallback(uv_process_t* handle,
203203
int64_t exit_status,
204204
int term_signal);
205-
static void KillTimerCallback(uv_timer_t* handle, int status);
205+
static void KillTimerCallback(uv_timer_t* handle);
206206
static void KillTimerCloseCallback(uv_handle_t* handle);
207207

208208
size_t max_buffer_;

src/timer_wrap.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,12 @@ class TimerWrap : public HandleWrap {
144144
args.GetReturnValue().Set(static_cast<double>(repeat));
145145
}
146146

147-
static void OnTimeout(uv_timer_t* handle, int status) {
147+
static void OnTimeout(uv_timer_t* handle) {
148148
TimerWrap* wrap = static_cast<TimerWrap*>(handle->data);
149149
Environment* env = wrap->env();
150150
HandleScope handle_scope(env->isolate());
151151
Context::Scope context_scope(env->context());
152-
Local<Value> argv[1] = { Integer::New(env->isolate(), status) };
153-
wrap->MakeCallback(kOnTimeout, ARRAY_SIZE(argv), argv);
152+
wrap->MakeCallback(kOnTimeout, 0, NULL);
154153
}
155154

156155
static void Now(const FunctionCallbackInfo<Value>& args) {

0 commit comments

Comments
 (0)