| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/common/manifest_handlers/shared_module_info.h" | 5 #include "extensions/common/manifest_handlers/shared_module_info.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 } | 180 } |
| 181 imports_.back().extension_id = extension_id; | 181 imports_.back().extension_id = extension_id; |
| 182 if (import_entry->HasKey(keys::kMinimumVersion)) { | 182 if (import_entry->HasKey(keys::kMinimumVersion)) { |
| 183 std::string min_version; | 183 std::string min_version; |
| 184 if (!import_entry->GetString(keys::kMinimumVersion, &min_version)) { | 184 if (!import_entry->GetString(keys::kMinimumVersion, &min_version)) { |
| 185 *error = ErrorUtils::FormatErrorMessageUTF16( | 185 *error = ErrorUtils::FormatErrorMessageUTF16( |
| 186 errors::kInvalidImportVersion, base::SizeTToString(i)); | 186 errors::kInvalidImportVersion, base::SizeTToString(i)); |
| 187 return false; | 187 return false; |
| 188 } | 188 } |
| 189 imports_.back().minimum_version = min_version; | 189 imports_.back().minimum_version = min_version; |
| 190 Version v(min_version); | 190 base::Version v(min_version); |
| 191 if (!v.IsValid()) { | 191 if (!v.IsValid()) { |
| 192 *error = ErrorUtils::FormatErrorMessageUTF16( | 192 *error = ErrorUtils::FormatErrorMessageUTF16( |
| 193 errors::kInvalidImportVersion, base::SizeTToString(i)); | 193 errors::kInvalidImportVersion, base::SizeTToString(i)); |
| 194 return false; | 194 return false; |
| 195 } | 195 } |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 return true; | 199 return true; |
| 200 } | 200 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 231 | 231 |
| 232 const std::vector<std::string> SharedModuleHandler::Keys() const { | 232 const std::vector<std::string> SharedModuleHandler::Keys() const { |
| 233 static const char* keys[] = { | 233 static const char* keys[] = { |
| 234 keys::kExport, | 234 keys::kExport, |
| 235 keys::kImport | 235 keys::kImport |
| 236 }; | 236 }; |
| 237 return std::vector<std::string>(keys, keys + arraysize(keys)); | 237 return std::vector<std::string>(keys, keys + arraysize(keys)); |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace extensions | 240 } // namespace extensions |
| OLD | NEW |