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

Unified Diff: headless/public/util/error_reporter.h

Issue 2466923002: headless: Only report protocol parsing errors when DCHECK is enabled (Closed)
Patch Set: Add comment Created 4 years, 1 month 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 | headless/public/util/error_reporter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/public/util/error_reporter.h
diff --git a/headless/public/util/error_reporter.h b/headless/public/util/error_reporter.h
index d7eb5e96d2148a881c6c86ad3a87f341119ff0e6..0f496c21723194b3da8b4775e128a905b0f2f6fa 100644
--- a/headless/public/util/error_reporter.h
+++ b/headless/public/util/error_reporter.h
@@ -13,12 +13,14 @@
namespace headless {
-// Tracks errors which are encountered while parsing client API types.
+// Tracks errors which are encountered while parsing client API types. Note that
+// errors are only reported in debug builds (i.e., when DCHECK is enabled).
class HEADLESS_EXPORT ErrorReporter {
public:
ErrorReporter();
~ErrorReporter();
+#if DCHECK_IS_ON()
// Enter a new nested parsing context. It will initially have a null name.
void Push();
@@ -37,6 +39,13 @@ class HEADLESS_EXPORT ErrorReporter {
// Returns a list of reported errors.
const std::vector<std::string>& errors() const { return errors_; }
+#else // DCHECK_IS_ON()
+ inline void Push() {}
+ inline void Pop() {}
+ inline void SetName(const char* name) {}
+ inline void AddError(base::StringPiece description) {}
+ inline bool HasErrors() const { return false; }
+#endif // DCHECK_IS_ON()
private:
std::vector<const char*> path_;
« no previous file with comments | « no previous file | headless/public/util/error_reporter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698