Bug 1485671 - Expose and use TabClient.logInPage instead of sending request manually. r=yulia

Differential Revision: https://phabricator.services.mozilla.com/D6272

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alexandre Poirot 2018-09-20 07:50:54 +00:00
parent 0f4ffbd8c2
commit 036563e90b
2 changed files with 9 additions and 16 deletions

View File

@ -723,14 +723,7 @@ TabTarget.prototype = {
logErrorInPage: function(text, category) {
if (this.activeTab && this.activeTab.traits.logInPage) {
const errorFlag = 0;
const packet = {
to: this.form.actor,
type: "logInPage",
flags: errorFlag,
text,
category,
};
this.client.request(packet);
this.activeTab.logInPage(text, category, errorFlag);
}
},
@ -745,14 +738,7 @@ TabTarget.prototype = {
logWarningInPage: function(text, category) {
if (this.activeTab && this.activeTab.traits.logInPage) {
const warningFlag = 1;
const packet = {
to: this.form.actor,
type: "logInPage",
flags: warningFlag,
text,
category,
};
this.client.request(packet);
this.activeTab.logInPage(text, category, warningFlag);
}
},
};

View File

@ -140,6 +140,13 @@ TabClient.prototype = {
attachWorker: function(workerTargetActor) {
return this.client.attachWorker(workerTargetActor);
},
logInPage: DebuggerClient.requester({
type: "logInPage",
text: arg(0),
category: arg(1),
flags: arg(2),
}),
};
eventSource(TabClient.prototype);