Implement a watchdog to detect when main thread is not responding
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ce9386ebd62a74afbe15f0fd0f0c10751b14169f commit ce9386ebd62a74afbe15f0fd0f0c10751b14169f Author: Olivier Robin <olivierrobin@chromium.org> Date: Thu Nov 29 09:07:38 2018 [iOS] Detect freeze in main run loop. This CL adds a watchdog to check the main thread responsiveness by posting regular tasks to the main thread and check their execution. If the main thread is not responsive for too long, a "crash" report will be generated and sent on next startup. A NSUserDefault will also be set to allow reporting the freeze on next startup. Bug: 910024 Change-Id: I541b27c993b90e0982227cbe4238a338938d760f Reviewed-on: https://chromium-review.googlesource.com/c/1350958 Commit-Queue: Olivier Robin <olivierrobin@chromium.org> Reviewed-by: Brian White <bcwhite@chromium.org> Reviewed-by: Peter Lee <pkl@chromium.org> Cr-Commit-Position: refs/heads/master@{#612111} [modify] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/ios/chrome/browser/about_flags.mm [modify] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/ios/chrome/browser/crash_report/BUILD.gn [modify] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/ios/chrome/browser/crash_report/breakpad_helper.mm [modify] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/ios/chrome/browser/crash_report/crash_report_flags.cc [modify] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/ios/chrome/browser/crash_report/crash_report_flags.h [add] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/ios/chrome/browser/crash_report/main_thread_freeze_detector.h [add] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/ios/chrome/browser/crash_report/main_thread_freeze_detector.mm [modify] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/ios/chrome/browser/ios_chrome_flag_descriptions.cc [modify] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/ios/chrome/browser/ios_chrome_flag_descriptions.h [modify] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/ios/chrome/browser/metrics/mobile_session_shutdown_metrics_provider.h [modify] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/ios/chrome/browser/metrics/mobile_session_shutdown_metrics_provider.mm [modify] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/ios/chrome/browser/metrics/mobile_session_shutdown_metrics_provider_unittest.mm [modify] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/tools/metrics/histograms/enums.xml [modify] https://crrev.com/ce9386ebd62a74afbe15f0fd0f0c10751b14169f/tools/metrics/histograms/histograms.xml
Comment 1 by olivierrobin@chromium.org
, Nov 29