Defer preloads with imagesrcset/imagesizes until the first chunk is parsed

Preloads from link headers with the media attribute are deferred until
the first chunk of the document is parsed, so that ViewportDescription
from the preload scanner can be taken into account. Preloads with
imagesrcset or imagesizes depend on the viewport, so such preloads
should be deferred as well.

Note: This applies to only preloads dispatched by DocumentLoader. Link
rel=preload headers from subresources (e.g. prefetch) are not deferred
even if they have media/imagesrcset/imagesizes attributes.

Bug: 813452
Change-Id: Iccc6ec12cf5bd53b71824463378c854cbd23a5ba
Reviewed-on: https://chromium-review.googlesource.com/c/1360193
Reviewed-by: Dominic Farolino <domfarolino@gmail.com>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Yoav Weiss <yoavweiss@chromium.org>
Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614253}
4 files changed