DescriptionKeep multipart responses in m_nonBlockingLoaders after first part loaded
For multipart responses, in the first ResourceLoader::didFinishLoadingOnePart(),
(1) the ResourceLoader is moved from |m_loaders| to |m_nonBlockingLoaders|
in ResourceFetcher::subresourceLoaderFinishedLoadingOnePart(), and
(2) it is removed from |m_nonBlockingLoaders| in
ResourceFetcher::willTerminateResourceLoader() called in didFinishLoading().
Therefore, if we call window.stop() just after multipart <img>'s onload event,
we cannot stop loading of the multipart response because it is no longer in
|m_loaders| nor |m_nonBlockingLoaders|.
However, in the second didFinishLoadingOnePart(),
(3) In subresourceLoaderFinishedLoadingOnePart(),
the ResourceLoader is added again to |m_nonBlockingLoaders|, and
(4) We don't call didFinishLoading()/willTerminateResourceLoader().
Therefore, we can stop loading of the image after that by window.stop().
This CL makes the ResourceLoader to be kept in |m_nonBlockingLoaders| after (1)
and to be remove from |m_nonBlockingLoaders| when
ResourceLoader::didFinishLoading() is called.
This CL enables to stop loading of multipart responses at any time, and also
enables https://codereview.chromium.org/1756953002/ to stop dispatching
didFinishLoadingOnePart() for each part without affecting window.stop()
behavior on multipart responses.
BUG=570608
Committed: https://crrev.com/22822feaf74bffc00dbe6db27cd3e36c1c568e11
Cr-Commit-Position: refs/heads/master@{#381876}
Patch Set 1 #Patch Set 2 : Add fix. #Patch Set 3 : #Patch Set 4 : #
Total comments: 2
Patch Set 5 : Reflect comments. #Messages
Total messages: 34 (19 generated)
|