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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 6766002: Replace bools in extension creation with flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For landing Created 9 years, 9 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/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index ed0d286ccb4e2dc36e783c807853024865d56388..cb99385e0b63c712df2dfdb05cd0a57f8bf18636 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -199,12 +199,14 @@ void ExtensionServiceBackend::LoadSingleExtension(
FilePath extension_path = path_in;
file_util::AbsolutePath(&extension_path);
+ int flags = Extension::NO_FLAGS;
+ if (Extension::ShouldDoStrictErrorChecking(Extension::LOAD))
+ flags |= Extension::STRICT_ERROR_CHECKS;
std::string error;
scoped_refptr<const Extension> extension(extension_file_util::LoadExtension(
extension_path,
Extension::LOAD,
- false, // Don't require id
- Extension::ShouldDoStrictErrorChecking(Extension::LOAD),
+ flags,
&error));
if (!extension) {
@@ -744,13 +746,15 @@ void ExtensionService::LoadComponentExtension(
return;
}
+ int flags = Extension::REQUIRE_KEY;
+ if (Extension::ShouldDoStrictErrorChecking(Extension::COMPONENT))
+ flags |= Extension::STRICT_ERROR_CHECKS;
std::string error;
scoped_refptr<const Extension> extension(Extension::Create(
info.root_directory,
Extension::COMPONENT,
*static_cast<DictionaryValue*>(manifest.get()),
- true, // Require key
- Extension::ShouldDoStrictErrorChecking(Extension::COMPONENT),
+ flags,
&error));
if (!extension.get()) {
NOTREACHED() << error;
@@ -791,13 +795,15 @@ void ExtensionService::LoadAllExtensions() {
// thread.
base::ThreadRestrictions::ScopedAllowIO allow_io;
+ int flags = Extension::NO_FLAGS;
+ if (Extension::ShouldDoStrictErrorChecking(info->extension_location))
+ flags |= Extension::STRICT_ERROR_CHECKS;
std::string error;
scoped_refptr<const Extension> extension(
extension_file_util::LoadExtension(
info->extension_path,
info->extension_location,
- false, // Don't require key
- Extension::ShouldDoStrictErrorChecking(info->extension_location),
+ flags,
&error));
if (extension.get()) {
@@ -911,13 +917,16 @@ void ExtensionService::LoadInstalledExtension(const ExtensionInfo& info,
if (!extension_prefs_->IsExtensionAllowedByPolicy(info.extension_id)) {
error = errors::kDisabledByPolicy;
} else if (info.extension_manifest.get()) {
- bool require_key = info.extension_location != Extension::LOAD;
+ int flags = Extension::NO_FLAGS;
+ if (info.extension_location != Extension::LOAD)
+ flags |= Extension::REQUIRE_KEY;
+ if (Extension::ShouldDoStrictErrorChecking(info.extension_location))
+ flags |= Extension::STRICT_ERROR_CHECKS;
extension = Extension::Create(
info.extension_path,
info.extension_location,
*info.extension_manifest,
- require_key,
- Extension::ShouldDoStrictErrorChecking(info.extension_location),
+ flags,
&error);
} else {
error = errors::kManifestUnreadable;

Powered by Google App Engine
This is Rietveld 408576698