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

Unified Diff: Source/wtf/text/StringImpl.h

Issue 110843004: Replaced HTMLIdentifier with an atomized string factory function (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review fixes Created 7 years 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: Source/wtf/text/StringImpl.h
diff --git a/Source/wtf/text/StringImpl.h b/Source/wtf/text/StringImpl.h
index 0aa40ca9b12807d7453bd1210c9c01379444780f..552150734991558af89cc51e87c0b9f2b0f3c79b 100644
--- a/Source/wtf/text/StringImpl.h
+++ b/Source/wtf/text/StringImpl.h
@@ -26,6 +26,7 @@
#include <limits.h>
#include "wtf/ASCIICType.h"
#include "wtf/Forward.h"
+#include "wtf/HashMap.h"
#include "wtf/StringHasher.h"
#include "wtf/Vector.h"
#include "wtf/WTFExport.h"
@@ -41,6 +42,7 @@ typedef const struct __CFString * CFStringRef;
namespace WTF {
+struct AlreadyHashed;
struct CStringTranslator;
template<typename CharacterType> struct HashAndCharactersTranslator;
struct HashAndUTF8CharactersTranslator;
@@ -56,6 +58,7 @@ enum StripBehavior { StripExtraWhiteSpace, DoNotStripWhiteSpace };
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
@@ -180,7 +183,8 @@ public:
static StringImpl* createStatic(const char* string, unsigned length, unsigned hash);
static void freezeStaticStrings();
- static const Vector<StringImpl*>& allStaticStrings();
+ static const StaticStringsTable& allStaticStrings();
+ static unsigned highestStaticStringLength() { return m_highestStaticStringLength; }
static PassRefPtr<StringImpl> create(const UChar*, unsigned length);
static PassRefPtr<StringImpl> create(const LChar*, unsigned length);
@@ -442,6 +446,8 @@ private:
static StringStats m_stringStats;
#endif
+ static unsigned m_highestStaticStringLength;
+
#ifndef NDEBUG
void assertHashIsCorrect()
{

Powered by Google App Engine
This is Rietveld 408576698