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

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

Issue 2226863003: [DevTools] Reduce API surface of String16. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/platform/inspector_protocol/String16WTF.cpp
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/String16WTF.cpp b/third_party/WebKit/Source/platform/inspector_protocol/String16WTF.cpp
index 387ecc3f48c45c98d8d89359ac269bbc1738d282..c18c0b65be6ceed642c5abaa78df5c455bac9beb 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/String16WTF.cpp
+++ b/third_party/WebKit/Source/platform/inspector_protocol/String16WTF.cpp
@@ -17,17 +17,8 @@ String16::String16(const WTF::String& other)
{
if (other.isNull())
return;
- if (!other.is8Bit()) {
- m_impl = other;
- return;
- }
-
- UChar* data;
- const LChar* characters = other.characters8();
- size_t length = other.length();
- m_impl = String::createUninitialized(length, data);
- for (size_t i = 0; i < length; ++i)
- data[i] = characters[i];
+ m_impl = other;
+ m_impl.ensure16Bit();
}
String16::String16(const char* characters, size_t length)
@@ -38,10 +29,5 @@ String16::String16(const char* characters, size_t length)
data[i] = characters[i];
}
-String16 String16::createUninitialized(unsigned length, UChar*& data)
-{
- return String::createUninitialized(length, data);
-}
-
} // namespace protocol
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698