forked from electron/electron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add data parameter to
app.requestSingleInstanceLock()
(electr…
…on#30891) * WIP * Use serialization * Rebase windows impl of new app requestSingleInstanceLock parameter * Fix test * Implement posix side * Add backwards compatibility test * Apply PR feedback Windows * Fix posix impl * Switch mac impl back to vector * Refactor Windows impl * Use vectors, inline make_span * Use blink converter * fix: ownership across sequences * Fix upstream merge from Chromium Co-authored-by: deepak1556 <hop2deep@gmail.com>
- Loading branch information
Showing
9 changed files
with
442 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
343 changes: 343 additions & 0 deletions
343
patches/chromium/feat_add_data_parameter_to_processsingleton.patch
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
const { app } = require('electron'); | ||
|
||
app.whenReady().then(() => { | ||
console.log('started'); // ping parent | ||
}); | ||
|
||
const obj = { | ||
level: 1, | ||
testkey: 'testvalue1', | ||
inner: { | ||
level: 2, | ||
testkey: 'testvalue2' | ||
} | ||
}; | ||
const gotTheLock = app.requestSingleInstanceLock(obj); | ||
|
||
app.on('second-instance', (event, args, workingDirectory, data) => { | ||
setImmediate(() => { | ||
console.log([JSON.stringify(args), JSON.stringify(data)].join('||')); | ||
app.exit(0); | ||
}); | ||
}); | ||
|
||
if (!gotTheLock) { | ||
app.exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "electron-app-singleton-data", | ||
"main": "main.js" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters