Commit ff9bac54 authored by Mugdha Lakhani's avatar Mugdha Lakhani Committed by Commit Bot

[Background Sync] Skip firing for suspended registrations

We set delay_until super high, but this added change will ensure
we never fire a sync event for a suspended registration.

Note that we'll never mark a one-shot Background Sync registration
suspended, so there is intentionally no branching here.

Bug: 982378
Change-Id: I462468b6516098623733379a8ae0a1d062158311
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1704257Reviewed-by: default avatarRayan Kanso <rayankans@chromium.org>
Commit-Queue: Mugdha Lakhani <nator@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680159}
parent 6f0bf6cb
...@@ -1388,6 +1388,9 @@ bool BackgroundSyncManager::IsRegistrationReadyToFire( ...@@ -1388,6 +1388,9 @@ bool BackgroundSyncManager::IsRegistrationReadyToFire(
if (registration.sync_state() != blink::mojom::BackgroundSyncState::PENDING) if (registration.sync_state() != blink::mojom::BackgroundSyncState::PENDING)
return false; return false;
if (registration.is_suspended())
return false;
if (clock_->Now() < registration.delay_until()) if (clock_->Now() < registration.delay_until())
return false; return false;
......
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