зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1287626,1288279 - Make IDs unique across processes r=billm
MozReview-Commit-ID: 78xgt8wqbng --HG-- extra : rebase_source : 2f88ba3d4c8198038f2ce3f849bad2baca48df4a
This commit is contained in:
Родитель
a342c4d816
Коммит
0765167097
|
@ -166,7 +166,7 @@ class BaseContext {
|
||||||
this.onClose = new Set();
|
this.onClose = new Set();
|
||||||
this.checkedLastError = false;
|
this.checkedLastError = false;
|
||||||
this._lastError = null;
|
this._lastError = null;
|
||||||
this.contextId = ++gContextId;
|
this.contextId = `${++gContextId}-${Services.appinfo.uniqueProcessID}`;
|
||||||
this.unloaded = false;
|
this.unloaded = false;
|
||||||
this.extensionId = extensionId;
|
this.extensionId = extensionId;
|
||||||
this.jsonSandbox = null;
|
this.jsonSandbox = null;
|
||||||
|
@ -1334,8 +1334,7 @@ Messenger.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
connect(messageManager, name, recipient) {
|
connect(messageManager, name, recipient) {
|
||||||
// TODO(robwu): Use a process ID instead of the process type. bugzil.la/1287626
|
let portId = `${gNextPortId++}-${Services.appinfo.uniqueProcessID}`;
|
||||||
let portId = `${gNextPortId++}-${Services.appinfo.processType}`;
|
|
||||||
let port = new Port(this.context, messageManager, name, portId, null);
|
let port = new Port(this.context, messageManager, name, portId, null);
|
||||||
let msg = {name, portId};
|
let msg = {name, portId};
|
||||||
this._sendMessage(messageManager, "Extension:Connect", msg, recipient)
|
this._sendMessage(messageManager, "Extension:Connect", msg, recipient)
|
||||||
|
|
|
@ -497,7 +497,7 @@ this.MessageChannel = {
|
||||||
let recipient = options.recipient || {};
|
let recipient = options.recipient || {};
|
||||||
let responseType = options.responseType || this.RESPONSE_SINGLE;
|
let responseType = options.responseType || this.RESPONSE_SINGLE;
|
||||||
|
|
||||||
let channelId = gChannelId++;
|
let channelId = `${gChannelId++}-${Services.appinfo.uniqueProcessID}`;
|
||||||
let message = {messageName, channelId, sender, recipient, data, responseType};
|
let message = {messageName, channelId, sender, recipient, data, responseType};
|
||||||
|
|
||||||
let deferred = PromiseUtils.defer();
|
let deferred = PromiseUtils.defer();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче