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

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

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 | « no previous file | src/inspector/string-16.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/string-16.h
diff --git a/src/inspector/string-16.h b/src/inspector/string-16.h
index 0270f5117a36acda5c369561e3add7dbc2511d72..11400923748a864707bc7bc92beea92ce4d848e7 100644
--- a/src/inspector/string-16.h
+++ b/src/inspector/string-16.h
@@ -20,32 +20,17 @@ class String16 {
public:
static const size_t kNotFound = static_cast<size_t>(-1);
- String16() {}
- String16(const String16& other)
- : m_impl(other.m_impl), hash_code(other.hash_code) {}
- String16(String16&& other)
- : m_impl(std::move(other.m_impl)), hash_code(other.hash_code) {}
- String16(const UChar* characters, size_t size) : m_impl(characters, size) {}
- String16(const UChar* characters) // NOLINT(runtime/explicit)
- : m_impl(characters) {}
- String16(const char* characters) // NOLINT(runtime/explicit)
- : String16(characters, std::strlen(characters)) {}
- String16(const char* characters, size_t size) {
- m_impl.resize(size);
- for (size_t i = 0; i < size; ++i) m_impl[i] = characters[i];
- }
- explicit String16(const std::basic_string<UChar>& impl) : m_impl(impl) {}
-
- String16& operator=(const String16& other) {
- m_impl = other.m_impl;
- hash_code = other.hash_code;
- return *this;
- }
- String16& operator=(String16&& other) {
- m_impl = std::move(other.m_impl);
- hash_code = other.hash_code;
- return *this;
- }
+ String16();
+ String16(const String16& other);
+ String16(String16&& other);
+ String16(const UChar* characters, size_t size);
+ String16(const UChar* characters); // NOLINT(runtime/explicit)
+ String16(const char* characters); // NOLINT(runtime/explicit)
+ String16(const char* characters, size_t size);
+ explicit String16(const std::basic_string<UChar>& impl);
+
+ String16& operator=(const String16& other);
+ String16& operator=(String16&& other);
static String16 fromInteger(int);
static String16 fromInteger(size_t);
« no previous file with comments | « no previous file | src/inspector/string-16.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698