Make the WebURLLoaderClients in the pepper code destroy (or have some guard) the loader in didFail()
Currently Blink's ThreadableLoader calls didFinishLoading()
after didFail() when both of the following conditions are met:
- ThreadableLoader is not canceled (or destroyed) in didFail()
- The response to cross-origin request (simple CORS request
or preflight request) fails CORS check
We plan to change ThreadableLoader not to call
didFinishLoading() after didFail() call. But ManifestDownloader
and PexeDownloader assumes the old behavior.
This CL copies the things done in didFinishLoading() to
didFail() of these classes and thus make a didFinishLoading()
call after didFail() unnecessary to prepare for the change.
----
I wondered if PepperURLLoaderHost is expecting both
didFinishLoading() and didFail() to be called. But it's only
exposed via PepperPluginInstanceImpl::document_loader(), and
to which only PluginDocumentParser::finish() delivers a
notification. PluginDocumentParser never call both of
didFinishLoading() and didFailLoading() on a PluginView.
So, we don't have to worry about breakage, I think.
----
R=hiroshige,bbudge
BUG=515850
Review URL: https://codereview.chromium.org/
1267713003
Cr-Commit-Position: refs/heads/master@{#342061}