New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 722500 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocked on:
issue 505496

Blocking:
issue 624697
issue 719759



Sign in to add a comment

Cleanup ImageLoader's error event handling

Project Member Reported by hirosh...@chromium.org, May 15 2017

Issue description

Currently, DispatchErrorEvent() can be called multiple times and multiple
in-flight tasks for error event can be scheduled on EventSender.
The second and following tasks are ignored by DispatchPendingErrorEvent(),
and thus we can refactor the code so that we have at most only one
in-flight task.

This blocks https://codereview.chromium.org/2859383002/ (  Issue 721994  )
and related CLs to remove EventSender, because I'm replacing
EventSender (that allows multiple in-flight tasks for an ImageLoader)
with a single TaskHandler (i.e. there can be at most one in-flight task).

 
Description: Show this description
Blockedon: 505496
Project Member

Comment 3 by bugdroid1@chromium.org, May 15 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1c5d3f11a80d88d65f5fae8398ed97a7b5ea1508

commit 1c5d3f11a80d88d65f5fae8398ed97a7b5ea1508
Author: hiroshige <hiroshige@chromium.org>
Date: Mon May 15 22:28:51 2017

Partial reland of "Add CHECK()s about ImageLoader::has_pending_load_event_"

Original CL:
https://codereview.chromium.org/2859383002/#ps220001

This CL relands the CHECK()s except for the failing one in
DispatchPendingErrorEvent().

 Issue 722500  tracks the issue around DispatchPendingErrorEvent() and relanding
of the remaining CHECK().

Original CL description:
> As preparation for [1], this CL checks some assumptions to hold that
> are helpful for proving the equivalences in [1].
>
> [1] https://codereview.chromium.org/2859093003/
>
> BUG= 624697 ,  719759 
>
> Review-Url: https://codereview.chromium.org/2859383002
> Cr-Commit-Position: refs/heads/master@{#471464}
> Committed: https://chromium.googlesource.com/chromium/src/+/1b070387595668ec438ffec65185e61017300e3c

BUG= 624697 ,  719759 ,  722500 

Review-Url: https://codereview.chromium.org/2884773002
Cr-Commit-Position: refs/heads/master@{#471925}

[modify] https://crrev.com/1c5d3f11a80d88d65f5fae8398ed97a7b5ea1508/third_party/WebKit/Source/core/loader/ImageLoader.cpp

Project Member

Comment 4 by bugdroid1@chromium.org, May 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/84fb9e0a3e168b81e538a5ff8ce79e3690396a10

commit 84fb9e0a3e168b81e538a5ff8ce79e3690396a10
Author: hiroshige <hiroshige@chromium.org>
Date: Fri May 19 16:53:20 2017

Make 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}

[add] https://crrev.com/84fb9e0a3e168b81e538a5ff8ce79e3690396a10/third_party/WebKit/LayoutTests/images/multiple-inflight-error-event-crash.html
[modify] https://crrev.com/84fb9e0a3e168b81e538a5ff8ce79e3690396a10/third_party/WebKit/Source/core/loader/ImageLoader.cpp

Status: Fixed (was: Started)
The CL at Comment #4 was landed on 60.0.3105.0 and no related crashes are observed.

Sign in to add a comment