mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1107706: Part 14: Fix quitApplication
This commit is contained in:
parent
a3c22d4b07
commit
40da952834
@ -31,8 +31,10 @@ const uuidGen = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerat
|
||||
* @param {function(Emulator): GeckoDriver} driverFactory
|
||||
* A factory function that takes an Emulator as argument and produces
|
||||
* a GeckoDriver.
|
||||
* @param {function()} stopSignal
|
||||
* Signal to stop the Marionette server.
|
||||
*/
|
||||
this.Dispatcher = function(connId, transport, driverFactory) {
|
||||
this.Dispatcher = function(connId, transport, driverFactory, stopSignal) {
|
||||
this.id = connId;
|
||||
this.conn = transport;
|
||||
|
||||
@ -52,6 +54,8 @@ this.Dispatcher = function(connId, transport, driverFactory) {
|
||||
this.emulator = new Emulator(msg => this.sendResponse(msg, -1));
|
||||
this.driver = driverFactory(this.emulator);
|
||||
this.commandProcessor = new CommandProcessor(this.driver);
|
||||
|
||||
this.stopSignal_ = stopSignal;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -125,6 +129,9 @@ Dispatcher.prototype.quitApplication = function(msg) {
|
||||
flags |= Ci.nsIAppStartup[k];
|
||||
}
|
||||
|
||||
this.stopSignal_();
|
||||
this.sendOk(id);
|
||||
|
||||
this.driver.sessionTearDown();
|
||||
Services.startup.quit(flags);
|
||||
};
|
||||
|
@ -145,7 +145,8 @@ MarionetteServer.prototype.onSocketAccepted = function(
|
||||
let transport = new DebuggerTransport(input, output);
|
||||
let connId = "conn" + this.nextConnId++;
|
||||
|
||||
let dispatcher = new Dispatcher(connId, transport, this.driverFactory);
|
||||
let stopSignal = () => this.stop();
|
||||
let dispatcher = new Dispatcher(connId, transport, this.driverFactory, stopSignal);
|
||||
dispatcher.onclose = this.onConnectionClosed.bind(this);
|
||||
this.conns[connId] = dispatcher;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user