diff --git a/toolkit/components/extensions/ExtensionUtils.jsm b/toolkit/components/extensions/ExtensionUtils.jsm index af70256a9715..2152b9d5c735 100644 --- a/toolkit/components/extensions/ExtensionUtils.jsm +++ b/toolkit/components/extensions/ExtensionUtils.jsm @@ -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) diff --git a/toolkit/components/extensions/MessageChannel.jsm b/toolkit/components/extensions/MessageChannel.jsm index f36566e4a85e..106d8c0294f9 100644 --- a/toolkit/components/extensions/MessageChannel.jsm +++ b/toolkit/components/extensions/MessageChannel.jsm @@ -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();