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

Unified Diff: src/trusted/plugin/ppapi/plugin_ppapi.cc

Issue 6813070: Add cross-origin loading of NEXEs for MIME type handlers (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 8 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: src/trusted/plugin/ppapi/plugin_ppapi.cc
===================================================================
--- src/trusted/plugin/ppapi/plugin_ppapi.cc (revision 4887)
+++ src/trusted/plugin/ppapi/plugin_ppapi.cc (working copy)
@@ -38,6 +38,7 @@
// The "src" attribute of the <embed> tag. The value is expected to be a URL
// pointing to the nexe (aka nacl module) file.
const char* const kSrcAttribute = "src";
+const char* const kTypeAttribute = "type";
// The "nacl" attribute of the <embed> tag. The value is expected to be either
// a URL or URI pointing to the manifest file (which is expected to contain
// JSON matching ISAs with .nexe URLs).
@@ -68,6 +69,8 @@
} // namespace
+const char* const kNaClMIMEType = "application/x-nacl";
+
bool PluginPpapi::SetAsyncCallback(void* obj, SrpcParams* params) {
PluginPpapi* plugin =
static_cast<PluginPpapi*>(reinterpret_cast<Plugin*>(obj));
@@ -144,6 +147,12 @@
const_cast<char**>(argn),
const_cast<char**>(argv));
if (status) {
+ const char* type_attr = LookupArgument(kTypeAttribute);
+ if (type_attr != NULL) {
+ mime_type_ = nacl::string(type_attr);
+ std::transform(mime_type_.begin(), mime_type_.end(), mime_type_.begin(),
+ tolower);
+ }
// Note: The order of attribute lookup is important. This pattern looks
// for a "nacl" attribute first, then a "src" attribute.
const char* nacl_attr = LookupArgument(kNaclManifestAttribute);

Powered by Google App Engine
This is Rietveld 408576698