Commit 66296350 authored by rockot@chromium.org's avatar rockot@chromium.org

Fix channel check for fatal error suppression.

Fatal extensions errors should be suppressed on
stable and beta channels of Chrome. This fixes a
regression where they were instead suppressed on
other channels.

BUG=378374

Review URL: https://codereview.chromium.org/306893003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273997 0039d316-1c4b-4281-b951-d872f2087c98
parent b2b8a031
...@@ -272,8 +272,8 @@ void ChromeExtensionsClient::RegisterAPISchemaResources( ...@@ -272,8 +272,8 @@ void ChromeExtensionsClient::RegisterAPISchemaResources(
} }
bool ChromeExtensionsClient::ShouldSuppressFatalErrors() const { bool ChromeExtensionsClient::ShouldSuppressFatalErrors() const {
// <= dev means dev, canary, and trunk. // Suppress fatal errors only on beta and stable channels.
return GetCurrentChannel() <= chrome::VersionInfo::CHANNEL_DEV; return GetCurrentChannel() > chrome::VersionInfo::CHANNEL_DEV;
} }
// static // static
......
...@@ -28,7 +28,7 @@ function set(name, message, stack, targetChrome) { ...@@ -28,7 +28,7 @@ function set(name, message, stack, targetChrome) {
clear(targetChrome); // in case somebody has set a sneaky getter/setter clear(targetChrome); // in case somebody has set a sneaky getter/setter
var errorObject = { message: message }; var errorObject = { message: message };
if (targetChrome && targetChrome.extension) if (GetAvailability('extension.lastError').is_available)
targetChrome.extension.lastError = errorObject; targetChrome.extension.lastError = errorObject;
assertRuntimeIsAvailable(); assertRuntimeIsAvailable();
...@@ -81,7 +81,7 @@ function clear(targetChrome) { ...@@ -81,7 +81,7 @@ function clear(targetChrome) {
if (!targetChrome) if (!targetChrome)
throw new Error('No target chrome to clear error'); throw new Error('No target chrome to clear error');
if (targetChrome && targetChrome.extension) if (GetAvailability('extension.lastError').is_available)
delete targetChrome.extension.lastError; delete targetChrome.extension.lastError;
assertRuntimeIsAvailable(); assertRuntimeIsAvailable();
......
...@@ -267,7 +267,10 @@ Feature::Availability ExtensionAPI::IsAvailable(const std::string& full_name, ...@@ -267,7 +267,10 @@ Feature::Availability ExtensionAPI::IsAvailable(const std::string& full_name,
Feature::Context context, Feature::Context context,
const GURL& url) { const GURL& url) {
Feature* feature = GetFeatureDependency(full_name); Feature* feature = GetFeatureDependency(full_name);
CHECK(feature) << full_name; if (!feature) {
return Feature::CreateAvailability(Feature::NOT_PRESENT,
std::string("Unknown feature: ") + full_name);
}
return IsAvailable(*feature, extension, context, url); return IsAvailable(*feature, extension, context, url);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment