Index: ppapi/native_client/src/trusted/plugin/plugin.cc |
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc |
index cd5dfbf06cd2e37d200376e7d82ec66da31ee7e6..8e269a0f16c11e234aa57c16c17358ed4edbd7ed 100644 |
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc |
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc |
@@ -76,6 +76,8 @@ const char* const kSrcManifestAttribute = "src"; |
// MIME type because the "src" attribute is used to supply us with the resource |
// of that MIME type that we're supposed to display. |
const char* const kNaClManifestAttribute = "nacl"; |
+// The pseudo-ISA used to indicate portable native client. |
+const char* const kPortableISA = "portable"; |
// This is a pretty arbitrary limit on the byte size of the NaCl manfest file. |
// Note that the resulting string object has to have at least one byte extra |
// for the null termination character. |
@@ -575,6 +577,7 @@ class ProgressEvent { |
}; |
const char* const Plugin::kNaClMIMEType = "application/x-nacl"; |
+const char* const Plugin::kPnaclMIMEType = "application/x-pnacl"; |
bool Plugin::NexeIsContentHandler() const { |
// Tests if the MIME type is not a NaCl MIME type. |
@@ -582,7 +585,8 @@ bool Plugin::NexeIsContentHandler() const { |
// type handler rather than directly by an HTML document. |
return |
!mime_type().empty() && |
- mime_type() != kNaClMIMEType; |
+ mime_type() != kNaClMIMEType && |
+ mime_type() != kPnaclMIMEType; |
} |
@@ -1252,13 +1256,11 @@ bool Plugin::SetManifestObject(const nacl::string& manifest_json, |
return false; |
// Determine whether lookups should use portable (i.e., pnacl versions) |
// rather than platform-specific files. |
- bool should_prefer_portable = |
- (getenv("NACL_PREFER_PORTABLE_IN_MANIFEST") != NULL); |
+ bool is_pnacl = (mime_type() == kPnaclMIMEType); |
nacl::scoped_ptr<JsonManifest> json_manifest( |
new JsonManifest(url_util_, |
manifest_base_url(), |
- GetSandboxISA(), |
- should_prefer_portable)); |
+ (is_pnacl ? kPortableISA : GetSandboxISA()))); |
if (!json_manifest->Init(manifest_json, error_info)) { |
return false; |
} |