Chromium Code Reviews
DescriptionReland of "Remove EventSender from ImageLoader"
Instead of using EventSender, this CL schedules ImageLoader's
load and error events using PostCancellableTask.
has_pending_load_event_ and has_pending_error_event_ booleans are
replaced with TaskHandle to the cancellable tasks and IsActive() calls.
This CL removes the dependencies between Document's load event and
<img> load events via EventSender.
This CL removes EventSender.h as ImageLoader was the last user of that.
Test changes:
stop-loading.html:
testharness.js waits for the window load event before finishing.
Previously, we call window.stop() in <img> load event, but window
load event is fired, because the <img> load event is fired from
Document::ImplicitClose() via EventSender. At that time window.stop()
doesn't stop the window load event.
After this CL, <img> load event is fired separately from
Document::ImplicitClose(), and thus window.stop() stops the window
load event.
To work around this, this CL triggers window load event explicitly
just to signal testharness.js to finish.
http/tests/loading/preload-image-sizes-2x.html and
http/tests/loading/preload-picture-sizes-2x.html:
The tests uses srcset-helper.js that reloads the page with empty
cache in the window load event.
Because this CL changes the timing of the window load event, this
causes some asynchronous tasks that cause new image loading to be
scheduled before window load event and executed after that, causing
some images left on the cache before reloading starts.
This CL works around the issue by waiting a little bit for those
tasks to be executed, and then clearing the cache and reloading the
page.
BUG=624697, 720268
Review-Url: https://codereview.chromium.org/2863763003
Cr-Commit-Position: refs/heads/master@{#474086}
Committed: https://chromium.googlesource.com/chromium/src/+/da70e32d811fffe4e15728ba858dbdfa3180ed59
patch from issue 2863763003 at patchset 180001 (http://crrev.com/2863763003#ps180001)
Patch Set 1 #Patch Set 2 : Use timer task runner #Patch Set 3 : Rebase #
Depends on Patchset: Messages
Total messages: 4 (4 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||