diff options
author | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-08 20:56:06 +0000 |
---|---|---|
committer | teravest@chromium.org <teravest@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-08 20:57:39 +0000 |
commit | 8b92eef6b30f79e97c1e4bd3c6d55fd28db8adbf (patch) | |
tree | b2bf55e224b7d3d66acae90e81f981ffcd4754fe /ppapi/native_client | |
parent | 24a55d97598f9936a6420e8b77dcb83c7d7277e3 (diff) | |
download | chromium_src-8b92eef6b30f79e97c1e4bd3c6d55fd28db8adbf.zip chromium_src-8b92eef6b30f79e97c1e4bd3c6d55fd28db8adbf.tar.gz chromium_src-8b92eef6b30f79e97c1e4bd3c6d55fd28db8adbf.tar.bz2 |
Fix PNaCl on Demand load faliures.
r284961 broke PNaCl on-demand by loading resources retrieved by
component_uploader before sending a request to download a user pexe. This
change fixes the breakage by only loading resources after we've determined that
that there is no cached translated nexe.
BUG=401755
R=dmichael@chromium.org, dschuff@chromium.org
Review URL: https://codereview.chromium.org/453073002
Cr-Commit-Position: refs/heads/master@{#288426}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288426 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/native_client')
-rw-r--r-- | ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc index 5781530..36499ae 100644 --- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc +++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc @@ -275,29 +275,6 @@ void PnaclCoordinator::NexeReadDidOpen(int32_t pp_error) { } void PnaclCoordinator::OpenBitcodeStream() { - // The component updater's resource throttles + OnDemand update/install - // should block the URL request until the compiler is present. Now we - // can load the resources (e.g. llc and ld nexes). - resources_.reset(new PnaclResources(plugin_)); - CHECK(resources_ != NULL); - - // The first step of loading resources: read the resource info file. - if (!resources_->ReadResourceInfo()) { - ExitWithError(); - return; - } - - // Second step of loading resources: call StartLoad to load pnacl-llc - // and pnacl-ld, based on the filenames found in the resource info file. - if (!resources_->StartLoad()) { - ReportNonPpapiError( - PP_NACL_ERROR_PNACL_RESOURCE_FETCH, - nacl::string("The Portable Native Client (pnacl) component is not " - "installed. Please consult chrome://components for more " - "information.")); - return; - } - // Even though we haven't started downloading, create the translation // thread object immediately. This ensures that any pieces of the file // that get downloaded before the compilation thread is accepting @@ -333,6 +310,32 @@ void PnaclCoordinator::BitcodeStreamCacheHit(PP_FileHandle handle) { void PnaclCoordinator::BitcodeStreamCacheMiss(int64_t expected_pexe_size, PP_FileHandle nexe_handle) { + // IMPORTANT: Make sure that PnaclResources::StartLoad() is only + // called after you receive a response to a request for a .pexe file. + // + // The component updater's resource throttles + OnDemand update/install + // should block the URL request until the compiler is present. Now we + // can load the resources (e.g. llc and ld nexes). + resources_.reset(new PnaclResources(plugin_)); + CHECK(resources_ != NULL); + + // The first step of loading resources: read the resource info file. + if (!resources_->ReadResourceInfo()) { + ExitWithError(); + return; + } + + // Second step of loading resources: call StartLoad to load pnacl-llc + // and pnacl-ld, based on the filenames found in the resource info file. + if (!resources_->StartLoad()) { + ReportNonPpapiError( + PP_NACL_ERROR_PNACL_RESOURCE_FETCH, + nacl::string("The Portable Native Client (pnacl) component is not " + "installed. Please consult chrome://components for more " + "information.")); + return; + } + expected_pexe_size_ = expected_pexe_size; for (int i = 0; i < split_module_count_; i++) { |