зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1594391. Move PrintingChild.jsm print telemetry logging to the parent process. r=Gijs,chutten
Differential Revision: https://phabricator.services.mozilla.com/D51992 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
97ee7956bf
Коммит
ce8382d606
|
@ -388,25 +388,9 @@ class PrintingChild extends ActorChild {
|
|||
}
|
||||
|
||||
try {
|
||||
let print = contentWindow.getInterface(Ci.nsIWebBrowserPrint);
|
||||
|
||||
if (print.doingPrintPreview) {
|
||||
this.logKeyedTelemetry("PRINT_DIALOG_OPENED_COUNT", "FROM_PREVIEW");
|
||||
} else {
|
||||
this.logKeyedTelemetry("PRINT_DIALOG_OPENED_COUNT", "FROM_PAGE");
|
||||
}
|
||||
|
||||
print.print(printSettings, null);
|
||||
|
||||
if (print.doingPrintPreview) {
|
||||
if (simplifiedMode) {
|
||||
this.logKeyedTelemetry("PRINT_COUNT", "SIMPLIFIED");
|
||||
} else {
|
||||
this.logKeyedTelemetry("PRINT_COUNT", "WITH_PREVIEW");
|
||||
}
|
||||
} else {
|
||||
this.logKeyedTelemetry("PRINT_COUNT", "WITHOUT_PREVIEW");
|
||||
}
|
||||
contentWindow
|
||||
.getInterface(Ci.nsIWebBrowserPrint)
|
||||
.print(printSettings, null);
|
||||
} catch (e) {
|
||||
// Pressing cancel is expressed as an NS_ERROR_ABORT return value,
|
||||
// causing an exception to be thrown which we catch here.
|
||||
|
@ -443,11 +427,6 @@ class PrintingChild extends ActorChild {
|
|||
}
|
||||
}
|
||||
|
||||
logKeyedTelemetry(id, key) {
|
||||
let histogram = Services.telemetry.getKeyedHistogramById(id);
|
||||
histogram.add(key);
|
||||
}
|
||||
|
||||
updatePageCount() {
|
||||
let numPages = this.docShell.initOrReusePrintPreviewViewer()
|
||||
.printPreviewNumPages;
|
||||
|
|
|
@ -132,11 +132,31 @@ var PrintUtils = {
|
|||
* The <xul:browser> that the nsIDOMWindow for aWindowID belongs to.
|
||||
*/
|
||||
printWindow(aWindowID, aBrowser) {
|
||||
const printPreviewIsOpen = !!document.getElementById(
|
||||
"print-preview-toolbar"
|
||||
);
|
||||
|
||||
if (printPreviewIsOpen) {
|
||||
this._logKeyedTelemetry("PRINT_DIALOG_OPENED_COUNT", "FROM_PREVIEW");
|
||||
} else {
|
||||
this._logKeyedTelemetry("PRINT_DIALOG_OPENED_COUNT", "FROM_PAGE");
|
||||
}
|
||||
|
||||
aBrowser.messageManager.sendAsyncMessage("Printing:Print", {
|
||||
windowID: aWindowID,
|
||||
simplifiedMode: this._shouldSimplify,
|
||||
defaultPrinterName: this._getDefaultPrinterName(),
|
||||
});
|
||||
|
||||
if (printPreviewIsOpen) {
|
||||
if (this._shouldSimplify) {
|
||||
this._logKeyedTelemetry("PRINT_COUNT", "SIMPLIFIED");
|
||||
} else {
|
||||
this._logKeyedTelemetry("PRINT_COUNT", "WITH_PREVIEW");
|
||||
}
|
||||
} else {
|
||||
this._logKeyedTelemetry("PRINT_COUNT", "WITHOUT_PREVIEW");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -683,6 +703,11 @@ var PrintUtils = {
|
|||
histogram.add(true);
|
||||
},
|
||||
|
||||
_logKeyedTelemetry(id, key) {
|
||||
let histogram = Services.telemetry.getKeyedHistogramById(id);
|
||||
histogram.add(key);
|
||||
},
|
||||
|
||||
onKeyDownPP(aEvent) {
|
||||
// Esc exits the PP
|
||||
if (aEvent.keyCode == aEvent.DOM_VK_ESCAPE) {
|
||||
|
|
|
@ -9284,10 +9284,10 @@
|
|||
"description": "A counter incremented every time the simplified mode is unavailable on print preview."
|
||||
},
|
||||
"PRINT_DIALOG_OPENED_COUNT": {
|
||||
"record_in_processes": ["main", "content"],
|
||||
"record_in_processes": ["main"],
|
||||
"products": ["firefox", "fennec", "geckoview"],
|
||||
"alert_emails": ["carnold@mozilla.org"],
|
||||
"bug_numbers": [1306624, 1568968],
|
||||
"alert_emails": ["jwatt@jwatt.org"],
|
||||
"bug_numbers": [1306624, 1568968, 1594391],
|
||||
"expires_in_version": "never",
|
||||
"kind": "count",
|
||||
"keyed": true,
|
||||
|
@ -9295,10 +9295,10 @@
|
|||
"description": "A counter incremented every time the user opens print dialog."
|
||||
},
|
||||
"PRINT_COUNT": {
|
||||
"record_in_processes": ["main", "content"],
|
||||
"record_in_processes": ["main"],
|
||||
"products": ["firefox", "fennec", "geckoview"],
|
||||
"alert_emails": ["carnold@mozilla.org"],
|
||||
"bug_numbers": [1287587, 1568968],
|
||||
"alert_emails": ["jwatt@jwatt.org"],
|
||||
"bug_numbers": [1287587, 1568968, 1594391],
|
||||
"expires_in_version": "never",
|
||||
"kind": "count",
|
||||
"keyed": true,
|
||||
|
|
Загрузка…
Ссылка в новой задаче