Commit 681b9b2f authored by Rainhard Findling's avatar Rainhard Findling Committed by Commit Bot

Safety check: ensure JS is allowed before running checks

* When users click the "Run safety check" button, safety check has a 1s
  delay before it runs the actual safety check. This is done to ensure
  that the "running" state of safety check children is shown to users
  for at least 1s.
* If users reload the Settings page in that 1s delay the browser
  crashes with crbug.com/1096965.
* This fix makes safety check ensure that JS is still allowed after the
  delay, before it runs the actual checks.

Bug: 1096965
Change-Id: I8ab45e4e561ba051a87019d41af3ac7a6c00162e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2254138Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Commit-Queue: Rainhard Findling <rainhard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780397}
parent 2fdad5f6
...@@ -118,6 +118,11 @@ void SafetyCheckHandler::SendSafetyCheckStartedWebUiUpdates() { ...@@ -118,6 +118,11 @@ void SafetyCheckHandler::SendSafetyCheckStartedWebUiUpdates() {
} }
void SafetyCheckHandler::PerformSafetyCheck() { void SafetyCheckHandler::PerformSafetyCheck() {
// If the user refreshes the Settings tab in the delay between starting safety
// check and now, then the check should no longer be run.
if (!IsJavascriptAllowed())
return;
// Checks common to desktop, Android, and iOS are handled by // Checks common to desktop, Android, and iOS are handled by
// safety_check::SafetyCheck. // safety_check::SafetyCheck.
safety_check_.reset(new safety_check::SafetyCheck(this)); safety_check_.reset(new safety_check::SafetyCheck(this));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment