Chromium Code Reviews
DescriptionMake ImageLoader have at most one pending error event on EventSender
Relanding the CHECK() that asserts
ImageLoader::DispatchPendingErrorEvent() should always called when
has_pending_error_event_ is true.
Previously, we sometimes schedule multiple error events on EventSender:
1. DispatchErrorEvent() is called.
2. DispatchErrorEvent() is called.
3. DispatchPendingErrorEvent() is called (corresponding to Step 1)
and actual processing is done.
4. DispatchPendingErrorEvent() is called (corresponding to Step 2)
but ignored because has_pending_error_event_ is already false.
This CL makes DispatchErrorEvent() cancel previous scheduled error
events if any, ensures there can be at most scheduled error event on
EventSender, and makes the assertion hold.
The scenario above will be processed as follows, and thus this CL
shouldn't change any observable behavior.
1. DispatchErrorEvent() is called.
2. DispatchErrorEvent() is called.
The error event scheduled by Step 1 is cancelled.
3. DispatchPendingErrorEvent() is called (corresponding to Step 2)
and actual processing is done.
[1] https://codereview.chromium.org/2859383002/
[2] https://codereview.chromium.org/2884773002/
BUG=624697, 719759, 722500
Review-Url: https://codereview.chromium.org/2893993002
Cr-Commit-Position: refs/heads/master@{#473214}
Committed: https://chromium.googlesource.com/chromium/src/+/84fb9e0a3e168b81e538a5ff8ce79e3690396a10
Patch Set 1 #Patch Set 2 : Add test #Patch Set 3 : Add comment #
Messages
Total messages: 16 (12 generated)
|
||||||||||||||||||||||||||||