 c6634b1ea5
			
		
	
	
	c6634b1ea5
	
	
	
		
			
			In old days sending sync message to browser process requires pumping message loop in the renderer process, but now in Chrome 47 it is not true anymore. And even when we do it, the Send method may fail sometimes, so this change seems to be required for the Chrome 47 upgrade.
		
			
				
	
	
		
			18 lines
		
	
	
	
		
			473 B
			
		
	
	
	
		
			CoffeeScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
	
		
			473 B
			
		
	
	
	
		
			CoffeeScript
		
	
	
	
	
	
| {EventEmitter} = require 'events'
 | |
| 
 | |
| binding = process.atomBinding 'ipc'
 | |
| v8Util  = process.atomBinding 'v8_util'
 | |
| 
 | |
| # Created by init.coffee.
 | |
| ipcRenderer = v8Util.getHiddenValue global, 'ipc'
 | |
| 
 | |
| ipcRenderer.send = (args...) ->
 | |
|   binding.send 'ipc-message', [args...]
 | |
| 
 | |
| ipcRenderer.sendSync = (args...) ->
 | |
|   JSON.parse binding.sendSync('ipc-message-sync', [args...])
 | |
| 
 | |
| ipcRenderer.sendToHost = (args...) ->
 | |
|   binding.send 'ipc-message-host', [args...]
 | |
| 
 | |
| module.exports = ipcRenderer
 |