| 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 "components/ui_devtools/string_util.h" | 5 #include "components/ui_devtools/string_util.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "components/ui_devtools/Protocol.h" | 8 #include "components/ui_devtools/Protocol.h" |
| 9 | 9 |
| 10 namespace ui { | 10 namespace ui_devtools { |
| 11 namespace devtools { | |
| 12 namespace protocol { | 11 namespace protocol { |
| 13 | 12 |
| 14 // static | 13 // static |
| 15 std::unique_ptr<Value> StringUtil::parseJSON(const String& string) { | 14 std::unique_ptr<Value> StringUtil::parseJSON(const String& string) { |
| 16 DCHECK(base::IsStringUTF8(string)); | 15 DCHECK(base::IsStringUTF8(string)); |
| 17 // TODO(mhashmi): 16-bit strings need to be handled | 16 // TODO(mhashmi): 16-bit strings need to be handled |
| 18 return parseJSONCharacters(reinterpret_cast<const uint8_t*>(&string[0]), | 17 return parseJSONCharacters(reinterpret_cast<const uint8_t*>(&string[0]), |
| 19 string.length()); | 18 string.length()); |
| 20 }; | 19 }; |
| 21 | 20 |
| 22 } // namespace protocol | 21 } // namespace protocol |
| 23 } // namespace ws | 22 } // namespace ui_devtools |
| 24 } // namespace ui | |
| OLD | NEW |