mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1643402: add telemetry probe that collects information on all pdf fallback errors. r=bdahl
Differential Revision: https://phabricator.services.mozilla.com/D78350
This commit is contained in:
parent
b341f73995
commit
082a5e072a
@ -24,13 +24,19 @@ var PdfJsTelemetry = {
|
||||
onViewerIsUsed() {
|
||||
Services.telemetry.scalarAdd("pdf.viewer.used", 1);
|
||||
},
|
||||
onFallback(featureId) {
|
||||
onFallbackShown(featureId) {
|
||||
Services.telemetry.scalarAdd("pdf.viewer.fallback_shown", 1);
|
||||
let histogram = Services.telemetry.getHistogramById(
|
||||
"PDF_VIEWER_FALLBACK_REASON"
|
||||
);
|
||||
histogram.add(featureId ?? "unknown");
|
||||
},
|
||||
onFallbackError(featureId) {
|
||||
let histogram = Services.telemetry.getHistogramById(
|
||||
"PDF_VIEWER_FALLBACK_ERROR"
|
||||
);
|
||||
histogram.add(featureId ?? "unknown");
|
||||
},
|
||||
onDocumentSize(size) {
|
||||
let histogram = Services.telemetry.getHistogramById(
|
||||
"PDF_VIEWER_DOCUMENT_SIZE_KB"
|
||||
|
@ -275,6 +275,7 @@ class ChromeActions {
|
||||
firstPageInfo: false,
|
||||
streamTypesUsed: {},
|
||||
fontTypesUsed: {},
|
||||
fallbackErrorsReported: {},
|
||||
};
|
||||
}
|
||||
|
||||
@ -486,6 +487,14 @@ class ChromeActions {
|
||||
case "print":
|
||||
PdfJsTelemetry.onPrint();
|
||||
break;
|
||||
case "unsupportedFeature":
|
||||
if (!this.telemetryState.fallbackErrorsReported[probeInfo.featureId]) {
|
||||
PdfJsTelemetry.onFallbackError(probeInfo.featureId);
|
||||
this.telemetryState.fallbackErrorsReported[
|
||||
probeInfo.featureId
|
||||
] = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -504,7 +513,7 @@ class ChromeActions {
|
||||
} else {
|
||||
message = getLocalizedString(strings, "unsupported_feature");
|
||||
}
|
||||
PdfJsTelemetry.onFallback(featureId);
|
||||
PdfJsTelemetry.onFallbackShown(featureId);
|
||||
|
||||
// Request the display of a notification warning in the associated window
|
||||
// when the renderer isn't sure a pdf displayed correctly.
|
||||
|
@ -9289,6 +9289,17 @@
|
||||
"labels": ["unknown", "forms", "javaScript", "smask", "shadingPattern", "font", "errorTilingPattern", "errorExtGState", "errorXObject", "errorFontLoadType3", "errorFontState", "errorFontMissing", "errorFontTranslate", "errorColorSpace", "errorOperatorList", "errorFontToUnicode", "errorFontLoadNative", "errorFontGetPath"],
|
||||
"description": "The reason the fallback bar was shown."
|
||||
},
|
||||
"PDF_VIEWER_FALLBACK_ERROR": {
|
||||
"record_in_processes": ["main", "content"],
|
||||
"products": ["firefox"],
|
||||
"expires_in_version": "84",
|
||||
"alert_emails": ["bdahl@mozilla.com"],
|
||||
"releaseChannelCollection": "opt-out",
|
||||
"bug_numbers": [1643402],
|
||||
"kind": "categorical",
|
||||
"labels": ["unknown", "forms", "javaScript", "smask", "shadingPattern", "font", "errorTilingPattern", "errorExtGState", "errorXObject", "errorFontLoadType3", "errorFontState", "errorFontMissing", "errorFontTranslate", "errorColorSpace", "errorOperatorList", "errorFontToUnicode", "errorFontLoadNative", "errorFontGetPath"],
|
||||
"description": "All errors that could trigger the fallback bar, even after the bar is shown."
|
||||
},
|
||||
"PLUGINS_NOTIFICATION_SHOWN": {
|
||||
"record_in_processes": ["main", "content"],
|
||||
"products": ["firefox", "fennec", "geckoview"],
|
||||
|
Loading…
Reference in New Issue
Block a user