Unreviewed, rolling out r195911.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 31 Jan 2016 00:53:20 +0000 (00:53 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 31 Jan 2016 00:53:20 +0000 (00:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=153723

Caused frequent assertion failures on bots (Requested by ap on
#webkit).

Reverted changeset:

"Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
https://bugs.webkit.org/show_bug.cgi?id=153639
http://trac.webkit.org/changeset/195911

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195917 268f45cc-cd09-0410-ab3c-d52691b4dbfc

37 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/text/StringHash.h
Source/WTF/wtf/text/StringImpl.cpp
Source/WTF/wtf/text/StringImpl.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.h
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/crypto/CryptoAlgorithmRegistry.h
Source/WebCore/css/CSSFontSelector.cpp
Source/WebCore/css/CSSFontSelector.h
Source/WebCore/dom/DOMImplementation.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/ScriptElement.cpp
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/InputType.cpp
Source/WebCore/loader/CrossOriginAccessControl.h
Source/WebCore/loader/CrossOriginPreflightResultCache.h
Source/WebCore/loader/archive/ArchiveFactory.cpp
Source/WebCore/platform/MIMETypeRegistry.cpp
Source/WebCore/platform/SchemeRegistry.h
Source/WebCore/platform/URL.cpp
Source/WebCore/platform/graphics/FontCache.cpp
Source/WebCore/platform/graphics/FontCascade.cpp
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
Source/WebCore/platform/network/HTTPHeaderMap.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreStatistics.cpp
Source/WebKit/win/WebURLResponse.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm
Source/WebKit2/UIProcess/Plugins/PlugInAutoStartProvider.h
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebProcess.cpp
Tools/ChangeLog
Tools/Scripts/do-webcore-rename

index 5c1bb49..a01268d 100644 (file)
@@ -1,3 +1,17 @@
+2016-01-30  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r195911.
+        https://bugs.webkit.org/show_bug.cgi?id=153723
+
+        Caused frequent assertion failures on bots (Requested by ap on
+        #webkit).
+
+        Reverted changeset:
+
+        "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
+        https://bugs.webkit.org/show_bug.cgi?id=153639
+        http://trac.webkit.org/changeset/195911
+
 2016-01-30  Darin Adler  <darin@apple.com>
 
         Replace CaseFoldingHash with ASCIICaseInsensitiveHash
index 26ad291..346c104 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2008, 2012-2013, 2016 Apple Inc. All rights reserved
+ * Copyright (C) 2006, 2007, 2008, 2012, 2013 Apple Inc. All rights reserved
  * Copyright (C) Research In Motion Limited 2009. All rights reserved.
  *
  * This library is free software; you can redistribute it and/or
@@ -33,7 +33,7 @@ namespace WTF {
         return value.isNull();
     }
 
-    // The hash() functions on StringHash and ASCIICaseInsensitiveHash do not support
+    // The hash() functions on StringHash and CaseFoldingHash do not support
     // null strings. get(), contains(), and add() on HashMap<String,..., StringHash>
     // cause a null-pointer dereference when passed null strings.
 
@@ -71,11 +71,14 @@ namespace WTF {
         static const bool safeToCompareToEmptyOrDeleted = false;
     };
 
-    class ASCIICaseInsensitiveHash {
+    class CaseFoldingHash {
     public:
         template<typename T> static inline UChar foldCase(T character)
         {
-            return toASCIILower(character);
+            if (std::is_same<T, LChar>::value)
+                return StringImpl::latin1CaseFoldTable[character];
+            
+            return u_foldCase(character, U_FOLD_CASE_DEFAULT);
         }
 
         static unsigned hash(const UChar* data, unsigned length)
@@ -102,23 +105,17 @@ namespace WTF {
 
         static inline unsigned hash(const char* data, unsigned length)
         {
-            return hash(reinterpret_cast<const LChar*>(data), length);
+            return CaseFoldingHash::hash(reinterpret_cast<const LChar*>(data), length);
         }
         
-        static inline bool equal(const StringImpl& a, const StringImpl& b)
-        {
-            return equalIgnoringASCIICase(a, b);
-        }
         static inline bool equal(const StringImpl* a, const StringImpl* b)
         {
-            ASSERT(a);
-            ASSERT(b);
-            return equal(*a, *b);
+            return equalCompatibiltyCaselessNonNull(a, b);
         }
 
         static unsigned hash(const RefPtr<StringImpl>& key) 
         {
-            return hash(key.get());
+            return hash(*key);
         }
 
         static bool equal(const RefPtr<StringImpl>& a, const RefPtr<StringImpl>& b)
@@ -170,8 +167,8 @@ namespace WTF {
 
 }
 
-using WTF::ASCIICaseInsensitiveHash;
 using WTF::AlreadyHashed;
+using WTF::CaseFoldingHash;
 using WTF::StringHash;
 
 #endif
index cb3d024..a676d2b 100644 (file)
@@ -950,50 +950,30 @@ float StringImpl::toFloat(bool* ok)
     return charactersToFloat(characters16(), m_length, ok);
 }
 
-// Table is based on ftp://ftp.unicode.org/Public/UNIDATA/CaseFolding.txt
-static const UChar latin1CaseFoldTable[256] = {
-    0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
-    0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
-    0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f,
-    0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
-    0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
-    0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
-    0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
-    0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
-    0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x03bc, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
-    0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
-    0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00d7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00df,
-    0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
-    0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
-};
-
-static inline bool equalCompatibilityCaseless(const LChar* a, const LChar* b, unsigned length)
+static inline bool equalCompatibiltyCaseless(const LChar* a, const LChar* b, unsigned length)
 {
     while (length--) {
-        if (latin1CaseFoldTable[*a++] != latin1CaseFoldTable[*b++])
+        if (StringImpl::latin1CaseFoldTable[*a++] != StringImpl::latin1CaseFoldTable[*b++])
             return false;
     }
     return true;
 }
 
-static inline bool equalCompatibilityCaseless(const UChar* a, const LChar* b, unsigned length)
+static inline bool equalCompatibiltyCaseless(const UChar* a, const LChar* b, unsigned length)
 {
     while (length--) {
-        if (u_foldCase(*a++, U_FOLD_CASE_DEFAULT) != latin1CaseFoldTable[*b++])
+        if (u_foldCase(*a++, U_FOLD_CASE_DEFAULT) != StringImpl::latin1CaseFoldTable[*b++])
             return false;
     }
     return true;
 }
 
-static inline bool equalCompatibilityCaseless(const LChar* a, const UChar* b, unsigned length)
+static inline bool equalCompatibiltyCaseless(const LChar* a, const UChar* b, unsigned length)
 {
-    return equalCompatibilityCaseless(b, a, length);
+    return equalCompatibiltyCaseless(b, a, length);
 }
 
-static inline bool equalCompatibilityCaseless(const UChar* a, const UChar* b, unsigned length)
+static inline bool equalCompatibiltyCaseless(const UChar* a, const UChar* b, unsigned length)
 {
     return !u_memcasecmp(a, b, length, U_FOLD_CASE_DEFAULT);
 }
@@ -1102,7 +1082,7 @@ size_t StringImpl::findIgnoringCase(const LChar* matchString, unsigned index)
         const LChar* searchCharacters = characters8() + index;
 
         unsigned i = 0;
-        while (!equalCompatibilityCaseless(searchCharacters + i, matchString, matchLength)) {
+        while (!equalCompatibiltyCaseless(searchCharacters + i, matchString, matchLength)) {
             if (i == delta)
                 return notFound;
             ++i;
@@ -1113,7 +1093,7 @@ size_t StringImpl::findIgnoringCase(const LChar* matchString, unsigned index)
     const UChar* searchCharacters = characters16() + index;
 
     unsigned i = 0;
-    while (!equalCompatibilityCaseless(searchCharacters + i, matchString, matchLength)) {
+    while (!equalCompatibiltyCaseless(searchCharacters + i, matchString, matchLength)) {
         if (i == delta)
             return notFound;
         ++i;
@@ -1177,7 +1157,7 @@ ALWAYS_INLINE static size_t findIgnoringCaseInner(const SearchCharacterType* sea
 
     unsigned i = 0;
     // keep looping until we match
-    while (!equalCompatibilityCaseless(searchCharacters + i, matchCharacters, matchLength)) {
+    while (!equalCompatibiltyCaseless(searchCharacters + i, matchCharacters, matchLength)) {
         if (i == delta)
             return notFound;
         ++i;
@@ -1318,7 +1298,7 @@ ALWAYS_INLINE static size_t reverseFindIgnoringCaseInner(const SearchCharacterTy
     unsigned delta = std::min(index, length - matchLength);
 
     // keep looping until we match
-    while (!equalCompatibilityCaseless(searchCharacters + delta, matchCharacters, matchLength)) {
+    while (!equalCompatibiltyCaseless(searchCharacters + delta, matchCharacters, matchLength)) {
         if (!delta)
             return notFound;
         --delta;
@@ -1364,8 +1344,8 @@ ALWAYS_INLINE static bool equalInner(const StringImpl* stringImpl, unsigned star
         return equal(stringImpl->characters16() + startOffset, reinterpret_cast<const LChar*>(matchString), matchLength);
     }
     if (stringImpl->is8Bit())
-        return equalCompatibilityCaseless(stringImpl->characters8() + startOffset, reinterpret_cast<const LChar*>(matchString), matchLength);
-    return equalCompatibilityCaseless(stringImpl->characters16() + startOffset, reinterpret_cast<const LChar*>(matchString), matchLength);
+        return equalCompatibiltyCaseless(stringImpl->characters8() + startOffset, reinterpret_cast<const LChar*>(matchString), matchLength);
+    return equalCompatibiltyCaseless(stringImpl->characters16() + startOffset, reinterpret_cast<const LChar*>(matchString), matchLength);
 }
 
 ALWAYS_INLINE static bool equalInner(const StringImpl& stringImpl, unsigned startOffset, const StringImpl& matchString)
@@ -1938,6 +1918,30 @@ bool equal(const StringImpl& a, const StringImpl& b)
     return equalCommon(a, b);
 }
 
+bool equalCompatibiltyCaselessNonNull(const StringImpl* a, const StringImpl* b)
+{
+    ASSERT(a);
+    ASSERT(b);
+    if (a == b)
+        return true;
+
+    unsigned length = a->length();
+    if (length != b->length())
+        return false;
+
+    if (a->is8Bit()) {
+        if (b->is8Bit())
+            return equalCompatibiltyCaseless(a->characters8(), b->characters8(), length);
+
+        return equalCompatibiltyCaseless(b->characters16(), a->characters8(), length);
+    }
+
+    if (b->is8Bit())
+        return equalCompatibiltyCaseless(a->characters16(), b->characters8(), length);
+
+    return equalCompatibiltyCaseless(a->characters16(), b->characters16(), length);
+}
+
 bool equalIgnoringNullity(StringImpl* a, StringImpl* b)
 {
     if (!a && b && !b->length())
@@ -2137,6 +2141,26 @@ CString StringImpl::utf8(ConversionMode mode) const
     return utf8ForRange(0, length(), mode);
 }
 
+// Table is based on ftp://ftp.unicode.org/Public/UNIDATA/CaseFolding.txt
+const UChar StringImpl::latin1CaseFoldTable[256] = {
+    0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
+    0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, 
+    0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, 
+    0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
+    0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
+    0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f,
+    0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f,
+    0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f,
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
+    0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x03bc, 0x00b6, 0x00b7, 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
+    0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+    0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00d7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00df,
+    0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+    0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff, 
+};
+
 bool equalIgnoringNullity(const UChar* a, size_t aLength, StringImpl* b)
 {
     if (!b)
index e6870ba..d44e5cf 100644 (file)
@@ -762,6 +762,8 @@ public:
     ALWAYS_INLINE static StringStats& stringStats() { return m_stringStats; }
 #endif
 
+    WTF_EXPORT_STRING_API static const UChar latin1CaseFoldTable[256];
+
     Ref<StringImpl> extractFoldedStringInSymbol()
     {
         ASSERT(isSymbol());
@@ -944,6 +946,9 @@ inline bool equal(const LChar* a, StringImpl* b) { return equal(b, a); }
 inline bool equal(const char* a, StringImpl* b) { return equal(b, reinterpret_cast<const LChar*>(a)); }
 WTF_EXPORT_STRING_API bool equal(const StringImpl& a, const StringImpl& b);
 
+// FIXME: Deprecated. Used only by CaseFoldingHash, which itself is soon to be deprecated and removed, replaced by ASCIICaseFoldingHash.
+WTF_EXPORT_STRING_API bool equalCompatibiltyCaselessNonNull(const StringImpl*, const StringImpl*);
+
 WTF_EXPORT_STRING_API bool equalIgnoringNullity(StringImpl*, StringImpl*);
 WTF_EXPORT_STRING_API bool equalIgnoringNullity(const UChar*, size_t length, StringImpl*);
 
index 55a018c..d4116d7 100644 (file)
@@ -1,5 +1,19 @@
 2016-01-30  Commit Queue  <commit-queue@webkit.org>
 
+        Unreviewed, rolling out r195911.
+        https://bugs.webkit.org/show_bug.cgi?id=153723
+
+        Caused frequent assertion failures on bots (Requested by ap on
+        #webkit).
+
+        Reverted changeset:
+
+        "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
+        https://bugs.webkit.org/show_bug.cgi?id=153639
+        http://trac.webkit.org/changeset/195911
+
+2016-01-30  Commit Queue  <commit-queue@webkit.org>
+
         Unreviewed, rolling out r195799 and r195828.
         https://bugs.webkit.org/show_bug.cgi?id=153722
 
index 55278a7..5a77461 100644 (file)
@@ -117,7 +117,7 @@ private:
 
     const String m_databaseInfoTableName;
 
-    HashSet<String, ASCIICaseInsensitiveHash> m_whitelistedFunctions;
+    HashSet<String, CaseFoldingHash> m_whitelistedFunctions;
 };
 
 } // namespace WebCore
index b07988e..768d0d2 100644 (file)
@@ -1988,7 +1988,7 @@ AccessibilityObject* AccessibilityObject::firstAnonymousBlockChild() const
     return nullptr;
 }
 
-typedef HashMap<String, AccessibilityRole, ASCIICaseInsensitiveHash> ARIARoleMap;
+typedef HashMap<String, AccessibilityRole, CaseFoldingHash> ARIARoleMap;
 typedef HashMap<AccessibilityRole, String, DefaultHash<int>::Hash, WTF::UnsignedWithZeroKeyHashTraits<int>> ARIAReverseRoleMap;
 
 static ARIARoleMap* gAriaRoleMap = nullptr;
index ed972c6..bd64b14 100644 (file)
@@ -65,7 +65,7 @@ private:
 
     void registerAlgorithm(const String& name, CryptoAlgorithmIdentifier, CryptoAlgorithmConstructor);
 
-    HashMap<String, CryptoAlgorithmIdentifier, ASCIICaseInsensitiveHash> m_nameToIdentifierMap;
+    HashMap<String, CryptoAlgorithmIdentifier, CaseFoldingHash> m_nameToIdentifierMap;
     HashMap<unsigned, String> m_identifierToNameMap;
     HashMap<unsigned, CryptoAlgorithmConstructor> m_identifierToConstructorMap;
 };
index 93b04d1..24b5eb2 100644 (file)
@@ -224,7 +224,7 @@ static String familyNameFromPrimitive(const CSSPrimitiveValue& value)
     }
 }
 
-static void registerLocalFontFacesForFamily(const String& familyName, HashMap<String, Vector<Ref<CSSFontFace>>, ASCIICaseInsensitiveHash>& locallyInstalledFontFaces)
+static void registerLocalFontFacesForFamily(const String& familyName, HashMap<String, Vector<Ref<CSSFontFace>>, CaseFoldingHash>& locallyInstalledFontFaces)
 {
     ASSERT(!locallyInstalledFontFaces.contains(familyName));
 
index ef89acd..26dead1 100644 (file)
@@ -86,9 +86,9 @@ private:
     void beginLoadTimerFired();
 
     Document* m_document;
-    HashMap<String, Vector<Ref<CSSFontFace>>, ASCIICaseInsensitiveHash> m_fontFaces;
-    HashMap<String, Vector<Ref<CSSFontFace>>, ASCIICaseInsensitiveHash> m_locallyInstalledFontFaces;
-    HashMap<String, HashMap<unsigned, RefPtr<CSSSegmentedFontFace>>, ASCIICaseInsensitiveHash> m_fonts;
+    HashMap<String, Vector<Ref<CSSFontFace>>, CaseFoldingHash> m_fontFaces;
+    HashMap<String, Vector<Ref<CSSFontFace>>, CaseFoldingHash> m_locallyInstalledFontFaces;
+    HashMap<String, HashMap<unsigned, RefPtr<CSSSegmentedFontFace>>, CaseFoldingHash> m_fonts;
     HashSet<FontSelectorClient*> m_clients;
 
     Vector<CachedResourceHandle<CachedFont>> m_fontsToBeginLoading;
index ae0e70b..0da3619 100644 (file)
@@ -64,7 +64,7 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
-typedef HashSet<String, ASCIICaseInsensitiveHash> FeatureSet;
+typedef HashSet<String, CaseFoldingHash> FeatureSet;
 
 static void addString(FeatureSet& set, const char* string)
 {
index 98ff92e..8943db7 100644 (file)
@@ -1613,7 +1613,7 @@ private:
     HashSet<HTMLMediaElement*> m_allowsMediaDocumentInlinePlaybackElements;
 #endif
 
-    HashMap<StringImpl*, Element*, ASCIICaseInsensitiveHash> m_elementsByAccessKey;
+    HashMap<StringImpl*, Element*, CaseFoldingHash> m_elementsByAccessKey;
     bool m_accessKeyMapValid;
 
     DocumentOrderedMap m_imagesByUsemap;
index 3b1e547..d9c56fe 100644 (file)
@@ -118,7 +118,7 @@ static bool isLegacySupportedJavaScriptLanguage(const String& language)
     // We want to accept all the values that either of these browsers accept, but not other values.
 
     // FIXME: This function is not HTML5 compliant. These belong in the MIME registry as "text/javascript<version>" entries.
-    typedef HashSet<String, ASCIICaseInsensitiveHash> LanguageSet;
+    typedef HashSet<String, CaseFoldingHash> LanguageSet;
     static NeverDestroyed<LanguageSet> languages;
     if (languages.get().isEmpty()) {
         languages.get().add("javascript");
index 79e52b5..62cf7ec 100644 (file)
@@ -77,7 +77,7 @@ public:
     bool allowExecutionWhenDisabled;
 };
 
-typedef HashMap<String, const EditorInternalCommand*, ASCIICaseInsensitiveHash> CommandMap;
+typedef HashMap<String, const EditorInternalCommand*, CaseFoldingHash> CommandMap;
 
 static const bool notTextInsertion = false;
 static const bool isTextInsertion = true;
index 8b28310..c6b620f 100644 (file)
@@ -166,7 +166,7 @@ static bool shouldNotPerformURLAdjustment()
 // FIXME: This function should not deal with url or serviceType!
 void HTMLObjectElement::parametersForPlugin(Vector<String>& paramNames, Vector<String>& paramValues, String& url, String& serviceType)
 {
-    HashSet<StringImpl*, ASCIICaseInsensitiveHash> uniqueParamNames;
+    HashSet<StringImpl*, CaseFoldingHash> uniqueParamNames;
     String urlParameter;
     
     // Scan the PARAM children and store their name/value pairs.
index f77f134..7da4f4a 100644 (file)
@@ -86,7 +86,7 @@ using namespace HTMLNames;
 typedef bool (RuntimeEnabledFeatures::*InputTypeConditionalFunction)() const;
 typedef const AtomicString& (*InputTypeNameFunction)();
 typedef std::unique_ptr<InputType> (*InputTypeFactoryFunction)(HTMLInputElement&);
-typedef HashMap<AtomicString, InputTypeFactoryFunction, ASCIICaseInsensitiveHash> InputTypeFactoryMap;
+typedef HashMap<AtomicString, InputTypeFactoryFunction, CaseFoldingHash> InputTypeFactoryMap;
 
 template<class T>
 static std::unique_ptr<InputType> createInputType(HTMLInputElement& element)
index 7438c03..90f9be6 100644 (file)
@@ -34,7 +34,7 @@
 
 namespace WebCore {
 
-typedef HashSet<String, ASCIICaseInsensitiveHash> HTTPHeaderSet;
+typedef HashSet<String, CaseFoldingHash> HTTPHeaderSet;
 
 class HTTPHeaderMap;
 enum class HTTPHeaderName;
index afe4f76..f4785ff 100644 (file)
@@ -59,7 +59,7 @@ private:
     std::chrono::steady_clock::time_point m_absoluteExpiryTime;
     StoredCredentials m_credentials;
     HashSet<String> m_methods;
-    HashSet<String, ASCIICaseInsensitiveHash> m_headers;
+    HashSet<String, CaseFoldingHash> m_headers;
 };
 
 class CrossOriginPreflightResultCache {
index 012401c..07091e3 100644 (file)
@@ -47,7 +47,7 @@
 namespace WebCore {
 
 typedef PassRefPtr<Archive> RawDataCreationFunction(const URL&, SharedBuffer*);
-typedef HashMap<String, RawDataCreationFunction*, ASCIICaseInsensitiveHash> ArchiveMIMETypesMap;
+typedef HashMap<String, RawDataCreationFunction*, CaseFoldingHash> ArchiveMIMETypesMap;
 
 // The create functions in the archive classes return PassRefPtr to concrete subclasses
 // of Archive. This adaptor makes the functions have a uniform return type.
index dcde693..620f1c3 100644 (file)
@@ -150,7 +150,7 @@ static HashSet<String>* pdfMIMETypes;
 static HashSet<String>* pdfAndPostScriptMIMETypes;
 static HashSet<String>* unsupportedTextMIMETypes;
 
-typedef HashMap<String, Vector<String>*, ASCIICaseInsensitiveHash> MediaMIMETypeMap;
+typedef HashMap<String, Vector<String>*, CaseFoldingHash> MediaMIMETypeMap;
     
 static void initializeSupportedImageMIMETypes()
 {
index 79b1593..71ee999 100644 (file)
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-typedef HashSet<String, ASCIICaseInsensitiveHash> URLSchemesMap;
+typedef HashSet<String, CaseFoldingHash> URLSchemesMap;
 
 class SchemeRegistry {
 public:
index 7261003..f2f3569 100644 (file)
@@ -1990,7 +1990,7 @@ bool URL::isBlankURL() const
     return protocolIs("about");
 }
 
-typedef HashMap<String, unsigned short, ASCIICaseInsensitiveHash> DefaultPortsMap;
+typedef HashMap<String, unsigned short, CaseFoldingHash> DefaultPortsMap;
 static const DefaultPortsMap& defaultPortsMap()
 {
     static NeverDestroyed<const DefaultPortsMap> defaultPortsMap(DefaultPortsMap({
index 25b1a6b..4af0916 100644 (file)
@@ -97,46 +97,50 @@ FontCache::FontCache()
 }
 
 struct FontPlatformDataCacheKey {
-    AtomicString family;
-    FontDescriptionKey description;
-
-    FontPlatformDataCacheKey() = default;
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    FontPlatformDataCacheKey() { }
     FontPlatformDataCacheKey(const AtomicString& family, const FontDescription& description)
-        : family(family), description(description)
-    {
-    }
+        : m_fontDescriptionKey(description)
+        , m_family(family)
+    }
 
-    explicit FontPlatformDataCacheKey(HashTableDeletedValueType)
-        : description(HashTableDeletedValue)
-    {
-    }
-    bool isHashTableDeletedValue() const
+    explicit FontPlatformDataCacheKey(HashTableDeletedValueType t)
+        : m_fontDescriptionKey(t)
+    { }
+
+    bool isHashTableDeletedValue() const { return m_fontDescriptionKey.isHashTableDeletedValue(); }
+
+    bool operator==(const FontPlatformDataCacheKey& other) const
     {
-        return description.isHashTableDeletedValue();
+        if (m_fontDescriptionKey != other.m_fontDescriptionKey)
+            return false;
+        if (m_family.impl() == other.m_family.impl())
+            return true;
+        if (m_family.isNull() || other.m_family.isNull())
+            return false;
+        return CaseFoldingHash::equal(m_family, other.m_family);
     }
+
+    FontDescriptionKey m_fontDescriptionKey;
+    AtomicString m_family;
 };
 
 struct FontPlatformDataCacheKeyHash {
-    static unsigned hash(const FontPlatformDataCacheKey& key)
+    static unsigned hash(const FontPlatformDataCacheKey& fontKey)
     {
-        return pairIntHash(ASCIICaseInsensitiveHash::hash(key.family), key.description.computeHash());
+        return pairIntHash(CaseFoldingHash::hash(fontKey.m_family), fontKey.m_fontDescriptionKey.computeHash());
     }
+         
     static bool equal(const FontPlatformDataCacheKey& a, const FontPlatformDataCacheKey& b)
     {
-        return a.description == b.description && equalIgnoringASCIICase(a.family, b.family);
+        return a == b;
     }
-    static const bool safeToCompareToEmptyOrDeleted = true;
-};
 
-struct FontPlatformDataCacheKeyTraits : SimpleClassHashTraits<FontPlatformDataCacheKey> {
-    static const bool hasIsEmptyValueFunction = true;
-    static bool isEmptyValue(const FontPlatformDataCacheKey& key)
-    {
-        return key.family.isNull();
-    }
+    static const bool safeToCompareToEmptyOrDeleted = true;
 };
 
-typedef HashMap<FontPlatformDataCacheKey, std::unique_ptr<FontPlatformData>, FontPlatformDataCacheKeyHash, FontPlatformDataCacheKeyTraits> FontPlatformDataCache;
+typedef HashMap<FontPlatformDataCacheKey, std::unique_ptr<FontPlatformData>, FontPlatformDataCacheKeyHash, WTF::SimpleClassHashTraits<FontPlatformDataCacheKey>> FontPlatformDataCache;
 
 static FontPlatformDataCache& fontPlatformDataCache()
 {
@@ -203,9 +207,9 @@ static AtomicString alternateFamilyName(const AtomicString& familyName)
     return nullAtom;
 }
 
-// FIXME: This function name should not have the word "get" in it for WebKit coding style.
-// FIXME: The boolean here is poor coding style. Easy to factor this into two functions so we don't need it.
-FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fontDescription, const AtomicString& passedFamilyName, bool checkingAlternateName)
+FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fontDescription,
+                                                       const AtomicString& passedFamilyName,
+                                                       bool checkingAlternateName)
 {
 #if PLATFORM(IOS)
     FontLocker fontLocker;
@@ -214,9 +218,9 @@ FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fo
 #if OS(WINDOWS) && ENABLE(OPENTYPE_VERTICAL)
     // Leading "@" in the font name enables Windows vertical flow flag for the font.
     // Because we do vertical flow by ourselves, we don't want to use the Windows feature.
-    // IE disregards "@" regardless of the orientation, so we follow the behavior.
-    const AtomicString& familyName = passedFamilyName[0] != '@'
-        passedFamilyName : AtomicString(passedFamilyName.impl()->substring(1));
+    // IE disregards "@" regardless of the orientatoin, so we follow the behavior.
+    const AtomicString& familyName = (passedFamilyName.isEmpty() || passedFamilyName[0] != '@') ?
+        passedFamilyName : AtomicString(passedFamilyName.impl()->substring(1));
 #else
     const AtomicString& familyName = passedFamilyName;
 #endif
@@ -233,13 +237,14 @@ FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fo
     FontPlatformDataCache::iterator it = addResult.iterator;
     if (addResult.isNewEntry) {
         it->value = createFontPlatformData(fontDescription, familyName);
+
         if (!it->value && !checkingAlternateName) {
-            // We were unable to find a font. We have a small set of fonts that we alias to other names,
-            // e.g., Arial/Helvetica, Courier/Courier New, etc. Try looking up the font under the aliased name.
-            auto alternateName = alternateFamilyName(familyName);
+            // We were unable to find a font.  We have a small set of fonts that we alias to other names,
+            // e.g., Arial/Helvetica, Courier/Courier New, etc.  Try looking up the font under the aliased name.
+            const AtomicString alternateName = alternateFamilyName(familyName);
             if (!alternateName.isNull()) {
                 FontPlatformData* fontPlatformDataForAlternateName = getCachedFontPlatformData(fontDescription, alternateName, true);
-                // Look up the key in the hash table again as the previous iterator may have
+                // Lookup the key in the hash table again as the previous iterator may have
                 // been invalidated by the recursive call to getCachedFontPlatformData().
                 it = fontPlatformDataCache().find(key);
                 ASSERT(it != fontPlatformDataCache().end());
index 1f51de0..16dfd67 100644 (file)
@@ -190,20 +190,22 @@ public:
     Ref<FontCascadeFonts> fonts;
 };
 
-// FIXME: Should make hash traits for FontCascadeCacheKey instead of using a hash as the key (so we hash a hash).
 typedef HashMap<unsigned, std::unique_ptr<FontCascadeCacheEntry>, AlreadyHashed> FontCascadeCache;
 
-static bool keysMatch(const FontCascadeCacheKey& a, const FontCascadeCacheKey& b)
+static bool operator==(const FontCascadeCacheKey& a, const FontCascadeCacheKey& b)
 {
     if (a.fontDescriptionKey != b.fontDescriptionKey)
         return false;
     if (a.fontSelectorId != b.fontSelectorId || a.fontSelectorVersion != b.fontSelectorVersion)
         return false;
-    unsigned size = a.families.size();
-    if (size != b.families.size())
+    if (a.families.size() != b.families.size())
         return false;
-    for (unsigned i = 0; i < size; ++i) {
-        if (!equalIgnoringASCIICase(a.families[i], b.families[i]))
+    for (unsigned i = 0; i < a.families.size(); ++i) {
+        auto* aImpl = a.families[i].impl();
+        auto* bImpl = b.families[i].impl();
+        if (aImpl == bImpl)
+            continue;
+        if (!aImpl || !bImpl || !CaseFoldingHash::equal(aImpl, bImpl))
             return false;
     }
     return true;
@@ -230,27 +232,26 @@ static FontCascadeCacheKey makeFontCascadeCacheKey(const FontCascadeDescription&
 {
     FontCascadeCacheKey key;
     key.fontDescriptionKey = FontDescriptionKey(description);
-    unsigned familyCount = description.familyCount();
-    key.families.reserveInitialCapacity(familyCount);
-    for (unsigned i = 0; i < familyCount; ++i)
-        key.families.uncheckedAppend(description.familyAt(i));
+    for (unsigned i = 0; i < description.familyCount(); ++i)
+        key.families.append(description.familyAt(i));
     key.fontSelectorId = fontSelector ? fontSelector->uniqueId() : 0;
     key.fontSelectorVersion = fontSelector ? fontSelector->version() : 0;
     return key;
 }
 
+// FIXME: Why can't we just teach HashMap about FontCascadeCacheKey instead of hashing a hash?
 static unsigned computeFontCascadeCacheHash(const FontCascadeCacheKey& key)
 {
-    // FIXME: Should hash the key and the family name characters rather than making a hash out of other hashes.
-    IntegerHasher hasher;
-    hasher.add(key.fontDescriptionKey.computeHash());
-    hasher.add(key.fontSelectorId);
-    hasher.add(key.fontSelectorVersion);
-    for (unsigned i = 0; i < key.families.size(); ++i) {
-        StringImpl* family = key.families[i].impl();
-        hasher.add(family ? ASCIICaseInsensitiveHash::hash(family) : 0);
-    }
-    return hasher.hash();
+    Vector<unsigned, 7> hashCodes;
+    hashCodes.reserveInitialCapacity(4 + key.families.size());
+
+    hashCodes.uncheckedAppend(key.fontDescriptionKey.computeHash());
+    hashCodes.uncheckedAppend(key.fontSelectorId);
+    hashCodes.uncheckedAppend(key.fontSelectorVersion);
+    for (unsigned i = 0; i < key.families.size(); ++i)
+        hashCodes.uncheckedAppend(key.families[i].impl() ? CaseFoldingHash::hash(key.families[i]) : 0);
+
+    return StringHasher::hashMemory(hashCodes.data(), hashCodes.size() * sizeof(unsigned));
 }
 
 void pruneUnreferencedEntriesFromFontCascadeCache()
@@ -271,8 +272,8 @@ static Ref<FontCascadeFonts> retrieveOrAddCachedFonts(const FontCascadeDescripti
     auto key = makeFontCascadeCacheKey(fontDescription, fontSelector.get());
 
     unsigned hash = computeFontCascadeCacheHash(key);
-    auto addResult = fontCascadeCache().add(hash, nullptr);
-    if (!addResult.isNewEntry && keysMatch(addResult.iterator->value->key, key))
+    auto addResult = fontCascadeCache().add(hash, std::unique_ptr<FontCascadeCacheEntry>());
+    if (!addResult.isNewEntry && addResult.iterator->value->key == key)
         return addResult.iterator->value->fonts.get();
 
     auto& newEntry = addResult.iterator->value;
index d965531..6d325c0 100644 (file)
@@ -645,7 +645,7 @@ SynthesisPair computeNecessarySynthesis(CTFontRef font, const FontDescription& f
     return SynthesisPair(needsSyntheticBold, needsSyntheticOblique);
 }
 
-typedef HashSet<String, ASCIICaseInsensitiveHash> Whitelist;
+typedef HashSet<String, CaseFoldingHash> Whitelist;
 static Whitelist& fontWhitelist()
 {
     static NeverDestroyed<Whitelist> whitelist;
index e4de058..2cdd3c6 100644 (file)
@@ -48,7 +48,7 @@ struct CrossThreadHTTPHeaderMapData {
 class HTTPHeaderMap {
 public:
     typedef HashMap<HTTPHeaderName, String, WTF::IntHash<HTTPHeaderName>, WTF::StrongEnumHashTraits<HTTPHeaderName>> CommonHeadersHashMap;
-    typedef HashMap<String, String, ASCIICaseInsensitiveHash> UncommonHeadersHashMap;
+    typedef HashMap<String, String, CaseFoldingHash> UncommonHeadersHashMap;
 
     class HTTPHeaderMapConstIterator {
     public:
index d80d07f..0728422 100644 (file)
@@ -366,19 +366,21 @@ bool RenderStyle::inheritedNotEqual(const RenderStyle* other) const
 }
 
 #if ENABLE(IOS_TEXT_AUTOSIZING)
-
-static inline unsigned computeFontHash(const FontCascade& font)
+inline unsigned computeFontHash(const FontCascade& font)
 {
-    IntegerHasher hasher;
-    hasher.add(ASCIICaseInsensitiveHash::hash(font.fontDescription().firstFamily()));
-    hasher.add(font.fontDescription().specifiedSize());
-    return hasher.hash();
+    unsigned hashCodes[2] = {
+        CaseFoldingHash::hash(font.fontDescription().firstFamily().impl()),
+        static_cast<unsigned>(font.fontDescription().specifiedSize())
+    };
+    return StringHasher::computeHash(reinterpret_cast<UChar*>(hashCodes), 2 * sizeof(unsigned) / sizeof(UChar));
 }
 
-unsigned RenderStyle::hashForTextAutosizing() const
+uint32_t RenderStyle::hashForTextAutosizing() const
 {
     // FIXME: Not a very smart hash. Could be improved upon. See <https://bugs.webkit.org/show_bug.cgi?id=121131>.
-    unsigned hash = rareNonInheritedData->m_appearance;
+    uint32_t hash = 0;
+    
+    hash ^= rareNonInheritedData->m_appearance;
     hash ^= rareNonInheritedData->marginBeforeCollapse;
     hash ^= rareNonInheritedData->marginAfterCollapse;
     hash ^= rareNonInheritedData->lineClamp.value();
@@ -419,7 +421,6 @@ bool RenderStyle::equalForTextAutosizing(const RenderStyle* other) const
         && noninherited_flags.floating() == other->noninherited_flags.floating()
         && rareNonInheritedData->textOverflow == other->rareNonInheritedData->textOverflow;
 }
-
 #endif // ENABLE(IOS_TEXT_AUTOSIZING)
 
 bool RenderStyle::inheritedDataShared(const RenderStyle* other) const
index ed417f5..475b433 100644 (file)
@@ -1,5 +1,19 @@
 2016-01-30  Commit Queue  <commit-queue@webkit.org>
 
+        Unreviewed, rolling out r195911.
+        https://bugs.webkit.org/show_bug.cgi?id=153723
+
+        Caused frequent assertion failures on bots (Requested by ap on
+        #webkit).
+
+        Reverted changeset:
+
+        "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
+        https://bugs.webkit.org/show_bug.cgi?id=153639
+        http://trac.webkit.org/changeset/195911
+
+2016-01-30  Commit Queue  <commit-queue@webkit.org>
+
         Unreviewed, rolling out r195799 and r195828.
         https://bugs.webkit.org/show_bug.cgi?id=153722
 
index fb8dcd3..27f15ac 100644 (file)
@@ -295,7 +295,7 @@ HRESULT WebCoreStatistics::memoryStatistics(_COM_Outptr_opt_ IPropertyBag** stat
     unsigned long long heapFree = JSDOMWindow::commonVM().heap.capacity() - heapSize;
     GlobalMemoryStatistics globalMemoryStats = globalMemoryStatistics();
 
-    HashMap<String, unsigned long long, ASCIICaseInsensitiveHash> fields;
+    HashMap<String, unsigned long long, CaseFoldingHash> fields;
     fields.add("FastMallocReservedVMBytes", static_cast<unsigned long long>(fastMallocStatistics.reservedVMBytes));
     fields.add("FastMallocCommittedVMBytes", static_cast<unsigned long long>(fastMallocStatistics.committedVMBytes));
     fields.add("FastMallocFreeListBytes", static_cast<unsigned long long>(fastMallocStatistics.freeListBytes));
@@ -304,7 +304,7 @@ HRESULT WebCoreStatistics::memoryStatistics(_COM_Outptr_opt_ IPropertyBag** stat
     fields.add("JavaScriptStackSize", static_cast<unsigned long long>(globalMemoryStats.stackBytes));
     fields.add("JavaScriptJITSize", static_cast<unsigned long long>(globalMemoryStats.JITBytes));
 
-    *statistics = COMPropertyBag<unsigned long long, String, ASCIICaseInsensitiveHash>::adopt(fields);
+    *statistics = COMPropertyBag<unsigned long long, String, CaseFoldingHash>::adopt(fields);
 
     return S_OK;
 }
index cc9e497..04a830d 100644 (file)
@@ -362,11 +362,11 @@ HRESULT WebURLResponse::allHeaderFields(_COM_Outptr_opt_ IPropertyBag** headerFi
     if (!headerFields)
         return E_POINTER;
 
-    HashMap<String, String, ASCIICaseInsensitiveHash> fields;
+    HashMap<String, String, CaseFoldingHash> fields;
     for (const auto& keyValuePair : m_response.httpHeaderFields())
         fields.add(keyValuePair.key, keyValuePair.value);
 
-    *headerFields = COMPropertyBag<String, String, ASCIICaseInsensitiveHash>::adopt(fields);
+    *headerFields = COMPropertyBag<String, String, CaseFoldingHash>::adopt(fields);
     return S_OK;
 }
 
index bd65733..42d2a49 100644 (file)
@@ -1,3 +1,17 @@
+2016-01-30  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r195911.
+        https://bugs.webkit.org/show_bug.cgi?id=153723
+
+        Caused frequent assertion failures on bots (Requested by ap on
+        #webkit).
+
+        Reverted changeset:
+
+        "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
+        https://bugs.webkit.org/show_bug.cgi?id=153639
+        http://trac.webkit.org/changeset/195911
+
 2016-01-30  Dan Bernstein  <mitz@apple.com>
 
         [Cocoa] Get rid of WK_ macros for nullability
index 1489781..00ff15c 100644 (file)
@@ -42,7 +42,7 @@
 using namespace WebKit;
 
 @implementation WKWebViewContentProviderRegistry {
-    HashMap<String, Class <WKWebViewContentProvider>, ASCIICaseInsensitiveHash> _contentProviderForMIMEType;
+    HashMap<String, Class <WKWebViewContentProvider>, CaseFoldingHash> _contentProviderForMIMEType;
     HashCountedSet<WebPageProxy*> _pages;
 }
 
index fe6bc6f..501d68a 100644 (file)
@@ -69,7 +69,7 @@ private:
 
     void setAutoStartOriginsTableWithItemsPassingTest(API::Dictionary&, std::function<bool(double expirationTimestamp)>);
 
-    typedef HashMap<String, PlugInAutoStartOriginMap, ASCIICaseInsensitiveHash> AutoStartTable;
+    typedef HashMap<String, PlugInAutoStartOriginMap, CaseFoldingHash> AutoStartTable;
     typedef HashMap<WebCore::SessionID, AutoStartTable> SessionAutoStartTable;
     SessionAutoStartTable m_autoStartTable;
 
index 10ffa5e..a8e89f9 100644 (file)
@@ -1393,7 +1393,7 @@ private:
     WebCore::Timer m_volatilityTimer;
 #endif
 
-    HashSet<String, ASCIICaseInsensitiveHash> m_mimeTypesWithCustomContentProviders;
+    HashSet<String, CaseFoldingHash> m_mimeTypesWithCustomContentProviders;
     WebCore::Color m_backgroundColor;
 
     HashSet<unsigned> m_activeRenderingSuppressionTokens;
index 27a2c27..303b1f7 100644 (file)
@@ -721,16 +721,16 @@ static inline void addCaseFoldedCharacters(StringHasher& hasher, const String& s
     if (string.isEmpty())
         return;
     if (string.is8Bit()) {
-        hasher.addCharacters<LChar, ASCIICaseInsensitiveHash::foldCase<LChar>>(string.characters8(), string.length());
+        hasher.addCharacters<LChar, CaseFoldingHash::foldCase<LChar>>(string.characters8(), string.length());
         return;
     }
-    hasher.addCharacters<UChar, ASCIICaseInsensitiveHash::foldCase<UChar>>(string.characters16(), string.length());
+    hasher.addCharacters<UChar, CaseFoldingHash::foldCase<UChar>>(string.characters16(), string.length());
 }
 
 static unsigned hashForPlugInOrigin(const String& pageOrigin, const String& pluginOrigin, const String& mimeType)
 {
     // We want to avoid concatenating the strings and then taking the hash, since that could lead to an expensive conversion.
-    // We also want to avoid using the hash() function in StringImpl or ASCIICaseInsensitiveHash because that masks out bits for the use of flags.
+    // We also want to avoid using the hash() function in StringImpl or CaseFoldingHash because that masks out bits for the use of flags.
     StringHasher hasher;
     addCaseFoldedCharacters(hasher, pageOrigin);
     hasher.addCharacter(0);
index d03369a..3858ae1 100644 (file)
@@ -1,3 +1,17 @@
+2016-01-30  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r195911.
+        https://bugs.webkit.org/show_bug.cgi?id=153723
+
+        Caused frequent assertion failures on bots (Requested by ap on
+        #webkit).
+
+        Reverted changeset:
+
+        "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
+        https://bugs.webkit.org/show_bug.cgi?id=153639
+        http://trac.webkit.org/changeset/195911
+
 2016-01-30  Darin Adler  <darin@apple.com>
 
         Replace CaseFoldingHash with ASCIICaseInsensitiveHash
index 24ea970..f0ccb21 100755 (executable)
@@ -98,7 +98,7 @@ sub wanted
 my $isDOMTypeRename = 0;
 my %renames = (
     # Renames go here in the form of:
-    "CaseFoldingHash" => "ASCIICaseInsensitiveHash",
+    "deleteAllValues" => "deprecatedDeleteAllValues",
 );
 
 my %renamesContemplatedForTheFuture = (