diff options
author | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-16 00:04:55 +0000 |
---|---|---|
committer | bbudge@chromium.org <bbudge@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-16 00:04:55 +0000 |
commit | 8d505c137e78aa60a6de0cde7cb736fc1e69b32e (patch) | |
tree | ea6c2fe6032e81f69256e430fe86e65988c26f39 /webkit/plugins | |
parent | 07c3d212963a1638659c4130f05bd5196957b2f6 (diff) | |
download | chromium_src-8d505c137e78aa60a6de0cde7cb736fc1e69b32e.zip chromium_src-8d505c137e78aa60a6de0cde7cb736fc1e69b32e.tar.gz chromium_src-8d505c137e78aa60a6de0cde7cb736fc1e69b32e.tar.bz2 |
Fix a bug where immediate failure in PPB_URLLoader_Impl::Open doesn't report an error, breaking NaCl integration tests. Before the recent changes to this class, violations of same-origin restrictions returned an error immediately. Now, the loader calls the didFail callback, before the callback is set, so there is no notification of an error.
This patch checks for an immediate failure, and returns PP_ERROR_NOACCESS to keep existing cross-origin tests green. We should go ahead with some WebKit refactoring to return proper error codes, as per Darin's TODO.
Review URL: http://codereview.chromium.org/6864021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81838 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins')
-rw-r--r-- | webkit/plugins/ppapi/ppb_url_loader_impl.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/webkit/plugins/ppapi/ppb_url_loader_impl.cc b/webkit/plugins/ppapi/ppb_url_loader_impl.cc index 378d789..27ec617 100644 --- a/webkit/plugins/ppapi/ppb_url_loader_impl.cc +++ b/webkit/plugins/ppapi/ppb_url_loader_impl.cc @@ -273,6 +273,13 @@ int32_t PPB_URLLoader_Impl::Open(PPB_URLRequestInfo_Impl* request, return PP_ERROR_FAILED; loader_->loadAsynchronously(web_request, this); + // Check for immediate failure; The AssociatedURLLoader will call our + // didFail method synchronously for certain kinds of access violations + // so we must return an error to the caller. + // TODO(bbudge) Modify the underlying AssociatedURLLoader to only call + // back asynchronously. + if (done_status_ == PP_ERROR_FAILED) + return PP_ERROR_NOACCESS; request_info_ = scoped_refptr<PPB_URLRequestInfo_Impl>(request); |