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

Unified Diff: src/inspector/string-16.cc

Issue 2975133002: Make String16 consturctors non-inline to save binary size (150kb) (Closed)
Patch Set: Make String16 consturctors non-inline to save binary size (150kb) Created 3 years, 5 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
« no previous file with comments | « src/inspector/string-16.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/string-16.cc
diff --git a/src/inspector/string-16.cc b/src/inspector/string-16.cc
index 6544646d71580caf6b9fb8f5482102d81a102a4d..30dd7dd14c88509bbc2f1ccc17fb2e5fe3ceda6d 100644
--- a/src/inspector/string-16.cc
+++ b/src/inspector/string-16.cc
@@ -362,6 +362,41 @@ static inline void putUTF8Triple(char*& buffer, UChar ch) {
} // namespace
+String16::String16() {}
+
+String16::String16(const String16& other)
+ : m_impl(other.m_impl), hash_code(other.hash_code) {}
+
+String16::String16(String16&& other)
+ : m_impl(std::move(other.m_impl)), hash_code(other.hash_code) {}
+
+String16::String16(const UChar* characters, size_t size)
+ : m_impl(characters, size) {}
+
+String16::String16(const UChar* characters) : m_impl(characters) {}
+
+String16::String16(const char* characters)
+ : String16(characters, std::strlen(characters)) {}
+
+String16::String16(const char* characters, size_t size) {
+ m_impl.resize(size);
+ for (size_t i = 0; i < size; ++i) m_impl[i] = characters[i];
+}
+
+String16::String16(const std::basic_string<UChar>& impl) : m_impl(impl) {}
+
+String16& String16::operator=(const String16& other) {
+ m_impl = other.m_impl;
+ hash_code = other.hash_code;
+ return *this;
+}
+
+String16& String16::operator=(String16&& other) {
+ m_impl = std::move(other.m_impl);
+ hash_code = other.hash_code;
+ return *this;
+}
+
// static
String16 String16::fromInteger(int number) {
char arr[50];
« no previous file with comments | « src/inspector/string-16.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698