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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.cpp

Issue 1779033003: DevTools: always use 16bit strings for inspector protocol. (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/v8_inspector/V8StringUtil.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.cpp
index 5aa5b1f5a9c7f603b52584afd0d29de1150feb1e..720b8ab0c338ad4699f66c3999e6ed1130d3c2ef 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8StringUtil.cpp
@@ -125,7 +125,7 @@ protocol::Vector<std::pair<int, String16>> scriptRegexpMatchesByLines(const V8Re
unsigned lineEnd = endings->at(lineNumber);
String16 line = text.substring(start, lineEnd - start);
if (line.endsWith('\r'))
- line = line.left(line.length() - 1);
+ line = line.substring(0, line.length() - 1);
int matchLength;
if (regex.match(line, 0, &matchLength) != -1)
@@ -154,19 +154,15 @@ PassOwnPtr<V8Regex> createSearchRegex(V8DebuggerImpl* debugger, const String16&
v8::Local<v8::String> toV8String(v8::Isolate* isolate, const String16& string)
{
- if (string.isNull())
+ if (string.isEmpty())
return v8::String::Empty(isolate);
- if (string.is8Bit())
- return v8::String::NewFromOneByte(isolate, string.characters8(), v8::NewStringType::kNormal, string.length()).ToLocalChecked();
return v8::String::NewFromTwoByte(isolate, reinterpret_cast<const uint16_t*>(string.characters16()), v8::NewStringType::kNormal, string.length()).ToLocalChecked();
}
v8::Local<v8::String> toV8StringInternalized(v8::Isolate* isolate, const String16& string)
{
- if (string.isNull())
+ if (string.isEmpty())
return v8::String::Empty(isolate);
- if (string.is8Bit())
- return v8::String::NewFromOneByte(isolate, string.characters8(), v8::NewStringType::kInternalized, string.length()).ToLocalChecked();
return v8::String::NewFromTwoByte(isolate, reinterpret_cast<const uint16_t*>(string.characters16()), v8::NewStringType::kInternalized, string.length()).ToLocalChecked();
}

Powered by Google App Engine
This is Rietveld 408576698