Make the WebURLLoaderClients in the pepper code destroy (or have some guard) the...
commit431e4370269c39ab808997c0c204e220cd8cef2a
authortyoshino <tyoshino@chromium.org>
Thu, 6 Aug 2015 05:09:11 +0000 (5 22:09 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 6 Aug 2015 05:09:45 +0000 (6 05:09 +0000)
tree8c5134860b558a5a6d67591096bbd6b8c1a7d70c
parent25f4575629ef634eadf89c9c5ea45f228d4f3b85
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}
components/nacl/renderer/manifest_downloader.cc
components/nacl/renderer/manifest_downloader.h
components/nacl/renderer/ppb_nacl_private_impl.cc
content/renderer/pepper/pepper_plugin_instance_impl.cc
content/renderer/pepper/pepper_plugin_instance_impl.h