| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_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/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 case 'u': | 491 case 'u': |
| 492 decoded_str.push_back((HexDigitToInt(*(token.begin + i + 1)) << 12 ) + | 492 decoded_str.push_back((HexDigitToInt(*(token.begin + i + 1)) << 12 ) + |
| 493 (HexDigitToInt(*(token.begin + i + 2)) << 8) + | 493 (HexDigitToInt(*(token.begin + i + 2)) << 8) + |
| 494 (HexDigitToInt(*(token.begin + i + 3)) << 4) + | 494 (HexDigitToInt(*(token.begin + i + 3)) << 4) + |
| 495 HexDigitToInt(*(token.begin + i + 4))); | 495 HexDigitToInt(*(token.begin + i + 4))); |
| 496 i += 4; | 496 i += 4; |
| 497 break; | 497 break; |
| 498 | 498 |
| 499 default: | 499 default: |
| 500 // We should only have valid strings at this point. If not, | 500 // We should only have valid strings at this point. If not, |
| 501 // ParseStringToken didn't do it's job. | 501 // ParseStringToken didn't do its job. |
| 502 NOTREACHED(); | 502 NOTREACHED(); |
| 503 return NULL; | 503 return NULL; |
| 504 } | 504 } |
| 505 } else { | 505 } else { |
| 506 // Not escaped | 506 // Not escaped |
| 507 decoded_str.push_back(c); | 507 decoded_str.push_back(c); |
| 508 } | 508 } |
| 509 } | 509 } |
| 510 return Value::CreateStringValue(WideToUTF16Hack(decoded_str)); | 510 return Value::CreateStringValue(WideToUTF16Hack(decoded_str)); |
| 511 } | 511 } |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 ++column_number; | 657 ++column_number; |
| 658 } | 658 } |
| 659 } | 659 } |
| 660 | 660 |
| 661 error_line_ = line_number; | 661 error_line_ = line_number; |
| 662 error_col_ = column_number; | 662 error_col_ = column_number; |
| 663 error_code_ = error; | 663 error_code_ = error; |
| 664 } | 664 } |
| 665 | 665 |
| 666 } // namespace base | 666 } // namespace base |
| OLD | NEW |