OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "components/ui_devtools/string_util.h" | |
6 | |
7 #include "base/strings/string_util.h" | |
8 #include "components/ui_devtools/Protocol.h" | |
9 | |
10 namespace ui { | |
11 namespace devtools { | |
12 namespace protocol { | |
13 | |
14 std::unique_ptr<Value> parseJSON(const String& string) { | |
15 DCHECK(base::IsStringUTF8(string)); | |
16 // TODO(mhashmi): 16-bit strings need to be handled | |
dgozman
2016/10/20 20:45:58
If ui subsystem works with utf8-encoded std::strin
Sarmad Hashmi
2016/10/20 21:49:22
Will look into this, thanks!
| |
17 return parseJSON(reinterpret_cast<const uint8_t*>(&string[0]), | |
18 string.length()); | |
19 }; | |
20 | |
21 } // namespace protocol | |
22 } // namespace ws | |
23 } // namespace ui | |
OLD | NEW |