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

Unified Diff: third_party/WebKit/Source/platform/wtf/text/StringImpl.h

Issue 2856123004: Fix some m_instVar instances in wtf/ (Closed)
Patch Set: . Created 3 years, 8 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/wtf/text/StringImpl.h
diff --git a/third_party/WebKit/Source/platform/wtf/text/StringImpl.h b/third_party/WebKit/Source/platform/wtf/text/StringImpl.h
index f5de3819bb96e0a82607679aa78539ba742db97e..94c597d913841d2d2d437fc8fa99c894eedd2542 100644
--- a/third_party/WebKit/Source/platform/wtf/text/StringImpl.h
+++ b/third_party/WebKit/Source/platform/wtf/text/StringImpl.h
@@ -69,55 +69,6 @@ typedef bool (*CharacterMatchFunctionPtr)(UChar);
typedef bool (*IsWhiteSpaceFunctionPtr)(UChar);
typedef HashMap<unsigned, StringImpl*, AlreadyHashed> StaticStringsTable;
-// Define STRING_STATS to turn on run time statistics of string sizes and memory
-// usage
-#undef STRING_STATS
-
-#ifdef STRING_STATS
-struct StringStats {
- inline void add8BitString(unsigned length) {
- ++m_totalNumberStrings;
- ++m_number8BitStrings;
- m_total8BitData += length;
- }
-
- inline void add16BitString(unsigned length) {
- ++m_totalNumberStrings;
- ++m_number16BitStrings;
- m_total16BitData += length;
- }
-
- void removeString(StringImpl*);
- void printStats();
-
- static const unsigned s_printStringStatsFrequency = 5000;
- static unsigned s_stringRemovesTillPrintStats;
-
- unsigned m_totalNumberStrings;
- unsigned m_number8BitStrings;
- unsigned m_number16BitStrings;
- unsigned long long m_total8BitData;
- unsigned long long m_total16BitData;
-};
-
-void addStringForStats(StringImpl*);
-void removeStringForStats(StringImpl*);
-
-#define STRING_STATS_ADD_8BIT_STRING(length) \
- StringImpl::stringStats().add8BitString(length); \
- addStringForStats(this)
-#define STRING_STATS_ADD_16BIT_STRING(length) \
- StringImpl::stringStats().add16BitString(length); \
- addStringForStats(this)
-#define STRING_STATS_REMOVE_STRING(string) \
- StringImpl::stringStats().removeString(string); \
- removeStringForStats(this)
-#else
-#define STRING_STATS_ADD_8BIT_STRING(length) ((void)0)
-#define STRING_STATS_ADD_16BIT_STRING(length) ((void)0)
-#define STRING_STATS_REMOVE_STRING(string) ((void)0)
-#endif
-
// You can find documentation about this class in this doc:
// https://docs.google.com/document/d/1kOCUlJdh2WJMJGDf-WoEQhmnjKLaOYRbiHz5TiGJl14/edit?usp=sharing
class WTF_EXPORT StringImpl {
@@ -147,7 +98,6 @@ class WTF_EXPORT StringImpl {
// existingHash() with impunity. The empty string is special because it
// is never entered into AtomicString's HashKey, but still needs to
// compare correctly.
- STRING_STATS_ADD_8BIT_STRING(m_length);
GetHash();
}
@@ -161,7 +111,6 @@ class WTF_EXPORT StringImpl {
is_atomic_(false),
is8_bit_(false),
is_static_(true) {
- STRING_STATS_ADD_16BIT_STRING(m_length);
GetHash();
}
@@ -177,7 +126,6 @@ class WTF_EXPORT StringImpl {
is8_bit_(true),
is_static_(false) {
DCHECK(length_);
- STRING_STATS_ADD_8BIT_STRING(m_length);
}
StringImpl(unsigned length)
@@ -190,7 +138,6 @@ class WTF_EXPORT StringImpl {
is8_bit_(false),
is_static_(false) {
DCHECK(length_);
- STRING_STATS_ADD_16BIT_STRING(m_length);
}
enum StaticStringTag { kStaticString };
@@ -480,9 +427,6 @@ class WTF_EXPORT StringImpl {
operator NSString*();
#endif
-#ifdef STRING_STATS
- ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; }
-#endif
static const UChar kLatin1CaseFoldTable[256];
private:
@@ -515,10 +459,6 @@ class WTF_EXPORT StringImpl {
std::string AsciiForDebugging() const;
#endif
-#ifdef STRING_STATS
- static StringStats m_stringStats;
-#endif
-
static unsigned highest_static_string_length_;
#if DCHECK_IS_ON()

Powered by Google App Engine
This is Rietveld 408576698