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 {% for namespace in config.protocol.namespace %} | 5 {% for namespace in config.protocol.namespace %} |
6 namespace {{namespace}} { | 6 namespace {{namespace}} { |
7 {% endfor %} | 7 {% endfor %} |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 318 |
319 template<typename Char> | 319 template<typename Char> |
320 int hexToInt(Char c) | 320 int hexToInt(Char c) |
321 { | 321 { |
322 if ('0' <= c && c <= '9') | 322 if ('0' <= c && c <= '9') |
323 return c - '0'; | 323 return c - '0'; |
324 if ('A' <= c && c <= 'F') | 324 if ('A' <= c && c <= 'F') |
325 return c - 'A' + 10; | 325 return c - 'A' + 10; |
326 if ('a' <= c && c <= 'f') | 326 if ('a' <= c && c <= 'f') |
327 return c - 'a' + 10; | 327 return c - 'a' + 10; |
328 NOTREACHED(); | 328 DCHECK(false); |
329 return 0; | 329 return 0; |
330 } | 330 } |
331 | 331 |
332 template<typename Char> | 332 template<typename Char> |
333 bool decodeString(const Char* start, const Char* end, StringBuilder* output) | 333 bool decodeString(const Char* start, const Char* end, StringBuilder* output) |
334 { | 334 { |
335 while (start < end) { | 335 while (start < end) { |
336 uint16_t c = *start++; | 336 uint16_t c = *start++; |
337 if ('\\' != c) { | 337 if ('\\' != c) { |
338 output->append(c); | 338 output->append(c); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 } | 540 } |
541 | 541 |
542 std::unique_ptr<Value> parseJSON(const uint8_t* characters, unsigned length) | 542 std::unique_ptr<Value> parseJSON(const uint8_t* characters, unsigned length) |
543 { | 543 { |
544 return parseJSONInternal<uint8_t>(characters, length); | 544 return parseJSONInternal<uint8_t>(characters, length); |
545 } | 545 } |
546 | 546 |
547 {% for namespace in config.protocol.namespace %} | 547 {% for namespace in config.protocol.namespace %} |
548 } // namespace {{namespace}} | 548 } // namespace {{namespace}} |
549 {% endfor %} | 549 {% endfor %} |
OLD | NEW |