summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorkalman <kalman@chromium.org>2015-04-29 17:12:00 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-30 00:12:35 +0000
commit309f98bb5d92ad215728611ea2a47936e210b249 (patch)
tree5854f6fc6db7fb7ae76aef708d00746bdbaebadd /extensions
parent4534cd9f8f1e90539f2872dd8455f4b6ff94a59c (diff)
downloadchromium_src-309f98bb5d92ad215728611ea2a47936e210b249.zip
chromium_src-309f98bb5d92ad215728611ea2a47936e210b249.tar.gz
chromium_src-309f98bb5d92ad215728611ea2a47936e210b249.tar.bz2
Record when we suppress internal Extension code JavaScript crashes.
Up until recently the behavior has been to crash on canary and dev channels, pick those up as regressions as per usual (e.g. we get a nice stack trace), then not crash in beta or stable. Recently those crashes have picked up, and while I work on a fix for that, r327369 disabled all crashes, suppressing all crashes. This patch records all suppressed crashes, something we perhaps should have been doing for a while. BUG=471599 R=rdevlin.cronin@chromium.org, isherman@chromium.org Review URL: https://codereview.chromium.org/1114733002 Cr-Commit-Position: refs/heads/master@{#327624}
Diffstat (limited to 'extensions')
-rw-r--r--extensions/common/extensions_client.h5
-rw-r--r--extensions/renderer/module_system.cc7
-rw-r--r--extensions/shell/common/shell_extensions_client.cc3
-rw-r--r--extensions/shell/common/shell_extensions_client.h1
-rw-r--r--extensions/test/test_extensions_client.cc3
-rw-r--r--extensions/test/test_extensions_client.h1
6 files changed, 18 insertions, 2 deletions
diff --git a/extensions/common/extensions_client.h b/extensions/common/extensions_client.h
index 9a9bedf..263d2f4 100644
--- a/extensions/common/extensions_client.h
+++ b/extensions/common/extensions_client.h
@@ -112,6 +112,11 @@ class ExtensionsClient {
// (i.e., only logged) or allowed (i.e., logged before crashing).
virtual bool ShouldSuppressFatalErrors() const = 0;
+ // Records that a fatal error was caught and suppressed. It is expected that
+ // embedders will only do so if ShouldSuppressFatalErrors at some point
+ // returned true.
+ virtual void RecordDidSuppressFatalError() = 0;
+
// Returns the base webstore URL prefix.
virtual std::string GetWebstoreBaseURL() const = 0;
diff --git a/extensions/renderer/module_system.cc b/extensions/renderer/module_system.cc
index b1ea018..05b51b2 100644
--- a/extensions/renderer/module_system.cc
+++ b/extensions/renderer/module_system.cc
@@ -52,10 +52,13 @@ void Fatal(ScriptContext* context, const std::string& message) {
full_message += ") ";
full_message += message;
- if (ExtensionsClient::Get()->ShouldSuppressFatalErrors())
+ ExtensionsClient* client = ExtensionsClient::Get();
+ if (client->ShouldSuppressFatalErrors()) {
console::Error(context->isolate()->GetCallingContext(), full_message);
- else
+ client->RecordDidSuppressFatalError();
+ } else {
console::Fatal(context->isolate()->GetCallingContext(), full_message);
+ }
}
void Warn(v8::Isolate* isolate, const std::string& message) {
diff --git a/extensions/shell/common/shell_extensions_client.cc b/extensions/shell/common/shell_extensions_client.cc
index c3d07ea..a26c95c 100644
--- a/extensions/shell/common/shell_extensions_client.cc
+++ b/extensions/shell/common/shell_extensions_client.cc
@@ -219,6 +219,9 @@ bool ShellExtensionsClient::ShouldSuppressFatalErrors() const {
return true;
}
+void ShellExtensionsClient::RecordDidSuppressFatalError() {
+}
+
std::string ShellExtensionsClient::GetWebstoreBaseURL() const {
return extension_urls::kChromeWebstoreBaseURL;
}
diff --git a/extensions/shell/common/shell_extensions_client.h b/extensions/shell/common/shell_extensions_client.h
index 0e8e519..b901040 100644
--- a/extensions/shell/common/shell_extensions_client.h
+++ b/extensions/shell/common/shell_extensions_client.h
@@ -44,6 +44,7 @@ class ShellExtensionsClient : public ExtensionsClient {
base::StringPiece GetAPISchema(const std::string& name) const override;
void RegisterAPISchemaResources(ExtensionAPI* api) const override;
bool ShouldSuppressFatalErrors() const override;
+ void RecordDidSuppressFatalError() override;
std::string GetWebstoreBaseURL() const override;
std::string GetWebstoreUpdateURL() const override;
bool IsBlacklistUpdateURL(const GURL& url) const override;
diff --git a/extensions/test/test_extensions_client.cc b/extensions/test/test_extensions_client.cc
index bd64c58..83257ee 100644
--- a/extensions/test/test_extensions_client.cc
+++ b/extensions/test/test_extensions_client.cc
@@ -166,6 +166,9 @@ bool TestExtensionsClient::ShouldSuppressFatalErrors() const {
return true;
}
+void TestExtensionsClient::RecordDidSuppressFatalError() {
+}
+
std::string TestExtensionsClient::GetWebstoreBaseURL() const {
return extension_urls::kChromeWebstoreBaseURL;
}
diff --git a/extensions/test/test_extensions_client.h b/extensions/test/test_extensions_client.h
index 964cbf9..209a08a 100644
--- a/extensions/test/test_extensions_client.h
+++ b/extensions/test/test_extensions_client.h
@@ -52,6 +52,7 @@ class TestExtensionsClient : public ExtensionsClient {
base::StringPiece GetAPISchema(const std::string& name) const override;
void RegisterAPISchemaResources(ExtensionAPI* api) const override;
bool ShouldSuppressFatalErrors() const override;
+ void RecordDidSuppressFatalError() override;
std::string GetWebstoreBaseURL() const override;
std::string GetWebstoreUpdateURL() const override;
bool IsBlacklistUpdateURL(const GURL& url) const override;