Backed out changeset 48cff1c9b619 (bug 1276390) for xpcshell bustage CLOSED TREE

This commit is contained in:
Wes Kocher
2016-07-28 16:03:23 -07:00
parent 5c31df08d7
commit 70202903b0
8 changed files with 25 additions and 290 deletions

View File

@@ -9,7 +9,7 @@
/* exported SubprocessImpl */
/* globals BaseProcess, PromiseWorker */
/* globals BaseProcess */
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
@@ -24,35 +24,10 @@ Cu.import("resource://gre/modules/subprocess/subprocess_common.jsm");
Services.scriptloader.loadSubScript("resource://gre/modules/subprocess/subprocess_shared.js", this);
Services.scriptloader.loadSubScript("resource://gre/modules/subprocess/subprocess_shared_win.js", this);
class WinPromiseWorker extends PromiseWorker {
constructor(...args) {
super(...args);
this.signalEvent = libc.CreateSemaphoreW(null, 0, 32, null);
this.call("init", [{
signalEvent: String(ctypes.cast(this.signalEvent, ctypes.uintptr_t).value),
}]);
}
signalWorker() {
libc.ReleaseSemaphore(this.signalEvent, 1, null);
}
postMessage(...args) {
this.signalWorker();
return super.postMessage(...args);
}
}
class Process extends BaseProcess {
static get WORKER_URL() {
return "resource://gre/modules/subprocess/subprocess_worker_win.js";
}
static get WorkerClass() {
return WinPromiseWorker;
}
}
var SubprocessWin = {
@@ -62,6 +37,7 @@ var SubprocessWin = {
return Process.create(options);
},
* getEnvironment() {
let env = libc.GetEnvironmentStringsW();
try {