disable_unload_metrics.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Cheng Zhao <[email protected]>
  3. Date: Thu, 20 Sep 2018 17:45:47 -0700
  4. Subject: fix: disable unload metrics
  5. Chromium introduced unload metrics in:
  6. https://chromium-review.googlesource.com/c/chromium/src/+/2314877
  7. Which would cause some DCHECKs to assert in Electron:
  8. https://github.com/electron/electron/issues/27717
  9. And it would then crash and make some tests fail:
  10. crashReporter module should send minidump when sandboxed renderer crashes api-crash-reporter-spec.ts 643 ms
  11. Error message:
  12. ptype: expected 'browser' to equal 'renderer'
  13. Error stack trace:
  14. AssertionError: ptype: expected 'browser' to equal 'renderer'
  15. at checkCrash (electron\spec\api-crash-reporter-spec.ts:39:35)
  16. at Context.<anonymous> (electron\spec\api-crash-reporter-spec.ts:154:7)
  17. at runMicrotasks (<anonymous>)
  18. at processTicksAndRejections (internal/process/task_queues.js:93:5)
  19. This patch temporarily disables the metrics so we can have green CI, and we
  20. should continue seeking for a real fix.
  21. diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc
  22. index b88a9d695e2e743cdd9446e8e3c3ca38a914630a..a35f8b3118632d503c5750d59e847580cbb47a9f 100644
  23. --- a/content/browser/renderer_host/navigator.cc
  24. +++ b/content/browser/renderer_host/navigator.cc
  25. @@ -1195,6 +1195,7 @@ void Navigator::RecordNavigationMetrics(
  26. .InMilliseconds());
  27. }
  28. +#if 0
  29. // If this is a same-process navigation and we have timestamps for unload
  30. // durations, fill those metrics out as well.
  31. if (params.unload_start && params.unload_end &&
  32. @@ -1245,6 +1246,7 @@ void Navigator::RecordNavigationMetrics(
  33. first_before_unload_start_time)
  34. .InMilliseconds());
  35. }
  36. +#endif
  37. builder.Record(ukm::UkmRecorder::Get());
  38. navigation_data_.reset();