Backed out changeset 75d0e51772db (bug 1211665) because it wasn't supposed to land

MozReview-Commit-ID: AJlDqbYWN2b
This commit is contained in:
Wes Kocher 2016-04-01 10:53:07 -07:00
Родитель 3fd9c37a6a
Коммит c728792374
3 изменённых файлов: 9 добавлений и 34 удалений

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

@ -316,7 +316,7 @@ update(AddonConsoleActor.prototype, {
case "ConsoleAPI":
if (!this.consoleAPIListener) {
this.consoleAPIListener =
new ConsoleAPIListener(null, this, { addonId: this.addon.id });
new ConsoleAPIListener(null, this, "addon/" + this.addon.id);
this.consoleAPIListener.init();
}
startedListeners.push(listener);

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

@ -67,7 +67,7 @@ function run_test() {
listener.destroy();
listener = new ConsoleAPIListener(null, callback, {consoleID: "foo"});
listener = new ConsoleAPIListener(null, callback, "foo");
listener.init();
messages = listener.getCachedMessages();

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

@ -794,14 +794,12 @@ ConsoleServiceListener.prototype =
* - onConsoleAPICall(). This method is invoked with one argument, the
* Console API message that comes from the observer service, whenever
* a relevant console API call is received.
* @param object filteringOptions
* Options - The filteringOptions that this listener should listen to
(e.g. { addonId: "..." } or { consoleID: "..." }).
* @param string consoleID
* Options - The consoleID that this listener should listen to
*/
function ConsoleAPIListener(window, owner, {addonId, consoleID} = {}) {
function ConsoleAPIListener(window, owner, consoleID) {
this.window = window;
this.owner = owner;
this.addonId = addonId;
this.consoleID = consoleID;
}
exports.ConsoleAPIListener = ConsoleAPIListener;
@ -827,10 +825,10 @@ ConsoleAPIListener.prototype =
owner: null,
/**
* The addonId that we listen for. If not null then only messages from this
* The consoleID that we listen for. If not null then only messages from this
* console will be returned.
*/
addonId: null,
consoleID: null,
/**
* Initialize the window.console API observer.
@ -898,31 +896,8 @@ ConsoleAPIListener.prototype =
}
}
if (this.consoleID) {
// Filtering based on the old-style consoleID property used by
// the legacy Console JSM module.
if (message.consoleID !== this.consoleID) {
return false;
}
}
if (this.addonId) {
if (!message.consoleID && !message.originAttributes) {
return false;
}
// Filtering based on the old-style consoleID property used by
// the legacy Console JSM module.
if (message.consoleID && message.consoleID !== `addon/${this.addonId}`) {
return false;
}
// Filtering based on the originAttributes used by
// the Console API object.
if (message.originAttributes &&
message.originAttributes.addonId !== this.addonId) {
return false;
}
if (this.consoleID && message.consoleID !== this.consoleID) {
return false;
}
return true;