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

Unified Diff: base/debug/crash_logging.h

Issue 2137863002: Make it a compile error to use a crash key with no variable name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | base/debug/crash_logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/crash_logging.h
diff --git a/base/debug/crash_logging.h b/base/debug/crash_logging.h
index 97bac754a4b626985fe26935d37de8008fb7f7d7..42e5bbd7e7949c23756075ae591fc43c3ffe24d9 100644
--- a/base/debug/crash_logging.h
+++ b/base/debug/crash_logging.h
@@ -55,6 +55,8 @@ class BASE_EXPORT ScopedCrashKey {
DISALLOW_COPY_AND_ASSIGN(ScopedCrashKey);
};
+#define ScopedCrashKey(x) static_assert(false, "a scoped crash key has no name")
dcheng 2016/07/11 01:42:44 I'll think of a better error if people think this
ncarter (slow) 2016/07/11 17:08:12 How does this work with only one arg?
dcheng 2016/07/12 01:23:38 I've updated this to add the appropriate number of
+
// Before setting values for a key, all the keys must be registered.
struct BASE_EXPORT CrashKey {
// The name of the crash key, used in the above functions.
« no previous file with comments | « no previous file | base/debug/crash_logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698