| Index: chrome/common/extensions/extension.cc
|
| diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
|
| index bdbb33a356d17b0eb01be622b90e7d42f34a48bf..e8b6bd0e394b728d2de630c3bd23b06b3156784f 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)
|
| + 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) {
|
| @@ -1671,7 +1705,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;
|
| }
|
|
|
|
|