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

Side by Side Diff: headless/public/util/error_reporter.cc

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 unified diff | Download patch
« no previous file with comments | « headless/public/util/error_reporter.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "headless/public/util/error_reporter.h" 5 #include "headless/public/util/error_reporter.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
11 namespace headless { 11 namespace headless {
12 12
13 ErrorReporter::ErrorReporter() {} 13 ErrorReporter::ErrorReporter() {}
14 14
15 ErrorReporter::~ErrorReporter() {} 15 ErrorReporter::~ErrorReporter() {}
16 16
17 #if DCHECK_IS_ON()
17 void ErrorReporter::Push() { 18 void ErrorReporter::Push() {
18 path_.push_back(nullptr); 19 path_.push_back(nullptr);
19 } 20 }
20 21
21 void ErrorReporter::Pop() { 22 void ErrorReporter::Pop() {
22 path_.pop_back(); 23 path_.pop_back();
23 } 24 }
24 25
25 void ErrorReporter::SetName(const char* name) { 26 void ErrorReporter::SetName(const char* name) {
26 DCHECK(!path_.empty()); 27 DCHECK(!path_.empty());
(...skipping 13 matching lines...) Expand all
40 } 41 }
41 if (error.tellp()) 42 if (error.tellp())
42 error << ": "; 43 error << ": ";
43 error << description; 44 error << description;
44 errors_.push_back(error.str()); 45 errors_.push_back(error.str());
45 } 46 }
46 47
47 bool ErrorReporter::HasErrors() const { 48 bool ErrorReporter::HasErrors() const {
48 return !errors_.empty(); 49 return !errors_.empty();
49 } 50 }
51 #endif // DCHECK_IS_ON()
50 52
51 } // namespace headless 53 } // namespace headless
OLDNEW
« no previous file with comments | « headless/public/util/error_reporter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698