OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_reader.h" | 5 #include "base/json/json_reader.h" |
6 | 6 |
7 #include "base/float_util.h" | 7 #include "base/float_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 | 13 |
| 14 namespace base { |
| 15 |
14 static const JSONReader::Token kInvalidToken(JSONReader::Token::INVALID_TOKEN, | 16 static const JSONReader::Token kInvalidToken(JSONReader::Token::INVALID_TOKEN, |
15 0, 0); | 17 0, 0); |
16 static const int kStackLimit = 100; | 18 static const int kStackLimit = 100; |
17 | 19 |
18 namespace { | 20 namespace { |
19 | 21 |
20 inline int HexToInt(wchar_t c) { | 22 inline int HexToInt(wchar_t c) { |
21 if ('0' <= c && c <= '9') { | 23 if ('0' <= c && c <= '9') { |
22 return c - '0'; | 24 return c - '0'; |
23 } else if ('A' <= c && c <= 'F') { | 25 } else if ('A' <= c && c <= 'F') { |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 if (*pos == '\n') { | 631 if (*pos == '\n') { |
630 ++line_number; | 632 ++line_number; |
631 column_number = 1; | 633 column_number = 1; |
632 } else { | 634 } else { |
633 ++column_number; | 635 ++column_number; |
634 } | 636 } |
635 } | 637 } |
636 | 638 |
637 error_message_ = FormatErrorMessage(line_number, column_number, description); | 639 error_message_ = FormatErrorMessage(line_number, column_number, description); |
638 } | 640 } |
| 641 |
| 642 } // namespace base |
OLD | NEW |