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

Unified Diff: third_party/WebKit/Source/wtf/text/WTFString.h

Issue 2232083002: Fix incorrect usage of StringImpl::sizeInBytes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: size_teeee 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
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/WTFString.h
diff --git a/third_party/WebKit/Source/wtf/text/WTFString.h b/third_party/WebKit/Source/wtf/text/WTFString.h
index b5aa5a9e77976542ac08e096b0bf066d3a7e9499..92f1e4f3631e7f10b990366a967c5fab8aa24d98 100644
--- a/third_party/WebKit/Source/wtf/text/WTFString.h
+++ b/third_party/WebKit/Source/wtf/text/WTFString.h
@@ -138,13 +138,6 @@ public:
bool is8Bit() const { return m_impl->is8Bit(); }
- unsigned sizeInBytes() const
- {
- if (!m_impl)
- return 0;
- return m_impl->length() * (is8Bit() ? sizeof(LChar) : sizeof(UChar));
- }
-
CString ascii() const;
CString latin1() const;
CString utf8(UTF8ConversionMode = LenientUTF8Conversion) const;
@@ -376,6 +369,8 @@ public:
bool containsOnlyLatin1() const;
bool containsOnlyWhitespace() const { return !m_impl || m_impl->containsOnlyWhitespace(); }
+ size_t charactersSizeInBytes() const { return m_impl ? m_impl->charactersSizeInBytes() : 0; }
+
// Hash table deleted values, which are only constructed and never copied or
// destroyed.
String(WTF::HashTableDeletedValueType) : m_impl(WTF::HashTableDeletedValue) { }
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698