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

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

Issue 16171011: Move parsing of NaCl modules out of Extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: plugin manager Created 7 years, 7 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: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index d19e2cf6b3fd1185b6e56cbfb6a73d29c60f0127..b1f25aacbde3c6205b98ef340bc90d78e07127cd 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1029,8 +1029,7 @@ bool Extension::LoadLaunchURL(string16* error) {
bool Extension::LoadSharedFeatures(string16* error) {
if (!LoadDescription(error) ||
- !ManifestHandler::ParseExtension(this, error) ||
- !LoadNaClModules(error))
+ !ManifestHandler::ParseExtension(this, error))
return false;
return true;
@@ -1071,46 +1070,6 @@ bool Extension::LoadManifestVersion(string16* error) {
return true;
}
-bool Extension::LoadNaClModules(string16* error) {
- if (!manifest_->HasKey(keys::kNaClModules))
- return true;
- const ListValue* list_value = NULL;
- if (!manifest_->GetList(keys::kNaClModules, &list_value)) {
- *error = ASCIIToUTF16(errors::kInvalidNaClModules);
- return false;
- }
-
- for (size_t i = 0; i < list_value->GetSize(); ++i) {
- const DictionaryValue* module_value = NULL;
- if (!list_value->GetDictionary(i, &module_value)) {
- *error = ASCIIToUTF16(errors::kInvalidNaClModules);
- return false;
- }
-
- // Get nacl_modules[i].path.
- std::string path_str;
- if (!module_value->GetString(keys::kNaClModulesPath, &path_str)) {
- *error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidNaClModulesPath, base::IntToString(i));
- return false;
- }
-
- // Get nacl_modules[i].mime_type.
- std::string mime_type;
- if (!module_value->GetString(keys::kNaClModulesMIMEType, &mime_type)) {
- *error = ErrorUtils::FormatErrorMessageUTF16(
- errors::kInvalidNaClModulesMIMEType, base::IntToString(i));
- return false;
- }
-
- nacl_modules_.push_back(NaClModuleInfo());
- nacl_modules_.back().url = GetResourceURL(path_str);
- nacl_modules_.back().mime_type = mime_type;
- }
-
- return true;
-}
-
bool Extension::HasMultipleUISurfaces() const {
int num_surfaces = 0;

Powered by Google App Engine
This is Rietveld 408576698