<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[225751] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/225751">225751</a></dd>
<dt>Author</dt> <dd>utatane.tea@gmail.com</dd>
<dt>Date</dt> <dd>2017-12-11 11:22:01 -0800 (Mon, 11 Dec 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WTF] Add Converter traits to StringHasher instead of function pointer
https://bugs.webkit.org/show_bug.cgi?id=180656

Reviewed by JF Bastien.

Source/WebKit:

* WebProcess/WebProcess.cpp:
(WebKit::addCaseFoldedCharacters):

Source/WTF:

In the latest ICU, UChar is char16_t. So defining defaultConverter(UChar)
and defaultConverter(char16_t) causes duplicate definitions.
Instead of passing a funtion pointer, we pass a trait class DefaultConveter
which has `convert` static function. And we make this `convert` function
generic. This avoids defining convert function for UChar and char16_t.

* wtf/text/StringHash.h:
(WTF::ASCIICaseInsensitiveHash::FoldCase::convert):
(WTF::ASCIICaseInsensitiveHash::hash):
(WTF::ASCIICaseInsensitiveHash::foldCase): Deleted.
* wtf/text/StringHasher.h:
(WTF::StringHasher::DefaultConverter::convert):
(WTF::StringHasher::addCharactersAssumingAligned):
(WTF::StringHasher::addCharacters):
(WTF::StringHasher::computeHashAndMaskTop8Bits):
(WTF::StringHasher::computeHash):
(WTF::StringHasher::computeLiteralHash):
(WTF::StringHasher::computeLiteralHashAndMaskTop8Bits):
(WTF::StringHasher::computeHashImpl):
(WTF::StringHasher::Converter): Deleted.
(WTF::StringHasher::defaultConverter): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtftextStringHashh">trunk/Source/WTF/wtf/text/StringHash.h</a></li>
<li><a href="#trunkSourceWTFwtftextStringHasherh">trunk/Source/WTF/wtf/text/StringHasher.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebProcesscpp">trunk/Source/WebKit/WebProcess/WebProcess.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (225750 => 225751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog       2017-12-11 19:19:35 UTC (rev 225750)
+++ trunk/Source/WTF/ChangeLog  2017-12-11 19:22:01 UTC (rev 225751)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2017-12-11  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Add Converter traits to StringHasher instead of function pointer
+        https://bugs.webkit.org/show_bug.cgi?id=180656
+
+        Reviewed by JF Bastien.
+
+        In the latest ICU, UChar is char16_t. So defining defaultConverter(UChar)
+        and defaultConverter(char16_t) causes duplicate definitions.
+        Instead of passing a funtion pointer, we pass a trait class DefaultConveter
+        which has `convert` static function. And we make this `convert` function
+        generic. This avoids defining convert function for UChar and char16_t.
+
+        * wtf/text/StringHash.h:
+        (WTF::ASCIICaseInsensitiveHash::FoldCase::convert):
+        (WTF::ASCIICaseInsensitiveHash::hash):
+        (WTF::ASCIICaseInsensitiveHash::foldCase): Deleted.
+        * wtf/text/StringHasher.h:
+        (WTF::StringHasher::DefaultConverter::convert):
+        (WTF::StringHasher::addCharactersAssumingAligned):
+        (WTF::StringHasher::addCharacters):
+        (WTF::StringHasher::computeHashAndMaskTop8Bits):
+        (WTF::StringHasher::computeHash):
+        (WTF::StringHasher::computeLiteralHash):
+        (WTF::StringHasher::computeLiteralHashAndMaskTop8Bits):
+        (WTF::StringHasher::computeHashImpl):
+        (WTF::StringHasher::Converter): Deleted.
+        (WTF::StringHasher::defaultConverter): Deleted.
+
</ins><span class="cx"> 2017-12-10  Yusuke Suzuki  <utatane.tea@gmail.com>
</span><span class="cx"> 
</span><span class="cx">         [WTF] Reduce sizeof(Thread) by adjusting alignment
</span></span></pre></div>
<a id="trunkSourceWTFwtftextStringHashh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/StringHash.h (225750 => 225751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/StringHash.h   2017-12-11 19:19:35 UTC (rev 225750)
+++ trunk/Source/WTF/wtf/text/StringHash.h      2017-12-11 19:22:01 UTC (rev 225751)
</span><span class="lines">@@ -80,14 +80,17 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     struct ASCIICaseInsensitiveHash {
</span><del>-        template<typename T> static inline UChar foldCase(T character)
-        {
-            return toASCIILower(character);
-        }
</del><ins>+        template<typename T>
+        struct FoldCase {
+            static inline UChar convert(T character)
+            {
+                return toASCIILower(character);
+            }
+        };
</ins><span class="cx"> 
</span><span class="cx">         static unsigned hash(const UChar* data, unsigned length)
</span><span class="cx">         {
</span><del>-            return StringHasher::computeHashAndMaskTop8Bits<UChar, foldCase<UChar>>(data, length);
</del><ins>+            return StringHasher::computeHashAndMaskTop8Bits<UChar, FoldCase<UChar>>(data, length);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         static unsigned hash(StringImpl& string)
</span><span class="lines">@@ -104,7 +107,7 @@
</span><span class="cx"> 
</span><span class="cx">         static unsigned hash(const LChar* data, unsigned length)
</span><span class="cx">         {
</span><del>-            return StringHasher::computeHashAndMaskTop8Bits<LChar, foldCase<LChar>>(data, length);
</del><ins>+            return StringHasher::computeHashAndMaskTop8Bits<LChar, FoldCase<LChar>>(data, length);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         static inline unsigned hash(const char* data, unsigned length)
</span></span></pre></div>
<a id="trunkSourceWTFwtftextStringHasherh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/StringHasher.h (225750 => 225751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/StringHasher.h 2017-12-11 19:19:35 UTC (rev 225750)
+++ trunk/Source/WTF/wtf/text/StringHasher.h    2017-12-11 19:22:01 UTC (rev 225751)
</span><span class="lines">@@ -42,6 +42,14 @@
</span><span class="cx">     static constexpr const unsigned flagCount = 8; // Save 8 bits for StringImpl to use as flags.
</span><span class="cx">     static constexpr const unsigned maskHash = (1U << (sizeof(unsigned) * 8 - flagCount)) - 1;
</span><span class="cx"> 
</span><ins>+    struct DefaultConverter {
+        template<typename CharType>
+        static constexpr UChar convert(CharType character)
+        {
+            return static_cast<std::make_unsigned_t<CharType>>((character));
+        }
+    };
+
</ins><span class="cx">     StringHasher() = default;
</span><span class="cx"> 
</span><span class="cx">     // The hasher hashes two characters at a time, and thus an "aligned" hasher is one
</span><span class="lines">@@ -82,7 +90,7 @@
</span><span class="cx">         addCharactersAssumingAligned(a, b);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    template<typename T, UChar Converter(T)> void addCharactersAssumingAligned(const T* data, unsigned length)
</del><ins>+    template<typename T, typename Converter> void addCharactersAssumingAligned(const T* data, unsigned length)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(!m_hasPendingCharacter);
</span><span class="cx"> 
</span><span class="lines">@@ -90,20 +98,20 @@
</span><span class="cx">         length >>= 1;
</span><span class="cx"> 
</span><span class="cx">         while (length--) {
</span><del>-            addCharactersAssumingAligned(Converter(data[0]), Converter(data[1]));
</del><ins>+            addCharactersAssumingAligned(Converter::convert(data[0]), Converter::convert(data[1]));
</ins><span class="cx">             data += 2;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (remainder)
</span><del>-            addCharacter(Converter(*data));
</del><ins>+            addCharacter(Converter::convert(*data));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     template<typename T> void addCharactersAssumingAligned(const T* data, unsigned length)
</span><span class="cx">     {
</span><del>-        addCharactersAssumingAligned<T, defaultConverter>(data, length);
</del><ins>+        addCharactersAssumingAligned<T, DefaultConverter>(data, length);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    template<typename T, UChar Converter(T)> void addCharactersAssumingAligned(const T* data)
</del><ins>+    template<typename T, typename Converter> void addCharactersAssumingAligned(const T* data)
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(!m_hasPendingCharacter);
</span><span class="cx"> 
</span><span class="lines">@@ -110,25 +118,25 @@
</span><span class="cx">         while (T a = *data++) {
</span><span class="cx">             T b = *data++;
</span><span class="cx">             if (!b) {
</span><del>-                addCharacter(Converter(a));
</del><ins>+                addCharacter(Converter::convert(a));
</ins><span class="cx">                 break;
</span><span class="cx">             }
</span><del>-            addCharactersAssumingAligned(Converter(a), Converter(b));
</del><ins>+            addCharactersAssumingAligned(Converter::convert(a), Converter::convert(b));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     template<typename T> void addCharactersAssumingAligned(const T* data)
</span><span class="cx">     {
</span><del>-        addCharactersAssumingAligned<T, defaultConverter>(data);
</del><ins>+        addCharactersAssumingAligned<T, DefaultConverter>(data);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    template<typename T, UChar Converter(T)> void addCharacters(const T* data, unsigned length)
</del><ins>+    template<typename T, typename Converter> void addCharacters(const T* data, unsigned length)
</ins><span class="cx">     {
</span><span class="cx">         if (!length)
</span><span class="cx">             return;
</span><span class="cx">         if (m_hasPendingCharacter) {
</span><span class="cx">             m_hasPendingCharacter = false;
</span><del>-            addCharactersAssumingAligned(m_pendingCharacter, Converter(*data++));
</del><ins>+            addCharactersAssumingAligned(m_pendingCharacter, Converter::convert(*data++));
</ins><span class="cx">             --length;
</span><span class="cx">         }
</span><span class="cx">         addCharactersAssumingAligned<T, Converter>(data, length);
</span><span class="lines">@@ -136,14 +144,14 @@
</span><span class="cx"> 
</span><span class="cx">     template<typename T> void addCharacters(const T* data, unsigned length)
</span><span class="cx">     {
</span><del>-        addCharacters<T, defaultConverter>(data, length);
</del><ins>+        addCharacters<T, DefaultConverter>(data, length);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    template<typename T, UChar Converter(T)> void addCharacters(const T* data)
</del><ins>+    template<typename T, typename Converter> void addCharacters(const T* data)
</ins><span class="cx">     {
</span><span class="cx">         if (m_hasPendingCharacter && *data) {
</span><span class="cx">             m_hasPendingCharacter = false;
</span><del>-            addCharactersAssumingAligned(m_pendingCharacter, Converter(*data++));
</del><ins>+            addCharactersAssumingAligned(m_pendingCharacter, Converter::convert(*data++));
</ins><span class="cx">         }
</span><span class="cx">         addCharactersAssumingAligned<T, Converter>(data);
</span><span class="cx">     }
</span><span class="lines">@@ -150,7 +158,7 @@
</span><span class="cx"> 
</span><span class="cx">     template<typename T> void addCharacters(const T* data)
</span><span class="cx">     {
</span><del>-        addCharacters<T, defaultConverter>(data);
</del><ins>+        addCharacters<T, DefaultConverter>(data);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned hashWithTop8BitsMasked() const
</span><span class="lines">@@ -163,12 +171,12 @@
</span><span class="cx">         return finalize(processPendingCharacter());
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    template<typename T, UChar Converter(T)> static constexpr unsigned computeHashAndMaskTop8Bits(const T* data, unsigned length)
</del><ins>+    template<typename T, typename Converter> static constexpr unsigned computeHashAndMaskTop8Bits(const T* data, unsigned length)
</ins><span class="cx">     {
</span><span class="cx">         return finalizeAndMaskTop8Bits(computeHashImpl<T, Converter>(data, length));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    template<typename T, UChar Converter(T)> static constexpr unsigned computeHashAndMaskTop8Bits(const T* data)
</del><ins>+    template<typename T, typename Converter> static constexpr unsigned computeHashAndMaskTop8Bits(const T* data)
</ins><span class="cx">     {
</span><span class="cx">         return finalizeAndMaskTop8Bits(computeHashImpl<T, Converter>(data));
</span><span class="cx">     }
</span><span class="lines">@@ -175,20 +183,20 @@
</span><span class="cx"> 
</span><span class="cx">     template<typename T> static constexpr unsigned computeHashAndMaskTop8Bits(const T* data, unsigned length)
</span><span class="cx">     {
</span><del>-        return computeHashAndMaskTop8Bits<T, defaultConverter>(data, length);
</del><ins>+        return computeHashAndMaskTop8Bits<T, DefaultConverter>(data, length);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     template<typename T> static constexpr unsigned computeHashAndMaskTop8Bits(const T* data)
</span><span class="cx">     {
</span><del>-        return computeHashAndMaskTop8Bits<T, defaultConverter>(data);
</del><ins>+        return computeHashAndMaskTop8Bits<T, DefaultConverter>(data);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    template<typename T, UChar Converter(T)> static constexpr unsigned computeHash(const T* data, unsigned length)
</del><ins>+    template<typename T, typename Converter> static constexpr unsigned computeHash(const T* data, unsigned length)
</ins><span class="cx">     {
</span><span class="cx">         return finalize(computeHashImpl<T, Converter>(data, length));
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    template<typename T, UChar Converter(T)> static constexpr unsigned computeHash(const T* data)
</del><ins>+    template<typename T, typename Converter> static constexpr unsigned computeHash(const T* data)
</ins><span class="cx">     {
</span><span class="cx">         return finalize(computeHashImpl<T, Converter>(data));
</span><span class="cx">     }
</span><span class="lines">@@ -195,12 +203,12 @@
</span><span class="cx"> 
</span><span class="cx">     template<typename T> static constexpr unsigned computeHash(const T* data, unsigned length)
</span><span class="cx">     {
</span><del>-        return computeHash<T, defaultConverter>(data, length);
</del><ins>+        return computeHash<T, DefaultConverter>(data, length);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     template<typename T> static constexpr unsigned computeHash(const T* data)
</span><span class="cx">     {
</span><del>-        return computeHash<T, defaultConverter>(data);
</del><ins>+        return computeHash<T, DefaultConverter>(data);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -207,13 +215,13 @@
</span><span class="cx">     template<typename T, unsigned charactersCount>
</span><span class="cx">     static constexpr unsigned computeLiteralHash(const T (&characters)[charactersCount])
</span><span class="cx">     {
</span><del>-        return computeHash<T, defaultConverter>(characters, charactersCount - 1);
</del><ins>+        return computeHash<T, DefaultConverter>(characters, charactersCount - 1);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     template<typename T, unsigned charactersCount>
</span><span class="cx">     static constexpr unsigned computeLiteralHashAndMaskTop8Bits(const T (&characters)[charactersCount])
</span><span class="cx">     {
</span><del>-        return computeHashAndMaskTop8Bits<T, defaultConverter>(characters, charactersCount - 1);
</del><ins>+        return computeHashAndMaskTop8Bits<T, DefaultConverter>(characters, charactersCount - 1);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     static unsigned hashMemory(const void* data, unsigned length)
</span><span class="lines">@@ -234,26 +242,6 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    static constexpr UChar defaultConverter(UChar character)
-    {
-        return character;
-    }
-
-    static constexpr UChar defaultConverter(LChar character)
-    {
-        return character;
-    }
-
-    static constexpr UChar defaultConverter(char character)
-    {
-        return static_cast<LChar>(character);
-    }
-
-    static constexpr UChar defaultConverter(char16_t character)
-    {
-        return character;
-    }
-
</del><span class="cx">     ALWAYS_INLINE static constexpr unsigned avalancheBits(unsigned hash)
</span><span class="cx">     {
</span><span class="cx">         unsigned result = hash;
</span><span class="lines">@@ -312,7 +300,7 @@
</span><span class="cx">         return result;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    template<typename T, UChar Converter(T)>
</del><ins>+    template<typename T, typename Converter>
</ins><span class="cx">     static constexpr unsigned computeHashImpl(const T* characters, unsigned length)
</span><span class="cx">     {
</span><span class="cx">         unsigned result = stringHashingStartValue;
</span><span class="lines">@@ -320,16 +308,16 @@
</span><span class="cx">         length >>= 1;
</span><span class="cx"> 
</span><span class="cx">         while (length--) {
</span><del>-            result = calculateWithTwoCharacters(result, Converter(characters[0]), Converter(characters[1]));
</del><ins>+            result = calculateWithTwoCharacters(result, Converter::convert(characters[0]), Converter::convert(characters[1]));
</ins><span class="cx">             characters += 2;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (remainder)
</span><del>-            return calculateWithRemainingLastCharacter(result, Converter(characters[0]));
</del><ins>+            return calculateWithRemainingLastCharacter(result, Converter::convert(characters[0]));
</ins><span class="cx">         return result;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    template<typename T, UChar Converter(T)>
</del><ins>+    template<typename T, typename Converter>
</ins><span class="cx">     static constexpr unsigned computeHashImpl(const T* characters)
</span><span class="cx">     {
</span><span class="cx">         unsigned result = stringHashingStartValue;
</span><span class="lines">@@ -336,8 +324,8 @@
</span><span class="cx">         while (T a = *characters++) {
</span><span class="cx">             T b = *characters++;
</span><span class="cx">             if (!b)
</span><del>-                return calculateWithRemainingLastCharacter(result, Converter(a));
-            result = calculateWithTwoCharacters(result, Converter(a), Converter(b));
</del><ins>+                return calculateWithRemainingLastCharacter(result, Converter::convert(a));
+            result = calculateWithTwoCharacters(result, Converter::convert(a), Converter::convert(b));
</ins><span class="cx">         }
</span><span class="cx">         return result;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (225750 => 225751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2017-12-11 19:19:35 UTC (rev 225750)
+++ trunk/Source/WebKit/ChangeLog       2017-12-11 19:22:01 UTC (rev 225751)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2017-12-11  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Add Converter traits to StringHasher instead of function pointer
+        https://bugs.webkit.org/show_bug.cgi?id=180656
+
+        Reviewed by JF Bastien.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::addCaseFoldedCharacters):
+
</ins><span class="cx"> 2017-12-11  David Quesada  <david_quesada@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Turn on ENABLE_APPLICATION_MANIFEST
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (225750 => 225751)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebProcess.cpp    2017-12-11 19:19:35 UTC (rev 225750)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp       2017-12-11 19:22:01 UTC (rev 225751)
</span><span class="lines">@@ -779,10 +779,10 @@
</span><span class="cx">     if (string.isEmpty())
</span><span class="cx">         return;
</span><span class="cx">     if (string.is8Bit()) {
</span><del>-        hasher.addCharacters<LChar, ASCIICaseInsensitiveHash::foldCase<LChar>>(string.characters8(), string.length());
</del><ins>+        hasher.addCharacters<LChar, ASCIICaseInsensitiveHash::FoldCase<LChar>>(string.characters8(), string.length());
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    hasher.addCharacters<UChar, ASCIICaseInsensitiveHash::foldCase<UChar>>(string.characters16(), string.length());
</del><ins>+    hasher.addCharacters<UChar, ASCIICaseInsensitiveHash::FoldCase<UChar>>(string.characters16(), string.length());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static unsigned hashForPlugInOrigin(const String& pageOrigin, const String& pluginOrigin, const String& mimeType)
</span></span></pre>
</div>
</div>

</body>
</html>