Bug 1287626,1288279 - Make IDs unique across processes r=billm

MozReview-Commit-ID: 78xgt8wqbng

--HG--
extra : rebase_source : 2f88ba3d4c8198038f2ce3f849bad2baca48df4a
This commit is contained in:
Rob Wu 2016-08-10 16:23:56 -07:00
Родитель a342c4d816
Коммит 0765167097
2 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -166,7 +166,7 @@ class BaseContext {
this.onClose = new Set();
this.checkedLastError = false;
this._lastError = null;
this.contextId = ++gContextId;
this.contextId = `${++gContextId}-${Services.appinfo.uniqueProcessID}`;
this.unloaded = false;
this.extensionId = extensionId;
this.jsonSandbox = null;
@ -1334,8 +1334,7 @@ Messenger.prototype = {
},
connect(messageManager, name, recipient) {
// TODO(robwu): Use a process ID instead of the process type. bugzil.la/1287626
let portId = `${gNextPortId++}-${Services.appinfo.processType}`;
let portId = `${gNextPortId++}-${Services.appinfo.uniqueProcessID}`;
let port = new Port(this.context, messageManager, name, portId, null);
let msg = {name, portId};
this._sendMessage(messageManager, "Extension:Connect", msg, recipient)

Просмотреть файл

@ -497,7 +497,7 @@ this.MessageChannel = {
let recipient = options.recipient || {};
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 deferred = PromiseUtils.defer();