Avoid using processId and routingId directly.
This commit is contained in:
parent
23ccad4915
commit
1bba15cb7f
4 changed files with 26 additions and 39 deletions
|
@ -7,10 +7,14 @@ module.exports.wrap = (webContents) ->
|
|||
# webContents is an EventEmitter.
|
||||
webContents.__proto__ = EventEmitter.prototype
|
||||
|
||||
# Add the send method.
|
||||
# WebContents::send(channel, args..)
|
||||
webContents.send = (args...) ->
|
||||
@_send 'ATOM_INTERNAL_MESSAGE', [args...]
|
||||
|
||||
# The processId and routingId and identify a webContents.
|
||||
webContents.getId = -> "#{@getProcessId()}-#{@getRoutingId()}"
|
||||
webContents.equal = (other) -> @getId() is other.getId()
|
||||
|
||||
# Dispatch IPC messages to the ipc module.
|
||||
webContents.on 'ipc-message', (event, channel, args...) =>
|
||||
Object.defineProperty event, 'sender', value: webContents
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue