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

Side by Side Diff: base/json/json_parser.cc

Issue 1834933003: Fix tautologous DCHECK in base::internal::JSONParser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/json/json_parser.h" 5 #include "base/json/json_parser.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 std::swap(other->pos_, pos_); 302 std::swap(other->pos_, pos_);
303 std::swap(other->length_, length_); 303 std::swap(other->length_, length_);
304 } 304 }
305 305
306 JSONParser::StringBuilder::~StringBuilder() { 306 JSONParser::StringBuilder::~StringBuilder() {
307 delete string_; 307 delete string_;
308 } 308 }
309 309
310 void JSONParser::StringBuilder::Append(const char& c) { 310 void JSONParser::StringBuilder::Append(const char& c) {
311 DCHECK_GE(c, 0); 311 DCHECK_GE(c, 0);
312 DCHECK_LT(c, 128); 312 DCHECK_LT(static_cast<unsigned char>(c), 128);
313 313
314 if (string_) 314 if (string_)
315 string_->push_back(c); 315 string_->push_back(c);
316 else 316 else
317 ++length_; 317 ++length_;
318 } 318 }
319 319
320 void JSONParser::StringBuilder::AppendString(const std::string& str) { 320 void JSONParser::StringBuilder::AppendString(const std::string& str) {
321 DCHECK(string_); 321 DCHECK(string_);
322 string_->append(str); 322 string_->append(str);
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 const std::string& description) { 974 const std::string& description) {
975 if (line || column) { 975 if (line || column) {
976 return StringPrintf("Line: %i, column: %i, %s", 976 return StringPrintf("Line: %i, column: %i, %s",
977 line, column, description.c_str()); 977 line, column, description.c_str());
978 } 978 }
979 return description; 979 return description;
980 } 980 }
981 981
982 } // namespace internal 982 } // namespace internal
983 } // namespace base 983 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698