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

Unified Diff: chrome/common/extensions/extension.cc

Issue 6802023: Add nacl_modules key to extension manifests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
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
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
===================================================================
--- chrome/common/extensions/extension.cc (revision 80644)
+++ chrome/common/extensions/extension.cc (working copy)
@@ -1734,6 +1734,45 @@
}
}
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableExperimentalExtensionApis) &&
+ source.HasKey(keys::kNaClModules)) {
+ ListValue* list_value;
Aaron Boodman 2011/04/08 00:07:37 nit: initialize primitives
+ if (!source.GetList(keys::kNaClModules, &list_value)) {
+ *error = errors::kInvalidNaClModules;
+ return false;
+ }
+
+ for (size_t i = 0; i < list_value->GetSize(); ++i) {
+ DictionaryValue* module_value;
+ std::string path_str;
+ std::string mime_type;
+
+ if (!list_value->GetDictionary(i, &module_value)) {
+ *error = errors::kInvalidNaClModules;
+ return false;
+ }
+
+ // Get nacl_modules[i].path.
+ if (!module_value->GetString(keys::kNaClModulesPath, &path_str)) {
+ *error = ExtensionErrorUtils::FormatErrorMessage(
+ errors::kInvalidNaClModulesPath, base::IntToString(i));
+ return false;
+ }
+
+ // Get nacl_modules[i].mime_type.
+ if (!module_value->GetString(keys::kNaClModulesMIMEType, &mime_type)) {
+ *error = ExtensionErrorUtils::FormatErrorMessage(
+ errors::kInvalidNaClModulesMIMEType, base::IntToString(i));
+ return false;
+ }
+
+ nacl_modules_.push_back(NaClModuleInfo());
+ nacl_modules_.back().path = path().AppendASCII(path_str);
+ nacl_modules_.back().mime_type = mime_type;
+ }
+ }
+
// Initialize background url (optional).
if (source.HasKey(keys::kBackground)) {
std::string background_str;
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698