mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 01:48:05 +00:00
Bug 1481025: Fix devtools code which calls message manager methods with a null target. r=ochameau
MozReview-Commit-ID: KJeQjwhfJbw --HG-- extra : rebase_source : 682a0007b1fa802643e5ec43e0ff40db8efded03
This commit is contained in:
parent
637cac1ea7
commit
7ce09e1fd8
@ -753,8 +753,7 @@ StorageActors.createActor({
|
||||
return;
|
||||
}
|
||||
|
||||
const { sendSyncMessage, addMessageListener } =
|
||||
this.conn.parentMessageManager;
|
||||
const mm = this.conn.parentMessageManager;
|
||||
|
||||
this.conn.setupInParent({
|
||||
module: "devtools/server/actors/storage",
|
||||
@ -776,11 +775,11 @@ StorageActors.createActor({
|
||||
this.removeAllSessionCookies =
|
||||
callParentProcess.bind(null, "removeAllSessionCookies");
|
||||
|
||||
addMessageListener("debug:storage-cookie-request-child",
|
||||
cookieHelpers.handleParentRequest);
|
||||
mm.addMessageListener("debug:storage-cookie-request-child",
|
||||
cookieHelpers.handleParentRequest);
|
||||
|
||||
function callParentProcess(methodName, ...args) {
|
||||
const reply = sendSyncMessage("debug:storage-cookie-request-parent", {
|
||||
const reply = mm.sendSyncMessage("debug:storage-cookie-request-parent", {
|
||||
method: methodName,
|
||||
args: args
|
||||
});
|
||||
@ -1897,8 +1896,7 @@ StorageActors.createActor({
|
||||
return;
|
||||
}
|
||||
|
||||
const { sendAsyncMessage, addMessageListener } =
|
||||
this.conn.parentMessageManager;
|
||||
const mm = this.conn.parentMessageManager;
|
||||
|
||||
this.conn.setupInParent({
|
||||
module: "devtools/server/actors/storage",
|
||||
@ -1914,7 +1912,7 @@ StorageActors.createActor({
|
||||
this.removeDBRecord = callParentProcessAsync.bind(null, "removeDBRecord");
|
||||
this.clearDBStore = callParentProcessAsync.bind(null, "clearDBStore");
|
||||
|
||||
addMessageListener("debug:storage-indexedDB-request-child", msg => {
|
||||
mm.addMessageListener("debug:storage-indexedDB-request-child", msg => {
|
||||
switch (msg.json.method) {
|
||||
case "backToChild": {
|
||||
const [func, rv] = msg.json.args;
|
||||
@ -1938,7 +1936,7 @@ StorageActors.createActor({
|
||||
|
||||
unresolvedPromises.set(methodName, deferred);
|
||||
|
||||
sendAsyncMessage("debug:storage-indexedDB-request-parent", {
|
||||
mm.sendAsyncMessage("debug:storage-indexedDB-request-parent", {
|
||||
method: methodName,
|
||||
args: args
|
||||
});
|
||||
|
@ -1853,9 +1853,7 @@ DebuggerServerConnection.prototype = {
|
||||
return false;
|
||||
}
|
||||
|
||||
const { sendSyncMessage } = this.parentMessageManager;
|
||||
|
||||
return sendSyncMessage("debug:setup-in-parent", {
|
||||
return this.parentMessageManager.sendSyncMessage("debug:setup-in-parent", {
|
||||
prefix: this.prefix,
|
||||
module: module,
|
||||
setupParent: setupParent
|
||||
@ -1882,21 +1880,20 @@ DebuggerServerConnection.prototype = {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { addMessageListener, removeMessageListener, sendAsyncMessage } =
|
||||
this.parentMessageManager;
|
||||
const mm = this.parentMessageManager;
|
||||
|
||||
const onResponse = new Promise(done => {
|
||||
const listener = msg => {
|
||||
if (msg.json.prefix != this.prefix) {
|
||||
return;
|
||||
}
|
||||
removeMessageListener("debug:spawn-actor-in-parent:actor", listener);
|
||||
mm.removeMessageListener("debug:spawn-actor-in-parent:actor", listener);
|
||||
done(msg.json.actorID);
|
||||
};
|
||||
addMessageListener("debug:spawn-actor-in-parent:actor", listener);
|
||||
mm.addMessageListener("debug:spawn-actor-in-parent:actor", listener);
|
||||
});
|
||||
|
||||
sendAsyncMessage("debug:spawn-actor-in-parent", {
|
||||
mm.sendAsyncMessage("debug:spawn-actor-in-parent", {
|
||||
prefix: this.prefix,
|
||||
module,
|
||||
constructor,
|
||||
|
Loading…
Reference in New Issue
Block a user