| OLD | NEW |
| 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 "platform/inspector_protocol/Parser.h" | 5 #include "platform/inspector_protocol/Parser.h" |
| 6 | 6 |
| 7 #include "platform/inspector_protocol/String16.h" | 7 #include "platform/inspector_protocol/String16.h" |
| 8 #include "platform/inspector_protocol/Values.h" | 8 #include "platform/inspector_protocol/Values.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 } | 276 } |
| 277 | 277 |
| 278 inline int hexToInt(UChar c) | 278 inline int hexToInt(UChar c) |
| 279 { | 279 { |
| 280 if ('0' <= c && c <= '9') | 280 if ('0' <= c && c <= '9') |
| 281 return c - '0'; | 281 return c - '0'; |
| 282 if ('A' <= c && c <= 'F') | 282 if ('A' <= c && c <= 'F') |
| 283 return c - 'A' + 10; | 283 return c - 'A' + 10; |
| 284 if ('a' <= c && c <= 'f') | 284 if ('a' <= c && c <= 'f') |
| 285 return c - 'a' + 10; | 285 return c - 'a' + 10; |
| 286 ASSERT_NOT_REACHED(); | 286 NOTREACHED(); |
| 287 return 0; | 287 return 0; |
| 288 } | 288 } |
| 289 | 289 |
| 290 bool decodeString(const UChar* start, const UChar* end, String16Builder* output) | 290 bool decodeString(const UChar* start, const UChar* end, String16Builder* output) |
| 291 { | 291 { |
| 292 while (start < end) { | 292 while (start < end) { |
| 293 UChar c = *start++; | 293 UChar c = *start++; |
| 294 if ('\\' != c) { | 294 if ('\\' != c) { |
| 295 output->append(c); | 295 output->append(c); |
| 296 continue; | 296 continue; |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 | 486 |
| 487 PassOwnPtr<Value> parseJSON(const String16& json) | 487 PassOwnPtr<Value> parseJSON(const String16& json) |
| 488 { | 488 { |
| 489 if (json.isEmpty()) | 489 if (json.isEmpty()) |
| 490 return nullptr; | 490 return nullptr; |
| 491 return parseJSONInternal(json.characters16(), json.length()); | 491 return parseJSONInternal(json.characters16(), json.length()); |
| 492 } | 492 } |
| 493 | 493 |
| 494 } // namespace protocol | 494 } // namespace protocol |
| 495 } // namespace blink | 495 } // namespace blink |
| OLD | NEW |