Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Side by Side Diff: third_party/WebKit/Source/core/inspector/V8InspectorString.cpp

Issue 2490473004: [DevTools] Roll third_party/inspector_protocol to e23134c5aa6131e5a3a3afbefce255becce3a3bd. (Closed)
Patch Set: ui_devtools Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "core/inspector/V8InspectorString.h" 5 #include "core/inspector/V8InspectorString.h"
6 6
7 #include "core/inspector/protocol/Protocol.h" 7 #include "core/inspector/protocol/Protocol.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 String toCoreString(std::unique_ptr<v8_inspector::StringBuffer> buffer) { 36 String toCoreString(std::unique_ptr<v8_inspector::StringBuffer> buffer) {
37 if (!buffer) 37 if (!buffer)
38 return String(); 38 return String();
39 return toCoreString(buffer->string()); 39 return toCoreString(buffer->string());
40 } 40 }
41 41
42 namespace protocol { 42 namespace protocol {
43 43
44 std::unique_ptr<protocol::Value> parseJSON(const String& string) { 44 // static
45 std::unique_ptr<protocol::Value> StringUtil::parseJSON(const String& string) {
45 if (string.isNull()) 46 if (string.isNull())
46 return nullptr; 47 return nullptr;
47 if (string.is8Bit()) 48 if (string.is8Bit()) {
48 return parseJSON(reinterpret_cast<const uint8_t*>(string.characters8()), 49 return parseJSONCharacters(
49 string.length()); 50 reinterpret_cast<const uint8_t*>(string.characters8()),
50 return parseJSON(reinterpret_cast<const uint16_t*>(string.characters16()), 51 string.length());
51 string.length()); 52 }
53 return parseJSONCharacters(
54 reinterpret_cast<const uint16_t*>(string.characters16()),
55 string.length());
52 } 56 }
53 57
54 } // namespace protocol 58 } // namespace protocol
55 59
56 } // namespace blink 60 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698