2021-02-16 15:11:07 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
|
|
Date: Thu, 20 Sep 2018 17:45:47 -0700
|
|
|
|
Subject: fix: disable unload metrics
|
|
|
|
|
|
|
|
Chromium introduced unload metrics in:
|
|
|
|
https://chromium-review.googlesource.com/c/chromium/src/+/2314877
|
|
|
|
|
|
|
|
Which would cause some DCHECKs to assert in Electron:
|
|
|
|
https://github.com/electron/electron/issues/27717
|
|
|
|
|
|
|
|
And it would then crash and make some tests fail:
|
|
|
|
crashReporter module should send minidump when sandboxed renderer crashes api-crash-reporter-spec.ts 643 ms
|
|
|
|
Error message:
|
|
|
|
ptype: expected 'browser' to equal 'renderer'
|
|
|
|
Error stack trace:
|
|
|
|
AssertionError: ptype: expected 'browser' to equal 'renderer'
|
2022-08-16 19:23:13 +00:00
|
|
|
at checkCrash (electron\spec\api-crash-reporter-spec.ts:39:35)
|
|
|
|
at Context.<anonymous> (electron\spec\api-crash-reporter-spec.ts:154:7)
|
2021-02-16 15:11:07 +00:00
|
|
|
at runMicrotasks (<anonymous>)
|
|
|
|
at processTicksAndRejections (internal/process/task_queues.js:93:5)
|
|
|
|
|
|
|
|
This patch temporarily disables the metrics so we can have green CI, and we
|
|
|
|
should continue seeking for a real fix.
|
|
|
|
|
|
|
|
diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc
|
2024-08-22 18:16:40 +00:00
|
|
|
index 5e216bba01de04bd3b2fb9ee5df6edd8904424f2..98edabd37a1faa35c2ba0413f6a5c3b4f871ff5e 100644
|
2021-02-16 15:11:07 +00:00
|
|
|
--- a/content/browser/renderer_host/navigator.cc
|
|
|
|
+++ b/content/browser/renderer_host/navigator.cc
|
2024-08-22 18:16:40 +00:00
|
|
|
@@ -1347,6 +1347,7 @@ void Navigator::RecordNavigationMetrics(
|
2021-02-16 15:11:07 +00:00
|
|
|
.InMilliseconds());
|
|
|
|
}
|
|
|
|
|
|
|
|
+#if 0
|
|
|
|
// If this is a same-process navigation and we have timestamps for unload
|
|
|
|
// durations, fill those metrics out as well.
|
|
|
|
if (params.unload_start && params.unload_end &&
|
2024-08-22 18:16:40 +00:00
|
|
|
@@ -1396,6 +1397,7 @@ void Navigator::RecordNavigationMetrics(
|
2021-02-16 15:11:07 +00:00
|
|
|
first_before_unload_start_time)
|
|
|
|
.InMilliseconds());
|
|
|
|
}
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
builder.Record(ukm::UkmRecorder::Get());
|
2023-02-03 11:43:42 +00:00
|
|
|
metrics_data_.reset();
|