Cache remote.getCurrentWindow.

This commit is contained in:
Cheng Zhao 2013-05-03 21:14:28 +08:00
parent ec43f740a7
commit 73d4b01597

View file

@ -68,9 +68,11 @@ exports.getObject = (id) ->
metaToValue meta
# Get current window object.
windowCache = null
exports.getCurrentWindow = ->
return windowCache if windowCache?
meta = ipc.sendChannelSync 'ATOM_BROWSER_CURRENT_WINDOW'
metaToValue meta
windowCache = metaToValue meta
# Get a global object in browser.
exports.getGlobal = (name) ->