Skip to content

Commit

Permalink
[Extensions] Silence future manifest error with flag.
Browse files Browse the repository at this point in the history
$ chrome --allow-future-manifest-version

Bug: None
Change-Id: I99a4d23386b99f707e21ab221b62b6d51b7f6658
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2434904
Commit-Queue: Solomon Kinard <solomonkinard@chromium.org>
Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813731}
  • Loading branch information
solomonkinardchromium authored and Commit Bot committed Oct 5, 2020
1 parent 5a9ac57 commit b5514c7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
14 changes: 10 additions & 4 deletions extensions/common/extension.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,16 @@ bool IsManifestSupported(int manifest_version,
}

if (manifest_version > kMaximumSupportedManifestVersion) {
*warning = ErrorUtils::FormatErrorMessage(
manifest_errors::kManifestVersionTooHighWarning,
base::NumberToString(kMaximumSupportedManifestVersion),
base::NumberToString(manifest_version));
// Silence future manifest error with flag.
bool allow_future_manifest_version =
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kAllowFutureManifestVersion);
if (!allow_future_manifest_version) {
*warning = ErrorUtils::FormatErrorMessage(
manifest_errors::kManifestVersionTooHighWarning,
base::NumberToString(kMaximumSupportedManifestVersion),
base::NumberToString(manifest_version));
}
return true;
}

Expand Down
3 changes: 3 additions & 0 deletions extensions/common/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ const char kTraceAppSource[] = "enable-trace-app-source";
// the one received from update manifest.
const char kEnableCrxHashCheck[] = "enable-crx-hash-check";

// Mute extension errors while working with new manifest version.
const char kAllowFutureManifestVersion[] = "allow-future-manifest-version";

} // namespace switches

} // namespace extensions
1 change: 1 addition & 0 deletions extensions/common/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ extern const char kSetExtensionThrottleTestParams[];
extern const char kShowComponentExtensionOptions[];
extern const char kTraceAppSource[];
extern const char kEnableCrxHashCheck[];
extern const char kAllowFutureManifestVersion[];

} // namespace switches

Expand Down

0 comments on commit b5514c7

Please sign in to comment.