| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |