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

Unified Diff: chrome/common/extensions/extension.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
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_file_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 2c57937898025475b9bfb207f764615b41dbf1e5..d6e03050eaa25507b51391240f5c901e0f5f0e7f 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -275,12 +275,11 @@ const int Extension::kValidHostPermissionSchemes =
scoped_refptr<Extension> Extension::Create(const FilePath& path,
Location location,
const DictionaryValue& value,
- bool require_key,
- bool strict_error_checks,
+ int flags,
std::string* error) {
scoped_refptr<Extension> extension = new Extension(path, location);
- if (!extension->InitFromValue(value, require_key, strict_error_checks, error))
+ if (!extension->InitFromValue(value, flags, error))
return NULL;
return extension;
}
@@ -1402,12 +1401,12 @@ GURL Extension::GetBaseURLFromExtensionId(const std::string& extension_id) {
chrome::kStandardSchemeSeparator + extension_id + "/");
}
-bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
- bool strict_error_checks, std::string* error) {
+bool Extension::InitFromValue(const DictionaryValue& source, int flags,
+ std::string* error) {
// When strict error checks are enabled, make URL pattern parsing strict.
URLPattern::ParseOption parse_strictness =
- (strict_error_checks ? URLPattern::PARSE_STRICT
- : URLPattern::PARSE_LENIENT);
+ (flags & STRICT_ERROR_CHECKS ? URLPattern::PARSE_STRICT
+ : URLPattern::PARSE_LENIENT);
if (source.HasKey(keys::kPublicKey)) {
std::string public_key_bytes;
@@ -1419,7 +1418,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, bool require_key,
*error = errors::kInvalidKey;
return false;
}
- } else if (require_key) {
+ } else if (flags & REQUIRE_KEY) {
*error = errors::kInvalidKey;
return false;
} else {
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/extension_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698