Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1053)

Unified Diff: ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc

Issue 453073002: Fix PNaCl on Demand load faliures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment for dmichael Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
diff --git a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
index 578153073126dfd0437747d9450e899a09bd3ec0..36499ae4aa5118c3ddd540384edbe7f9fc7b2cc1 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++) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698