Index: third_party/WebKit/Source/core/inspector/V8InspectorString.cpp |
diff --git a/third_party/WebKit/Source/core/inspector/V8InspectorString.cpp b/third_party/WebKit/Source/core/inspector/V8InspectorString.cpp |
index 43ec37dfc551e1c0386e413ce71fc2b733561532..6b7ac746d9bd2dbccb616be8438bd558b8c5f9d0 100644 |
--- a/third_party/WebKit/Source/core/inspector/V8InspectorString.cpp |
+++ b/third_party/WebKit/Source/core/inspector/V8InspectorString.cpp |
@@ -4,6 +4,8 @@ |
#include "core/inspector/V8InspectorString.h" |
+#include "core/inspector/protocol/Protocol.h" |
+ |
namespace blink { |
v8_inspector::StringView toV8InspectorStringView(const StringView& string) |
@@ -34,4 +36,17 @@ String toCoreString(std::unique_ptr<v8_inspector::StringBuffer> buffer) |
return toCoreString(buffer->string()); |
} |
+namespace protocol { |
+ |
+std::unique_ptr<protocol::Value> parseJSON(const String& string) |
+{ |
+ if (string.isNull()) |
+ return nullptr; |
+ if (string.is8Bit()) |
+ return parseJSON(reinterpret_cast<const uint8_t*>(string.characters8()), string.length()); |
+ return parseJSON(reinterpret_cast<const uint16_t*>(string.characters16()), string.length()); |
+} |
+ |
+} // namespace protocol |
+ |
} // namespace blink |