Bug 1657242 - Report telemetry for Yellow Screen of Death. r=peterv

Differential Revision: https://phabricator.services.mozilla.com/D85951
This commit is contained in:
Zibi Braniecki
2020-08-10 17:38:00 +00:00
parent 26c0436d35
commit 4d065c3acf
6 changed files with 90 additions and 0 deletions

View File

@@ -28,6 +28,8 @@
#include "mozilla/BasePrincipal.h"
#include "mozilla/IntegerTypeTraits.h"
#include "mozilla/NullPrincipal.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TelemetryComms.h"
#include "mozilla/Logging.h"
@@ -755,6 +757,16 @@ nsresult nsExpatDriver::HandleError() {
if (mOriginalSink) {
doc = do_QueryInterface(mOriginalSink->GetTarget());
}
if (doc && nsContentUtils::IsChromeDoc(doc)) {
nsCString path = doc->GetDocumentURI()->GetSpecOrDefault();
mozilla::Telemetry::SetEventRecordingEnabled("ysod"_ns, true);
mozilla::Telemetry::RecordEvent(
mozilla::Telemetry::EventID::Ysod_Shown_Ysod, mozilla::Some(path),
mozilla::Nothing());
}
bool spoofEnglish =
nsContentUtils::SpoofLocaleEnglish() && (!doc || !doc->AllowsL10n());
nsParserMsgUtils::GetLocalizedStringByID(