Chromium Code Reviews| Index: chrome/common/extensions/extension.cc |
| diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc |
| index 5d7e1d2fd549877fd667eb174d26da3c47a1f37c..89abf6be9c059fce2749c7d8598c64298df48731 100644 |
| --- a/chrome/common/extensions/extension.cc |
| +++ b/chrome/common/extensions/extension.cc |
| @@ -1009,6 +1009,39 @@ bool Extension::LoadLaunchContainer(const DictionaryValue* manifest, |
| return true; |
| } |
| +bool Extension::LoadAppIsolation(const DictionaryValue* manifest, |
| + std::string* error) { |
| + // Only parse app isolation features if this switch is present. |
| + if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kEnableExperimentalAppManifests)) |
| + return true; |
| + |
| + Value* temp = NULL; |
| + if (!manifest->Get(keys::kIsolation, &temp)) |
| + return true; |
| + |
| + if (temp->GetType() != Value::TYPE_LIST) { |
| + *error = errors::kInvalidIsolation; |
| + return false; |
| + } |
| + |
| + ListValue* isolation_list = static_cast<ListValue*>(temp); |
| + for (size_t i = 0; i < isolation_list->GetSize(); ++i) { |
| + std::string isolation_string; |
| + if (!isolation_list->GetString(i, &isolation_string)) { |
| + *error = ExtensionErrorUtils::FormatErrorMessage( |
| + errors::kInvalidIsolationValue, |
| + base::UintToString(i)); |
| + return false; |
| + } |
| + |
| + // Check for isolated storage. |
| + if (isolation_string == keys::kIsolatedStorage) |
|
Matt Perry
2011/01/26 20:09:23
nit: add a LOG(WARNING) if it's a string we don't
Charlie Reis
2011/03/01 21:33:11
Done.
|
| + is_storage_isolated_ = true; |
| + } |
| + return true; |
| +} |
| + |
| bool Extension::EnsureNotHybridApp(const DictionaryValue* manifest, |
| std::string* error) { |
| if (web_extent().is_empty()) |
| @@ -1034,6 +1067,7 @@ Extension::Extension(const FilePath& path, Location location) |
| converted_from_user_script_(false), |
| is_theme_(false), |
| is_app_(false), |
| + is_storage_isolated_(false), |
| launch_container_(extension_misc::LAUNCH_TAB), |
| launch_width_(0), |
| launch_height_(0) { |
| @@ -1667,7 +1701,8 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key, |
| errors::kInvalidWebURLs, errors::kInvalidWebURL, error) || |
| !EnsureNotHybridApp(manifest_value_.get(), error) || |
| !LoadLaunchURL(manifest_value_.get(), error) || |
| - !LoadLaunchContainer(manifest_value_.get(), error)) { |
| + !LoadLaunchContainer(manifest_value_.get(), error) || |
| + !LoadAppIsolation(manifest_value_.get(), error)) { |
| return false; |
| } |