Use // for multi-line comments
This commit is contained in:
parent
f4af744519
commit
990dc30e8d
15 changed files with 65 additions and 138 deletions
|
@ -27,15 +27,12 @@ if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) {
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
setImmediate and process.nextTick makes use of uv_check and uv_prepare to
|
||||
run the callbacks, however since we only run uv loop on requests, the
|
||||
callbacks wouldn't be called until something else activated the uv loop,
|
||||
which would delay the callbacks for arbitrary long time. So we should
|
||||
initiatively activate the uv loop once setImmediate and process.nextTick is
|
||||
called.
|
||||
*/
|
||||
|
||||
// setImmediate and process.nextTick makes use of uv_check and uv_prepare to
|
||||
// run the callbacks, however since we only run uv loop on requests, the
|
||||
// callbacks wouldn't be called until something else activated the uv loop,
|
||||
// which would delay the callbacks for arbitrary long time. So we should
|
||||
// initiatively activate the uv loop once setImmediate and process.nextTick is
|
||||
// called.
|
||||
wrapWithActivateUvLoop = function(func) {
|
||||
return function() {
|
||||
process.activateUvLoop();
|
||||
|
@ -51,12 +48,10 @@ global.clearImmediate = timers.clearImmediate;
|
|||
|
||||
if (process.type === 'browser') {
|
||||
|
||||
/*
|
||||
setTimeout needs to update the polling timeout of the event loop, when
|
||||
called under Chromium's event loop the node's event loop won't get a chance
|
||||
to update the timeout, so we have to force the node's event loop to
|
||||
recalculate the timeout in browser process.
|
||||
*/
|
||||
// setTimeout needs to update the polling timeout of the event loop, when
|
||||
// called under Chromium's event loop the node's event loop won't get a chance
|
||||
// to update the timeout, so we have to force the node's event loop to
|
||||
// recalculate the timeout in browser process.
|
||||
global.setTimeout = wrapWithActivateUvLoop(timers.setTimeout);
|
||||
global.setInterval = wrapWithActivateUvLoop(timers.setInterval);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue