]> khamidou — GitHub mirrors - electron.git/commitdiff
Don't make setImmediate a local variable
authorCheng Zhao <zcbenz@gmail.com>
Tue, 22 Sep 2015 06:29:21 +0000 (14:29 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 22 Sep 2015 06:29:21 +0000 (14:29 +0800)
It makes more troubles than benefits, and somehow it is slowing message
loop down.

atom/common/lib/init.coffee
vendor/node

index 4bc3e36986c09bb238e95a5238f7ffe335b50ba2..5db6b7dcbbe050673dace7fcc2eaa3c6e898a1f2 100644 (file)
@@ -37,6 +37,8 @@ wrapWithActivateUvLoop = (func) ->
     process.activateUvLoop()
     func.apply this, arguments
 process.nextTick = wrapWithActivateUvLoop process.nextTick
+global.setImmediate = wrapWithActivateUvLoop timers.setImmediate
+global.clearImmediate = timers.clearImmediate
 
 if process.type is 'browser'
   # setTimeout needs to update the polling timeout of the event loop, when
@@ -45,10 +47,3 @@ if process.type is 'browser'
   # recalculate the timeout in browser process.
   global.setTimeout = wrapWithActivateUvLoop timers.setTimeout
   global.setInterval = wrapWithActivateUvLoop timers.setInterval
-  global.setImmediate = wrapWithActivateUvLoop timers.setImmediate
-  global.clearImmediate = wrapWithActivateUvLoop timers.clearImmediate
-else
-  # There are no setImmediate under renderer process by default, so we need to
-  # manually setup them here.
-  global.setImmediate = setImmediate
-  global.clearImmediate = clearImmediate
index aa9c7a2316ba7762f1d04d091585695be3e6be22..fa54694af4350bf1720ff47e97a07c7c09325ee2 160000 (submodule)
@@ -1 +1 @@
-Subproject commit aa9c7a2316ba7762f1d04d091585695be3e6be22
+Subproject commit fa54694af4350bf1720ff47e97a07c7c09325ee2