Chromium Code Reviews| 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. |