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

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

Issue 315583005: Pepper: Simplify error reporting in PnaclResources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
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 92740d9e2b1d34e719717df9e9925b95016270c8..da1947c4c78b106630d351537f93c268c5afacfb 100644
--- a/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
+++ b/ppapi/native_client/src/trusted/plugin/pnacl_coordinator.cc
@@ -376,7 +376,7 @@ void PnaclCoordinator::BitcodeStreamDidOpen(int32_t pp_error) {
// 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_, this));
+ resources_.reset(new PnaclResources(plugin_));
CHECK(resources_ != NULL);
// The first step of loading resources: read the resource info file.
@@ -388,6 +388,10 @@ void PnaclCoordinator::BitcodeStreamDidOpen(int32_t pp_error) {
void PnaclCoordinator::ResourceInfoWasRead(int32_t pp_error) {
PLUGIN_PRINTF(("PluginCoordinator::ResourceInfoWasRead (pp_error=%"
NACL_PRId32 ")\n", pp_error));
+ if (pp_error != PP_OK) {
+ 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.
pp::CompletionCallback resources_cb =
@@ -399,8 +403,11 @@ void PnaclCoordinator::ResourcesDidLoad(int32_t pp_error) {
PLUGIN_PRINTF(("PnaclCoordinator::ResourcesDidLoad (pp_error=%"
NACL_PRId32 ")\n", pp_error));
if (pp_error != PP_OK) {
- // Finer-grained error code should have already been reported by
- // the PnaclResources class.
+ 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;
}

Powered by Google App Engine
This is Rietveld 408576698