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

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp

Issue 1767883002: DevTools: generate string16-based handlers for v8_inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/platform/inspector_protocol/Parser.cpp
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp b/third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp
index ce72028645dfe5a13f7b592e93e25197ca87fa43..ea8693106b2a759ba9992a155102336d798d6bb2 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp
+++ b/third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp
@@ -4,10 +4,8 @@
#include "platform/inspector_protocol/Parser.h"
-#include "platform/Decimal.h"
+#include "platform/inspector_protocol/String16.h"
#include "platform/inspector_protocol/Values.h"
-#include "wtf/text/StringBuilder.h"
-#include "wtf/text/UTF8.h"
namespace blink {
namespace protocol {
@@ -299,7 +297,7 @@ inline int hexToInt(CharType c)
}
template<typename CharType>
-bool decodeUTF8(const CharType* start, const CharType* end, const CharType** utf8charEnd, StringBuilder* output)
+bool decodeUTF8(const CharType* start, const CharType* end, const CharType** utf8charEnd, String16Builder* output)
{
UChar utf16[4] = {0};
char utf8[6] = {0};
@@ -343,7 +341,7 @@ bool decodeUTF8(const CharType* start, const CharType* end, const CharType** utf
}
template<typename CharType>
-bool decodeString(const CharType* start, const CharType* end, StringBuilder* output)
+bool decodeString(const CharType* start, const CharType* end, String16Builder* output)
{
while (start < end) {
UChar c = *start++;
@@ -407,7 +405,7 @@ bool decodeString(const CharType* start, const CharType* end, String* output)
}
if (start > end)
return false;
- StringBuilder buffer;
+ String16Builder buffer;
buffer.reserveCapacity(end - start);
if (!decodeString(start, end, &buffer))
return false;
@@ -442,9 +440,7 @@ PassOwnPtr<Value> buildValue(const CharType* start, const CharType* end, const C
break;
case Number: {
bool ok;
- double value = charactersToDouble(tokenStart, tokenEnd - tokenStart, &ok);
- if (Decimal::fromDouble(value).isInfinity())
- ok = false;
+ double value = String16::charactersToDouble(tokenStart, tokenEnd - tokenStart, &ok);
if (!ok)
return nullptr;
result = FundamentalValue::create(value);
@@ -550,7 +546,7 @@ PassOwnPtr<Value> parseJSONInternal(const CharType* start, unsigned length)
} // anonymous namespace
-PassOwnPtr<Value> parseJSON(const String& json)
+PassOwnPtr<Value> parseJSON(const String16& json)
{
if (json.isEmpty())
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698