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

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 4752)
+++ src/trusted/plugin/ppapi/plugin_ppapi.cc (working copy)
@@ -36,6 +36,7 @@
namespace {
const char* const kSrcAttribute = "src"; // The "src" attr of the <embed> tag.
+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 expeceted to contain
// JSON matching ISAs with .nexe URLs).
@@ -67,6 +68,8 @@
} // namespace
+const char* const kNaClMIMEType = "application/x-nacl";
polina 2011/04/15 06:24:57 please put this at the top with other constants
abarth-chromium 2011/04/15 06:36:40 The constants above have internal linkage, prevent
polina 2011/04/15 22:52:10 Might be better to make it a static member of the
+
bool PluginPpapi::SetAsyncCallback(void* obj, SrpcParams* params) {
PluginPpapi* plugin =
static_cast<PluginPpapi*>(reinterpret_cast<Plugin*>(obj));
@@ -143,6 +146,12 @@
const_cast<char**>(argn),
const_cast<char**>(argv));
if (status) {
+ const char* type_attr = LookupArgument(kTypeAttribute);
+ if (type_attr != NULL) {
+ mime_type_ = std::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, and finally a
// "nexes" attribute.
« src/trusted/plugin/ppapi/plugin_ppapi.h ('K') | « src/trusted/plugin/ppapi/plugin_ppapi.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698