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

Unified Diff: extensions/browser/extension_function.h

Issue 2656013005: Better crash stacktraces for ExtensionFunction bad messages. (Closed)
Patch Set: sync Created 3 years, 11 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 | « no previous file | extensions/browser/extension_function.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_function.h
diff --git a/extensions/browser/extension_function.h b/extensions/browser/extension_function.h
index 048a0fed839eb41154c04f5619e5830cf261ed1a..82503a7ddb115d1468bb84b47d2542d0d803d8dd 100644
--- a/extensions/browser/extension_function.h
+++ b/extensions/browser/extension_function.h
@@ -53,7 +53,7 @@ class QuotaLimitHeuristic;
#define EXTENSION_FUNCTION_VALIDATE(test) \
do { \
if (!(test)) { \
- this->set_bad_message(true); \
+ this->SetBadMessage(); \
return ValidationFailure(this); \
} \
} while (0)
@@ -65,7 +65,7 @@ class QuotaLimitHeuristic;
#define EXTENSION_FUNCTION_PRERUN_VALIDATE(test) \
do { \
if (!(test)) { \
- this->set_bad_message(true); \
+ this->SetBadMessage(); \
return false; \
} \
} while (0)
@@ -76,7 +76,7 @@ class QuotaLimitHeuristic;
#define EXTENSION_FUNCTION_ERROR(error) \
do { \
error_ = error; \
- this->set_bad_message(true); \
+ this->SetBadMessage(); \
return ValidationFailure(this); \
} while (0)
@@ -241,7 +241,7 @@ class ExtensionFunction
// Retrieves any error string from the function.
virtual const std::string& GetError() const;
- void set_bad_message(bool bad_message) { bad_message_ = bad_message; }
+ virtual void SetBadMessage();
// Specifies the name of the function. A long-lived string (such as a string
// literal) must be provided.
@@ -506,6 +506,7 @@ class UIThreadExtensionFunction : public ExtensionFunction {
UIThreadExtensionFunction* AsUIThreadExtensionFunction() override;
bool PreRunValidation(std::string* error) override;
+ void SetBadMessage() final;
// Called when a message was received.
// Should return true if it processed the message.
@@ -604,6 +605,7 @@ class IOThreadExtensionFunction : public ExtensionFunction {
IOThreadExtensionFunction();
IOThreadExtensionFunction* AsIOThreadExtensionFunction() override;
+ void SetBadMessage() final;
void set_ipc_sender(
base::WeakPtr<extensions::IOThreadExtensionMessageFilter> ipc_sender,
« no previous file with comments | « no previous file | extensions/browser/extension_function.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698