Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Using ipc.guid() to avoid duplication
Browse files Browse the repository at this point in the history
Auditor: @bridiver
  • Loading branch information
darkdh committed Oct 14, 2017
1 parent 762c1ae commit 3a9b420
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions atom/common/api/resources/windows_bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ binding.registerCustomHook(function (bindingsAPI, extensionId) {
})

apiFunctions.setHandleRequest('create', function (createData, cb) {
var responseId = ++id
var responseId = ipc.guid()
cb && ipc.once('chrome-windows-create-response-' + responseId, function (evt, win, error) {
if (error) {
lastError.run('windows.create', error, '', cb)
Expand All @@ -42,7 +42,7 @@ binding.registerCustomHook(function (bindingsAPI, extensionId) {
cb = arguments[1]
}

var responseId = ++id
var responseId = ipc.guid()
ipc.once('chrome-windows-get-current-response-' + responseId, function (evt, win) {
cb(win)
})
Expand All @@ -57,15 +57,15 @@ binding.registerCustomHook(function (bindingsAPI, extensionId) {
cb = arguments[1]
}

var responseId = ++id
var responseId = ipc.guid()
ipc.once('chrome-windows-get-all-response-' + responseId, function (evt, win) {
cb(win)
})
ipc.send('chrome-windows-get-all', responseId, getInfo)
})

apiFunctions.setHandleRequest('update', function (windowId, updateInfo, cb) {
var responseId = ++id
var responseId = ipc.guid()
cb && ipc.once('chrome-windows-update-response-' + responseId, function (evt, win) {
cb(win)
})
Expand Down

0 comments on commit 3a9b420

Please sign in to comment.