mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1200969 - Fix timing issue in PresentationRequestUIGlue. r=fabrice
This commit is contained in:
parent
e7f7e9f776
commit
62c81a2eea
@ -4,6 +4,10 @@
|
||||
|
||||
"use strict"
|
||||
|
||||
function debug(aMsg) {
|
||||
//dump("-*- PresentationRequestUIGlue: " + aMsg + "\n");
|
||||
}
|
||||
|
||||
const { interfaces: Ci, utils: Cu, classes: Cc } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
@ -30,9 +34,10 @@ function PresentationRequestUIGlue() {
|
||||
return;
|
||||
}
|
||||
|
||||
let sessionId = detail.sessionId;
|
||||
let sessionId = detail.id;
|
||||
let resolver = this._resolvers[sessionId];
|
||||
if (!resolver) {
|
||||
debug("No correspondent resolver for session ID: " + sessionId);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -44,13 +49,13 @@ function PresentationRequestUIGlue() {
|
||||
PresentationRequestUIGlue.prototype = {
|
||||
|
||||
sendRequest: function(aUrl, aSessionId) {
|
||||
SystemAppProxy._sendCustomEvent("mozPresentationChromeEvent",
|
||||
{ type: "presentation-launch-receiver",
|
||||
url: aUrl,
|
||||
id: aSessionId });
|
||||
|
||||
return new Promise(function(aResolve, aReject) {
|
||||
this._resolvers[aSessionId] = aResolve;
|
||||
|
||||
SystemAppProxy._sendCustomEvent("mozPresentationChromeEvent",
|
||||
{ type: "presentation-launch-receiver",
|
||||
url: aUrl,
|
||||
id: aSessionId });
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
|
@ -28,7 +28,7 @@ addMessageListener('trigger-ui-glue', function(aData) {
|
||||
addMessageListener('trigger-presentation-content-event', function(aData) {
|
||||
var detail = {
|
||||
type: 'presentation-receiver-launched',
|
||||
sessionId: aData.sessionId,
|
||||
id: aData.sessionId,
|
||||
frame: aData.frame
|
||||
};
|
||||
SystemAppProxy._sendCustomEvent('mozPresentationContentEvent', detail);
|
||||
|
Loading…
Reference in New Issue
Block a user