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

Unified Diff: third_party/WebKit/Source/core/inspector/V8InspectorString.cpp

Issue 2251343003: [DevTools] Generate separate copies of inspector_protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win compile Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698