<!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>[242490] releases/WebKitGTK/webkit-2.24</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/242490">242490</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2019-03-05 09:23:14 -0800 (Tue, 05 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/242308">r242308</a> - Finish removing String::format
https://bugs.webkit.org/show_bug.cgi?id=194893

Reviewed by Daniel Bates.
Source/JavaScriptCore:

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::nameForRegister): Use makeString instead of String::format,
using the new "pad" function.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::lastModified const): Use makeString and pad.
* html/FTPDirectoryDocument.cpp:
(WebCore::processFileDateString): Ditto.

* mathml/MathMLElement.cpp:
(WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.

* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.

* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
(WebCore::gcTimerString): Use String::number.

* platform/DateComponents.cpp:
(WebCore::DateComponents::toStringForTime const): Use makeString and pad.
(WebCore::DateComponents::toString const): Ditto.

* platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
and that was also inaccurate.

* platform/audio/HRTFElevation.cpp:
(WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
Use makeString and pad.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText): Ditto.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::formatMediaControlsTime const): Ditto.

Source/WebKit:

* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
a problem where we passed an NSData * to format with a "%s"."

Source/WebKitLegacy/win:

* FullscreenVideoController.cpp:
(timeToString): Use makeString and pad.

Source/WTF:

* wtf/Assertions.cpp:
(WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
(WTFLog): Use WTF::createWithFormatAndArguments instead of String::format.

* wtf/HexNumber.h: Deleted unneeded toString function.

* wtf/text/StringConcatenate.h: Got rid of unneeded forward declaration of
StringTypeAdapter, since that's now in Forward.h. Tweaked formatting of templates
a bit. Use function templates for writeTo functions rather than having two of each.
Removed unused toString functions. Optimized case where we use have a UChar* and
a length of zero to not force the result to be 16-bit. Also gets rid of a small
NO_RETURN_DUE_TO_CRASH mess that we don't need. Refactored constructors to use some
static member helper functions to compute string lengths. Added the pad function
and the PaddingSpecification struct template, so we can add padding to anything
we can turn into a string. Got rid of the special case overload for single
arguments, since it only worked for things that the String constructor can handle.
Instead we will now use StringTypeAdapter, which works for more types. Possibly
less optimal for some special cases, which we could specialize for later if we like.
* wtf/text/StringConcatenateNumbers.h: Ditto.
* wtf/text/StringOperators.h: Ditto.
* wtf/text/StringView.h: Ditto.

* wtf/text/WTFString.cpp:
(WTF::createWithFormatAndArguments): Deleted.
(WTF::String::format): Deleted.
* wtf/text/WTFString.h: Deleted declaration of String::format.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit224SourceJavaScriptCoreChangeLog">releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceJavaScriptCorebytecodeCodeBlockcpp">releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore/bytecode/CodeBlock.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWTFChangeLog">releases/WebKitGTK/webkit-2.24/Source/WTF/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWTFwtfAssertionscpp">releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/Assertions.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWTFwtfHexNumberh">releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/HexNumber.h</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWTFwtftextStringConcatenateh">releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringConcatenate.h</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWTFwtftextStringConcatenateNumbersh">releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringConcatenateNumbers.h</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWTFwtftextStringOperatorsh">releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringOperators.h</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWTFwtftextStringViewh">releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringView.h</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWTFwtftextWTFStringcpp">releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/WTFString.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWTFwtftextWTFStringh">releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/WTFString.h</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebCoredomDocumentcpp">releases/WebKitGTK/webkit-2.24/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebCorehtmlFTPDirectoryDocumentcpp">releases/WebKitGTK/webkit-2.24/Source/WebCore/html/FTPDirectoryDocument.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebCoremathmlMathMLElementcpp">releases/WebKitGTK/webkit-2.24/Source/WebCore/mathml/MathMLElement.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebCorepagecocoaResourceUsageOverlayCocoamm">releases/WebKitGTK/webkit-2.24/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebCorepagelinuxResourceUsageOverlayLinuxcpp">releases/WebKitGTK/webkit-2.24/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebCoreplatformDateComponentscpp">releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/DateComponents.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebCoreplatformLocalizedStringscpp">releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/LocalizedStrings.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebCoreplatformaudioHRTFElevationcpp">releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/audio/HRTFElevation.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebCoreplatformmockMockRealtimeVideoSourcecpp">releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebCorerenderingRenderLayerCompositorcpp">releases/WebKitGTK/webkit-2.24/Source/WebCore/rendering/RenderLayerCompositor.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebCorerenderingRenderThemecpp">releases/WebKitGTK/webkit-2.24/Source/WebCore/rendering/RenderTheme.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitChangeLog">releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitUIProcessWebAuthenticationCocoaLocalAuthenticatormm">releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitLegacywinChangeLog">releases/WebKitGTK/webkit-2.24/Source/WebKitLegacy/win/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit224SourceWebKitLegacywinFullscreenVideoControllercpp">releases/WebKitGTK/webkit-2.24/Source/WebKitLegacy/win/FullscreenVideoController.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit224ToolsChangeLog">releases/WebKitGTK/webkit-2.24/Tools/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit224ToolsTestWebKitAPITestsWTFStringConcatenatecpp">releases/WebKitGTK/webkit-2.24/Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit224SourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore/ChangeLog (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore/ChangeLog   2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore/ChangeLog      2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2019-03-01  Darin Adler  <darin@apple.com>
+
+        Finish removing String::format
+        https://bugs.webkit.org/show_bug.cgi?id=194893
+
+        Reviewed by Daniel Bates.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::nameForRegister): Use makeString instead of String::format,
+        using the new "pad" function.
+
</ins><span class="cx"> 2019-03-01  Yusuke Suzuki  <ysuzuki@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [JSC] Fix FTL build on ARM32_64 by adding stubs for JSRopeString::offsetOfXXX
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore/bytecode/CodeBlock.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore/bytecode/CodeBlock.cpp      2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/JavaScriptCore/bytecode/CodeBlock.cpp 2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -92,6 +92,7 @@
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/SimpleStats.h>
</span><span class="cx"> #include <wtf/StringPrintStream.h>
</span><ins>+#include <wtf/text/StringConcatenateNumbers.h>
</ins><span class="cx"> #include <wtf/text/UniquedStringImpl.h>
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(ASSEMBLER)
</span><span class="lines">@@ -2888,9 +2889,9 @@
</span><span class="cx">     if (virtualRegister == thisRegister())
</span><span class="cx">         return "this"_s;
</span><span class="cx">     if (virtualRegister.isArgument())
</span><del>-        return String::format("arguments[%3d]", virtualRegister.toArgument());
</del><ins>+        return makeString("arguments[", pad(' ', 3, virtualRegister.toArgument()), ']');
</ins><span class="cx"> 
</span><del>-    return "";
</del><ins>+    return emptyString();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ValueProfile* CodeBlock::tryGetValueProfileForBytecodeOffset(int bytecodeOffset)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WTF/ChangeLog (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WTF/ChangeLog      2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WTF/ChangeLog 2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2019-03-01  Darin Adler  <darin@apple.com>
+
+        Finish removing String::format
+        https://bugs.webkit.org/show_bug.cgi?id=194893
+
+        Reviewed by Daniel Bates.
+
+        * wtf/Assertions.cpp:
+        (WTF::createWithFormatAndArguments): Moved this here from WTFString.cpp.
+        (WTFLog): Use WTF::createWithFormatAndArguments instead of String::format.
+
+        * wtf/HexNumber.h: Deleted unneeded toString function.
+
+        * wtf/text/StringConcatenate.h: Got rid of unneeded forward declaration of
+        StringTypeAdapter, since that's now in Forward.h. Tweaked formatting of templates
+        a bit. Use function templates for writeTo functions rather than having two of each.
+        Removed unused toString functions. Optimized case where we use have a UChar* and
+        a length of zero to not force the result to be 16-bit. Also gets rid of a small
+        NO_RETURN_DUE_TO_CRASH mess that we don't need. Refactored constructors to use some
+        static member helper functions to compute string lengths. Added the pad function
+        and the PaddingSpecification struct template, so we can add padding to anything
+        we can turn into a string. Got rid of the special case overload for single
+        arguments, since it only worked for things that the String constructor can handle.
+        Instead we will now use StringTypeAdapter, which works for more types. Possibly
+        less optimal for some special cases, which we could specialize for later if we like.
+        * wtf/text/StringConcatenateNumbers.h: Ditto.
+        * wtf/text/StringOperators.h: Ditto.
+        * wtf/text/StringView.h: Ditto.
+
+        * wtf/text/WTFString.cpp:
+        (WTF::createWithFormatAndArguments): Deleted.
+        (WTF::String::format): Deleted.
+        * wtf/text/WTFString.h: Deleted declaration of String::format.
+
</ins><span class="cx"> 2019-02-28  Yusuke Suzuki  <ysuzuki@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [JSC] sizeof(JSString) should be 16
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWTFwtfAssertionscpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/Assertions.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/Assertions.cpp     2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/Assertions.cpp        2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -74,6 +74,56 @@
</span><span class="cx"> #include <unistd.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+namespace WTF {
+
+WTF_ATTRIBUTE_PRINTF(1, 0) static String createWithFormatAndArguments(const char* format, va_list args)
+{
+    va_list argsCopy;
+    va_copy(argsCopy, args);
+
+    ALLOW_NONLITERAL_FORMAT_BEGIN
+
+#if USE(CF) && !OS(WINDOWS)
+    if (strstr(format, "%@")) {
+        auto cfFormat = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, format, kCFStringEncodingUTF8));
+        auto result = adoptCF(CFStringCreateWithFormatAndArguments(kCFAllocatorDefault, nullptr, cfFormat.get(), args));
+        va_end(argsCopy);
+        return result.get();
+    }
+#endif
+
+    // Do the format once to get the length.
+#if COMPILER(MSVC)
+    int result = _vscprintf(format, args);
+#else
+    char ch;
+    int result = vsnprintf(&ch, 1, format, args);
+#endif
+
+    if (!result) {
+        va_end(argsCopy);
+        return emptyString();
+    }
+    if (result < 0) {
+        va_end(argsCopy);
+        return { };
+    }
+
+    Vector<char, 256> buffer;
+    unsigned length = result;
+    buffer.grow(length + 1);
+
+    // Now do the formatting again, guaranteed to fit.
+    vsnprintf(buffer.data(), buffer.size(), format, argsCopy);
+    va_end(argsCopy);
+
+    ALLOW_NONLITERAL_FORMAT_END
+
+    return StringImpl::create(reinterpret_cast<const LChar*>(buffer.data()), length);
+}
+
+}
+
</ins><span class="cx"> extern "C" {
</span><span class="cx"> 
</span><span class="cx"> static void logToStderr(const char* buffer)
</span><span class="lines">@@ -399,7 +449,7 @@
</span><span class="cx">     va_start(args, format);
</span><span class="cx"> 
</span><span class="cx">     ALLOW_NONLITERAL_FORMAT_BEGIN
</span><del>-    String loggingString = String::format(format, args);
</del><ins>+    String loggingString = WTF::createWithFormatAndArguments(format, args);
</ins><span class="cx">     ALLOW_NONLITERAL_FORMAT_END
</span><span class="cx"> 
</span><span class="cx">     va_end(args);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWTFwtfHexNumberh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/HexNumber.h (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/HexNumber.h        2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/HexNumber.h   2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -102,7 +102,6 @@
</span><span class="cx">     unsigned length() const { return m_buffer.length; }
</span><span class="cx">     bool is8Bit() const { return true; }
</span><span class="cx">     template<typename CharacterType> void writeTo(CharacterType* destination) const { StringImpl::copyCharacters(destination, characters(), length()); }
</span><del>-    String toString() const { return { characters(), length() }; }
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     const LChar* characters() const { return &*(m_buffer.characters.end() - length()); }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWTFwtftextStringConcatenateh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringConcatenate.h (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringConcatenate.h   2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringConcatenate.h      2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#include <string.h>
</del><ins>+#include <cstring>
</ins><span class="cx"> #include <wtf/CheckedArithmetic.h>
</span><span class="cx"> #include <wtf/text/AtomicString.h>
</span><span class="cx"> #include <wtf/text/StringView.h>
</span><span class="lines">@@ -38,220 +38,203 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="cx"> 
</span><del>-template<typename StringType, typename>
-class StringTypeAdapter;
-
-template<>
-class StringTypeAdapter<char, void> {
</del><ins>+template<> class StringTypeAdapter<char, void> {
</ins><span class="cx"> public:
</span><span class="cx">     StringTypeAdapter(char character)
</span><del>-        : m_character(character)
</del><ins>+        : m_character { character }
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned length() { return 1; }
</span><span class="cx">     bool is8Bit() { return true; }
</span><ins>+    template<typename CharacterType> void writeTo(CharacterType* destination) const { *destination = m_character; }
</ins><span class="cx"> 
</span><del>-    void writeTo(LChar* destination) const
-    {
-        *destination = m_character;
-    }
-
-    void writeTo(UChar* destination) const
-    {
-        *destination = m_character;
-    }
-
-    String toString() const { return String(&m_character, 1); }
-
</del><span class="cx"> private:
</span><span class="cx">     char m_character;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template<>
-class StringTypeAdapter<UChar, void> {
</del><ins>+template<> class StringTypeAdapter<UChar, void> {
</ins><span class="cx"> public:
</span><span class="cx">     StringTypeAdapter(UChar character)
</span><del>-        : m_character(character)
</del><ins>+        : m_character { character }
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned length() const { return 1; }
</span><del>-    bool is8Bit() const { return m_character <= 0xff; }
</del><ins>+    bool is8Bit() const { return isLatin1(m_character); }
</ins><span class="cx"> 
</span><span class="cx">     void writeTo(LChar* destination) const
</span><span class="cx">     {
</span><span class="cx">         ASSERT(is8Bit());
</span><del>-        *destination = static_cast<LChar>(m_character);
-    }
-
-    void writeTo(UChar* destination) const
-    {
</del><span class="cx">         *destination = m_character;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    String toString() const { return String(&m_character, 1); }
</del><ins>+    void writeTo(UChar* destination) const { *destination = m_character; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     UChar m_character;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template<>
-class StringTypeAdapter<const LChar*, void> {
</del><ins>+template<> class StringTypeAdapter<const LChar*, void> {
</ins><span class="cx"> public:
</span><span class="cx">     StringTypeAdapter(const LChar* characters)
</span><del>-        : m_characters(characters)
</del><ins>+        : m_characters { characters }
+        , m_length { computeLength(characters) }
</ins><span class="cx">     {
</span><del>-        size_t length = strlen(reinterpret_cast<const char*>(characters));
-        RELEASE_ASSERT(length <= String::MaxLength);
-        m_length = static_cast<unsigned>(length);
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned length() const { return m_length; }
</span><span class="cx">     bool is8Bit() const { return true; }
</span><ins>+    template<typename CharacterType> void writeTo(CharacterType* destination) const { StringImpl::copyCharacters(destination, m_characters, m_length); }
</ins><span class="cx"> 
</span><del>-    void writeTo(LChar* destination) const
</del><ins>+private:
+    static unsigned computeLength(const LChar* characters)
</ins><span class="cx">     {
</span><del>-        StringView(m_characters, m_length).getCharactersWithUpconvert(destination);
</del><ins>+        size_t length = std::strlen(reinterpret_cast<const char*>(characters));
+        RELEASE_ASSERT(length <= String::MaxLength);
+        return static_cast<unsigned>(length);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void writeTo(UChar* destination) const
-    {
-        StringView(m_characters, m_length).getCharactersWithUpconvert(destination);
-    }
-
-    String toString() const { return String(m_characters, m_length); }
-
-private:
</del><span class="cx">     const LChar* m_characters;
</span><span class="cx">     unsigned m_length;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template<>
-class StringTypeAdapter<const UChar*, void> {
</del><ins>+template<> class StringTypeAdapter<const UChar*, void> {
</ins><span class="cx"> public:
</span><span class="cx">     StringTypeAdapter(const UChar* characters)
</span><del>-        : m_characters(characters)
</del><ins>+        : m_characters { characters }
+        , m_length { computeLength(characters) }
</ins><span class="cx">     {
</span><del>-        size_t length = 0;
-        while (m_characters[length])
-            ++length;
-        RELEASE_ASSERT(length <= String::MaxLength);
-        m_length = static_cast<unsigned>(length);
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned length() const { return m_length; }
</span><del>-    bool is8Bit() const { return false; }
</del><ins>+    bool is8Bit() const { return !m_length; }
+    void writeTo(LChar*) const { ASSERT(!m_length); }
+    void writeTo(UChar* destination) const { StringImpl::copyCharacters(destination, m_characters, m_length); }
</ins><span class="cx"> 
</span><del>-    NO_RETURN_DUE_TO_CRASH void writeTo(LChar*) const
</del><ins>+private:
+    static unsigned computeLength(const UChar* characters)
</ins><span class="cx">     {
</span><del>-        CRASH(); // FIXME make this a compile-time failure https://bugs.webkit.org/show_bug.cgi?id=165791
</del><ins>+        size_t length = 0;
+        while (characters[length])
+            ++length;
+        RELEASE_ASSERT(length <= String::MaxLength);
+        return static_cast<unsigned>(length);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void writeTo(UChar* destination) const
-    {
-        memcpy(destination, m_characters, m_length * sizeof(UChar));
-    }
-
-    String toString() const { return String(m_characters, m_length); }
-
-private:
</del><span class="cx">     const UChar* m_characters;
</span><span class="cx">     unsigned m_length;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template<>
-class StringTypeAdapter<const char*, void> : public StringTypeAdapter<const LChar*, void> {
</del><ins>+template<> class StringTypeAdapter<const char*, void> : public StringTypeAdapter<const LChar*, void> {
</ins><span class="cx"> public:
</span><span class="cx">     StringTypeAdapter(const char* characters)
</span><del>-        : StringTypeAdapter<const LChar*, void>(reinterpret_cast<const LChar*>(characters))
</del><ins>+        : StringTypeAdapter<const LChar*, void> { reinterpret_cast<const LChar*>(characters) }
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template<>
-class StringTypeAdapter<char*, void> : public StringTypeAdapter<const char*, void> {
</del><ins>+template<> class StringTypeAdapter<char*, void> : public StringTypeAdapter<const char*, void> {
</ins><span class="cx"> public:
</span><span class="cx">     StringTypeAdapter(const char* characters)
</span><del>-        : StringTypeAdapter<const char*, void>(characters)
</del><ins>+        : StringTypeAdapter<const char*, void> { characters }
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template<>
-class StringTypeAdapter<ASCIILiteral, void> : public StringTypeAdapter<const char*, void> {
</del><ins>+template<> class StringTypeAdapter<ASCIILiteral, void> : public StringTypeAdapter<const char*, void> {
</ins><span class="cx"> public:
</span><span class="cx">     StringTypeAdapter(ASCIILiteral characters)
</span><del>-        : StringTypeAdapter<const char*, void>(characters)
</del><ins>+        : StringTypeAdapter<const char*, void> { characters }
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template<>
-class StringTypeAdapter<Vector<char>, void> {
</del><ins>+template<> class StringTypeAdapter<Vector<char>, void> {
</ins><span class="cx"> public:
</span><span class="cx">     StringTypeAdapter(const Vector<char>& vector)
</span><del>-        : m_vector(vector)
</del><ins>+        : m_vector { vector }
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     size_t length() const { return m_vector.size(); }
</span><span class="cx">     bool is8Bit() const { return true; }
</span><ins>+    template<typename CharacterType> void writeTo(CharacterType* destination) const { StringImpl::copyCharacters(destination, characters(), length()); }
</ins><span class="cx"> 
</span><del>-    void writeTo(LChar* destination) const
</del><ins>+private:
+    const LChar* characters() const
</ins><span class="cx">     {
</span><del>-        StringView(reinterpret_cast<const LChar*>(m_vector.data()), m_vector.size()).getCharactersWithUpconvert(destination);
</del><ins>+        return reinterpret_cast<const LChar*>(m_vector.data());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void writeTo(UChar* destination) const
-    {
-        StringView(reinterpret_cast<const LChar*>(m_vector.data()), m_vector.size()).getCharactersWithUpconvert(destination);
-    }
-
-    String toString() const { return String(m_vector.data(), m_vector.size()); }
-
-private:
</del><span class="cx">     const Vector<char>& m_vector;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template<>
-class StringTypeAdapter<String, void> {
</del><ins>+template<> class StringTypeAdapter<String, void> {
</ins><span class="cx"> public:
</span><span class="cx">     StringTypeAdapter(const String& string)
</span><del>-        : m_string(string)
</del><ins>+        : m_string { string }
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned length() const { return m_string.length(); }
</span><span class="cx">     bool is8Bit() const { return m_string.isNull() || m_string.is8Bit(); }
</span><del>-
-    void writeTo(LChar* destination) const
</del><ins>+    template<typename CharacterType> void writeTo(CharacterType* destination) const
</ins><span class="cx">     {
</span><del>-        StringView(m_string).getCharactersWithUpconvert(destination);
</del><ins>+        StringView { m_string }.getCharactersWithUpconvert(destination);
</ins><span class="cx">         WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    void writeTo(UChar* destination) const
-    {
-        StringView(m_string).getCharactersWithUpconvert(destination);
-        WTF_STRINGTYPEADAPTER_COPIED_WTF_STRING();
-    }
-
-    String toString() const { return m_string; }
-
</del><span class="cx"> private:
</span><span class="cx">     const String& m_string;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template<>
-class StringTypeAdapter<AtomicString, void> : public StringTypeAdapter<String, void> {
</del><ins>+template<> class StringTypeAdapter<AtomicString, void> : public StringTypeAdapter<String, void> {
</ins><span class="cx"> public:
</span><span class="cx">     StringTypeAdapter(const AtomicString& string)
</span><del>-        : StringTypeAdapter<String, void>(string.string())
</del><ins>+        : StringTypeAdapter<String, void> { string.string() }
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template<typename UnderlyingElementType> struct PaddingSpecification {
+    LChar character;
+    unsigned length;
+    UnderlyingElementType underlyingElement;
+};
+
+template<typename UnderlyingElementType> PaddingSpecification<UnderlyingElementType> pad(char character, unsigned length, UnderlyingElementType element)
+{
+    return { static_cast<LChar>(character), length, element };
+}
+
+template<typename UnderlyingElementType> class StringTypeAdapter<PaddingSpecification<UnderlyingElementType>> {
+public:
+    StringTypeAdapter(const PaddingSpecification<UnderlyingElementType>& padding)
+        : m_padding { padding }
+        , m_underlyingAdapter { m_padding.underlyingElement }
+    {
+    }
+
+    unsigned length() const { return std::max(m_padding.length, m_underlyingAdapter.length()); }
+    bool is8Bit() const { return m_underlyingAdapter.is8Bit(); }
+    template<typename CharacterType> void writeTo(CharacterType* destination) const
+    {
+        unsigned underlyingLength = m_underlyingAdapter.length();
+        unsigned count = 0;
+        if (underlyingLength < m_padding.length) {
+            count = m_padding.length - underlyingLength;
+            for (unsigned i = 0; i < count; ++i)
+                destination[i] = m_padding.character;
+        }
+        m_underlyingAdapter.writeTo(destination + count);
+    }
+
+private:
+    const PaddingSpecification<UnderlyingElementType>& m_padding;
+    StringTypeAdapter<UnderlyingElementType> m_underlyingAdapter;
+};
+
</ins><span class="cx"> template<typename Adapter>
</span><span class="cx"> inline bool are8Bit(Adapter adapter)
</span><span class="cx"> {
</span><span class="lines">@@ -314,13 +297,6 @@
</span><span class="cx">     return tryMakeStringFromAdapters(StringTypeAdapter<StringTypes>(strings)...);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-// Convenience only.
-template<typename StringType>
-String makeString(StringType string)
-{
-    return String(string);
-}
-
</del><span class="cx"> template<typename... StringTypes>
</span><span class="cx"> String makeString(StringTypes... strings)
</span><span class="cx"> {
</span><span class="lines">@@ -333,6 +309,7 @@
</span><span class="cx"> } // namespace WTF
</span><span class="cx"> 
</span><span class="cx"> using WTF::makeString;
</span><ins>+using WTF::pad;
</ins><span class="cx"> using WTF::tryMakeString;
</span><span class="cx"> 
</span><span class="cx"> #include <wtf/text/StringOperators.h>
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWTFwtftextStringConcatenateNumbersh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringConcatenateNumbers.h (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringConcatenateNumbers.h    2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringConcatenateNumbers.h       2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -42,7 +42,6 @@
</span><span class="cx">     unsigned length() const { return lengthOfNumberAsStringSigned(m_number); }
</span><span class="cx">     bool is8Bit() const { return true; }
</span><span class="cx">     template<typename CharacterType> void writeTo(CharacterType* destination) const { writeNumberToBufferSigned(m_number, destination); }
</span><del>-    String toString() const { return String::number(m_number); }
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     SignedInt m_number;
</span><span class="lines">@@ -59,7 +58,6 @@
</span><span class="cx">     unsigned length() const { return lengthOfNumberAsStringUnsigned(m_number); }
</span><span class="cx">     bool is8Bit() const { return true; }
</span><span class="cx">     template<typename CharacterType> void writeTo(CharacterType* destination) const { writeNumberToBufferUnsigned(m_number, destination); }
</span><del>-    String toString() const { return String::number(m_number); }
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     UnsignedInt m_number;
</span><span class="lines">@@ -71,13 +69,12 @@
</span><span class="cx">     StringTypeAdapter(FloatingPoint number)
</span><span class="cx">     {
</span><span class="cx">         numberToString(number, m_buffer);
</span><del>-        m_length = strlen(m_buffer);
</del><ins>+        m_length = std::strlen(m_buffer);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned length() const { return m_length; }
</span><span class="cx">     bool is8Bit() const { return true; }
</span><span class="cx">     template<typename CharacterType> void writeTo(CharacterType* destination) const { StringImpl::copyCharacters(destination, buffer(), m_length); }
</span><del>-    String toString() const { return { buffer(), m_length }; }
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     const LChar* buffer() const { return reinterpret_cast<const LChar*>(m_buffer); }
</span><span class="lines">@@ -92,7 +89,7 @@
</span><span class="cx">     {
</span><span class="cx">         FormattedNumber numberFormatter;
</span><span class="cx">         numberToFixedPrecisionString(number, significantFigures, numberFormatter.m_buffer, trailingZerosTruncatingPolicy == TruncateTrailingZeros);
</span><del>-        numberFormatter.m_length = strlen(numberFormatter.m_buffer);
</del><ins>+        numberFormatter.m_length = std::strlen(numberFormatter.m_buffer);
</ins><span class="cx">         return numberFormatter;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -100,7 +97,7 @@
</span><span class="cx">     {
</span><span class="cx">         FormattedNumber numberFormatter;
</span><span class="cx">         numberToFixedWidthString(number, decimalPlaces, numberFormatter.m_buffer);
</span><del>-        numberFormatter.m_length = strlen(numberFormatter.m_buffer);
</del><ins>+        numberFormatter.m_length = std::strlen(numberFormatter.m_buffer);
</ins><span class="cx">         return numberFormatter;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -112,8 +109,7 @@
</span><span class="cx">     unsigned m_length;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-template<>
-class StringTypeAdapter<FormattedNumber> {
</del><ins>+template<> class StringTypeAdapter<FormattedNumber> {
</ins><span class="cx"> public:
</span><span class="cx">     StringTypeAdapter(const FormattedNumber& number)
</span><span class="cx">         : m_number { number }
</span><span class="lines">@@ -123,7 +119,6 @@
</span><span class="cx">     unsigned length() const { return m_number.length(); }
</span><span class="cx">     bool is8Bit() const { return true; }
</span><span class="cx">     template<typename CharacterType> void writeTo(CharacterType* destination) const { StringImpl::copyCharacters(destination, m_number.buffer(), m_number.length()); }
</span><del>-    String toString() const { return { m_number.buffer(), m_number.length() }; }
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     const FormattedNumber& m_number;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWTFwtftextStringOperatorsh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringOperators.h (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringOperators.h     2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringOperators.h        2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -23,12 +23,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WTF {
</span><span class="cx"> 
</span><del>-template<typename StringType1, typename StringType2>
-class StringAppend {
</del><ins>+template<typename StringType1, typename StringType2> class StringAppend {
</ins><span class="cx"> public:
</span><span class="cx">     StringAppend(StringType1 string1, StringType2 string2)
</span><del>-        : m_string1(string1)
-        , m_string2(string2)
</del><ins>+        : m_string1 { string1 }
+        , m_string2 { string2 }
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -85,19 +84,14 @@
</span><span class="cx"> class StringTypeAdapter<StringAppend<StringType1, StringType2>> {
</span><span class="cx"> public:
</span><span class="cx">     StringTypeAdapter<StringAppend<StringType1, StringType2>>(StringAppend<StringType1, StringType2>& buffer)
</span><del>-        : m_buffer(buffer)
</del><ins>+        : m_buffer { buffer }
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    unsigned length() { return m_buffer.length(); }
</del><ins>+    unsigned length() const { return m_buffer.length(); }
+    bool is8Bit() const { return m_buffer.is8Bit(); }
+    template<typename CharacterType> void writeTo(CharacterType* destination) const { m_buffer.writeTo(destination); }
</ins><span class="cx"> 
</span><del>-    bool is8Bit() { return m_buffer.is8Bit(); }
-
-    void writeTo(LChar* destination) { m_buffer.writeTo(destination); }
-    void writeTo(UChar* destination) { m_buffer.writeTo(destination); }
-
-    String toString() const { return m_buffer; }
-
</del><span class="cx"> private:
</span><span class="cx">     StringAppend<StringType1, StringType2>& m_buffer;
</span><span class="cx"> };
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWTFwtftextStringViewh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringView.h (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringView.h  2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/StringView.h     2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -565,27 +565,24 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if !CHECK_STRINGVIEW_LIFETIME
</span><ins>+
</ins><span class="cx"> inline void StringView::invalidate(const StringImpl&)
</span><span class="cx"> {
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-template<typename StringType, typename> class StringTypeAdapter;
-
</del><span class="cx"> template<> class StringTypeAdapter<StringView, void> {
</span><span class="cx"> public:
</span><span class="cx">     StringTypeAdapter(StringView string)
</span><del>-        : m_string(string)
</del><ins>+        : m_string { string }
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned length() { return m_string.length(); }
</span><span class="cx">     bool is8Bit() { return m_string.is8Bit(); }
</span><del>-    void writeTo(LChar* destination) { m_string.getCharactersWithUpconvert(destination); }
-    void writeTo(UChar* destination) { m_string.getCharactersWithUpconvert(destination); }
</del><ins>+    template<typename CharacterType> void writeTo(CharacterType* destination) { m_string.getCharactersWithUpconvert(destination); }
</ins><span class="cx"> 
</span><del>-    String toString() const { return m_string.toString(); }
-
</del><span class="cx"> private:
</span><span class="cx">     StringView m_string;
</span><span class="cx"> };
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWTFwtftextWTFStringcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/WTFString.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/WTFString.cpp 2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/WTFString.cpp    2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -449,61 +449,6 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WTF_ATTRIBUTE_PRINTF(1, 0) static String createWithFormatAndArguments(const char *format, va_list args)
-{
-    va_list argsCopy;
-    va_copy(argsCopy, args);
-
-    ALLOW_NONLITERAL_FORMAT_BEGIN
-
-#if USE(CF) && !OS(WINDOWS)
-    if (strstr(format, "%@")) {
-        auto cfFormat = adoptCF(CFStringCreateWithCString(kCFAllocatorDefault, format, kCFStringEncodingUTF8));
-        auto result = adoptCF(CFStringCreateWithFormatAndArguments(kCFAllocatorDefault, nullptr, cfFormat.get(), args));
-        va_end(argsCopy);
-        return result.get();
-    }
-#endif
-
-    // Do the format once to get the length.
-#if COMPILER(MSVC)
-    int result = _vscprintf(format, args);
-#else
-    char ch;
-    int result = vsnprintf(&ch, 1, format, args);
-#endif
-
-    if (!result) {
-        va_end(argsCopy);
-        return emptyString();
-    }
-    if (result < 0) {
-        va_end(argsCopy);
-        return String();
-    }
-
-    Vector<char, 256> buffer;
-    unsigned len = result;
-    buffer.grow(len + 1);
-
-    // Now do the formatting again, guaranteed to fit.
-    vsnprintf(buffer.data(), buffer.size(), format, argsCopy);
-    va_end(argsCopy);
-
-    ALLOW_NONLITERAL_FORMAT_END
-
-    return StringImpl::create(reinterpret_cast<const LChar*>(buffer.data()), len);
-}
-
-String String::format(const char *format, ...)
-{
-    va_list args;
-    va_start(args, format);
-    String result = createWithFormatAndArguments(format, args);
-    va_end(args);
-    return result;
-}
-
</del><span class="cx"> String String::number(int number)
</span><span class="cx"> {
</span><span class="cx">     return numberToStringSigned<String>(number);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWTFwtftextWTFStringh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/WTFString.h (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/WTFString.h   2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WTF/wtf/text/WTFString.h      2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -261,8 +261,6 @@
</span><span class="cx">     // Use convertToASCIILowercase instead if ASCII case insensitive comparison is desired.
</span><span class="cx">     WTF_EXPORT_PRIVATE String foldCase() const;
</span><span class="cx"> 
</span><del>-    WTF_EXPORT_PRIVATE static String format(const char *, ...) WTF_ATTRIBUTE_PRINTF(1, 2);
-
</del><span class="cx">     // Returns an uninitialized string. The characters needs to be written
</span><span class="cx">     // into the buffer returned in data before the returned string is used.
</span><span class="cx">     static String createUninitialized(unsigned length, UChar*& data) { return StringImpl::createUninitialized(length, data); }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog  2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog     2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2019-03-01  Darin Adler  <darin@apple.com>
+
+        Finish removing String::format
+        https://bugs.webkit.org/show_bug.cgi?id=194893
+
+        Reviewed by Daniel Bates.
+
+        * dom/Document.cpp:
+        (WebCore::Document::lastModified const): Use makeString and pad.
+        * html/FTPDirectoryDocument.cpp:
+        (WebCore::processFileDateString): Ditto.
+
+        * mathml/MathMLElement.cpp:
+        (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
+
+        * page/cocoa/ResourceUsageOverlayCocoa.mm:
+        (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
+
+        * page/linux/ResourceUsageOverlayLinux.cpp:
+        (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
+        (WebCore::gcTimerString): Use String::number.
+
+        * platform/DateComponents.cpp:
+        (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
+        (WebCore::DateComponents::toString const): Ditto.
+
+        * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
+        and that was also inaccurate.
+
+        * platform/audio/HRTFElevation.cpp:
+        (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
+        Use makeString and pad.
+        * platform/mock/MockRealtimeVideoSource.cpp:
+        (WebCore::MockRealtimeVideoSource::drawText): Ditto.
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
+
</ins><span class="cx"> 2019-03-01  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/dom/Document.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebCore/dom/Document.cpp   2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/dom/Document.cpp      2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -5009,15 +5009,19 @@
</span><span class="cx">     else if (loader())
</span><span class="cx">         dateTime = loader()->response().lastModified();
</span><span class="cx"> 
</span><del>-    // FIXME: If this document came from the file system, the HTML5
-    // specification tells us to read the last modification date from the file
-    // system.
</del><ins>+    // FIXME: If this document came from the file system, the HTML specification tells
+    // us to read the last modification date from the file system.
</ins><span class="cx">     if (!dateTime)
</span><span class="cx">         dateTime = WallTime::now();
</span><span class="cx"> 
</span><span class="cx">     auto ctime = dateTime.value().secondsSinceEpoch().secondsAs<time_t>();
</span><span class="cx">     auto localDateTime = std::localtime(&ctime);
</span><del>-    return String::format("%02d/%02d/%04d %02d:%02d:%02d", localDateTime->tm_mon + 1, localDateTime->tm_mday, 1900 + localDateTime->tm_year, localDateTime->tm_hour, localDateTime->tm_min, localDateTime->tm_sec);
</del><ins>+    return makeString(pad('0', 2, localDateTime->tm_mon + 1), '/',
+        pad('0', 2, localDateTime->tm_mday), '/',
+        pad('0', 4, 1900 + localDateTime->tm_year), ' ',
+        pad('0', 2, localDateTime->tm_hour), ':',
+        pad('0', 2, localDateTime->tm_min), ':',
+        pad('0', 2, localDateTime->tm_sec));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Document::setCookieURL(const URL& url)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebCorehtmlFTPDirectoryDocumentcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/html/FTPDirectoryDocument.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebCore/html/FTPDirectoryDocument.cpp      2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/html/FTPDirectoryDocument.cpp 2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -210,12 +210,12 @@
</span><span class="cx">         if (hour < 12) {
</span><span class="cx">             if (hour == 0)
</span><span class="cx">                 hour = 12;
</span><del>-            timeOfDay = String::format(", %i:%02i AM", hour, fileTime.tm_min);
</del><ins>+            timeOfDay = makeString(", ", hour, ':', pad('0', 2, fileTime.tm_min), " AM");
</ins><span class="cx">         } else {
</span><span class="cx">             hour = hour - 12;
</span><span class="cx">             if (hour == 0)
</span><span class="cx">                 hour = 12;
</span><del>-            timeOfDay = String::format(", %i:%02i PM", hour, fileTime.tm_min);
</del><ins>+            timeOfDay = makeString(", ", hour, ':', pad('0', 2, fileTime.tm_min), " PM");
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebCoremathmlMathMLElementcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/mathml/MathMLElement.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebCore/mathml/MathMLElement.cpp   2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/mathml/MathMLElement.cpp      2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include "MouseEvent.h"
</span><span class="cx"> #include "RenderTableCell.h"
</span><span class="cx"> #include <wtf/IsoMallocInlines.h>
</span><ins>+#include <wtf/text/StringConcatenateNumbers.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -99,11 +100,13 @@
</span><span class="cx"> 
</span><span class="cx"> static String convertToPercentageIfNeeded(const AtomicString& value)
</span><span class="cx"> {
</span><ins>+    // FIXME: Might be better to use double than float.
+    // FIXME: Might be better to use "shortest" numeric formatting instead of fixed width.
</ins><span class="cx">     bool ok = false;
</span><span class="cx">     float unitlessValue = value.toFloat(&ok);
</span><del>-    if (ok)
-        return String::format("%.3f%%", unitlessValue * 100.0);
-    return value;
</del><ins>+    if (!ok)
+        return value;
+    return makeString(FormattedNumber::fixedWidth(unitlessValue * 100, 3), '%');
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MathMLElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStyleProperties& style)
</span><span class="lines">@@ -116,7 +119,7 @@
</span><span class="cx">             addPropertyToPresentationAttributeStyle(style, CSSPropertyFontSize, convertToPercentageIfNeeded(value));
</span><span class="cx">     } else if (name == mathcolorAttr)
</span><span class="cx">         addPropertyToPresentationAttributeStyle(style, CSSPropertyColor, value);
</span><del>-    // FIXME: deprecated attributes that should loose in a conflict with a non deprecated attribute
</del><ins>+    // FIXME: The following are deprecated attributes that should lose if there is a conflict with a non-deprecated attribute.
</ins><span class="cx">     else if (name == fontsizeAttr)
</span><span class="cx">         addPropertyToPresentationAttributeStyle(style, CSSPropertyFontSize, value);
</span><span class="cx">     else if (name == backgroundAttr)
</span><span class="lines">@@ -134,8 +137,7 @@
</span><span class="cx">             addPropertyToPresentationAttributeStyle(style, CSSPropertyDirection, value);
</span><span class="cx">     }  else {
</span><span class="cx">         ASSERT(!isPresentationAttribute(name));
</span><del>-        StyledElement::collectStyleForPresentationAttribute(name, value
-        , style);
</del><ins>+        StyledElement::collectStyleForPresentationAttribute(name, value, style);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebCorepagecocoaResourceUsageOverlayCocoamm"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm    2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/page/cocoa/ResourceUsageOverlayCocoa.mm       2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -468,7 +468,7 @@
</span><span class="cx">         size_t reclaimable = category.reclaimableSize.last();
</span><span class="cx">         size_t external = category.externalSize.last();
</span><span class="cx">         
</span><del>-        String label = String::format("% 11s: %s", category.name.ascii().data(), formatByteNumber(dirty).ascii().data());
</del><ins>+        String label = makeString(pad(' ', 11, category.name), ": ", formatByteNumber(dirty));
</ins><span class="cx">         if (external)
</span><span class="cx">             label = label + makeString(" + ", formatByteNumber(external));
</span><span class="cx">         if (reclaimable)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebCorepagelinuxResourceUsageOverlayLinuxcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp   2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp      2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (cpuUsage < 0)
</span><span class="cx">         return "<unknown>"_s;
</span><del>-    return String::format("%.1f%%", cpuUsage);
</del><ins>+    return makeString(FormattedNumber::fixedWidth(cpuUsage, 1), '%');
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static String formatByteNumber(size_t number)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (std::isnan(timerFireDate))
</span><span class="cx">         return "[not scheduled]"_s;
</span><del>-    return String::format("%g", (timerFireDate - now).seconds());
</del><ins>+    return String::number((timerFireDate - now).seconds());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static const float gFontSize = 14;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebCoreplatformDateComponentscpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/DateComponents.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/DateComponents.cpp        2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/DateComponents.cpp   2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> #include <wtf/ASCIICType.h>
</span><span class="cx"> #include <wtf/DateMath.h>
</span><span class="cx"> #include <wtf/MathExtras.h>
</span><del>-#include <wtf/text/WTFString.h>
</del><ins>+#include <wtf/text/StringConcatenateNumbers.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -693,11 +693,11 @@
</span><span class="cx">         FALLTHROUGH; // To None.
</span><span class="cx"> #endif
</span><span class="cx">     case None:
</span><del>-        return String::format("%02d:%02d", m_hour, m_minute);
</del><ins>+        return makeString(pad('0', 2, m_hour), ':', pad('0', 2, m_minute));
</ins><span class="cx">     case Second:
</span><del>-        return String::format("%02d:%02d:%02d", m_hour, m_minute, m_second);
</del><ins>+        return makeString(pad('0', 2, m_hour), ':', pad('0', 2, m_minute), ':', pad('0', 2, m_second));
</ins><span class="cx">     case Millisecond:
</span><del>-        return String::format("%02d:%02d:%02d.%03d", m_hour, m_minute, m_second, m_millisecond);
</del><ins>+        return makeString(pad('0', 2, m_hour), ':', pad('0', 2, m_minute), ':', pad('0', 2, m_second), '.', pad('0', 3, m_millisecond));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -705,19 +705,17 @@
</span><span class="cx"> {
</span><span class="cx">     switch (m_type) {
</span><span class="cx">     case Date:
</span><del>-        return String::format("%04d-%02d-%02d", m_year, m_month + 1, m_monthDay);
</del><ins>+        return makeString(pad('0', 4, m_year), '-', pad('0', 2, m_month + 1), '-', pad('0', 2, m_monthDay));
</ins><span class="cx">     case DateTime:
</span><del>-        return String::format("%04d-%02d-%02dT", m_year, m_month + 1, m_monthDay)
-            + toStringForTime(format) + "Z"_str;
</del><ins>+        return makeString(pad('0', 4, m_year), '-', pad('0', 2, m_month + 1), '-', pad('0', 2, m_monthDay), 'T', toStringForTime(format), 'Z');
</ins><span class="cx">     case DateTimeLocal:
</span><del>-        return String::format("%04d-%02d-%02dT", m_year, m_month + 1, m_monthDay)
-            + toStringForTime(format);
</del><ins>+        return makeString(pad('0', 4, m_year), '-', pad('0', 2, m_month + 1), '-', pad('0', 2, m_monthDay), 'T', toStringForTime(format));
</ins><span class="cx">     case Month:
</span><del>-        return String::format("%04d-%02d", m_year, m_month + 1);
</del><ins>+        return makeString(pad('0', 4, m_year), '-', pad('0', 2, m_month + 1));
</ins><span class="cx">     case Time:
</span><span class="cx">         return toStringForTime(format);
</span><span class="cx">     case Week:
</span><del>-        return String::format("%04d-W%02d", m_year, m_week);
</del><ins>+        return makeString(pad('0', 4, m_year), "-W", pad('0', 2, m_week));
</ins><span class="cx">     case Invalid:
</span><span class="cx">         break;
</span><span class="cx">     }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebCoreplatformLocalizedStringscpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/LocalizedStrings.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/LocalizedStrings.cpp      2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/LocalizedStrings.cpp 2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -43,10 +43,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-// We can't use String::format for two reasons:
-//  1) It doesn't handle non-ASCII characters in the format string.
-//  2) It doesn't handle the %2$d syntax.
-// Note that because |format| is used as the second parameter to va_start, it cannot be a reference
</del><ins>+// Because |format| is used as the second parameter to va_start, it cannot be a reference
</ins><span class="cx"> // type according to section 18.7/3 of the C++ N1905 standard.
</span><span class="cx"> String formatLocalizedString(String format, ...)
</span><span class="cx"> {
</span><span class="lines">@@ -73,10 +70,12 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if !USE(CF)
</span><ins>+
</ins><span class="cx"> String localizedString(const char* key)
</span><span class="cx"> {
</span><span class="cx">     return String::fromUTF8(key, strlen(key));
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebCoreplatformaudioHRTFElevationcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/audio/HRTFElevation.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/audio/HRTFElevation.cpp   2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/audio/HRTFElevation.cpp      2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx">     AudioChannel* leftEarImpulseResponse = response->channel(AudioBus::ChannelLeft);
</span><span class="cx">     AudioChannel* rightEarImpulseResponse = response->channel(AudioBus::ChannelRight);
</span><span class="cx"> #else
</span><del>-    String resourceName = String::format("IRC_%s_C_R0195_T%03d_P%03d", subjectName.utf8().data(), azimuth, positiveElevation);
</del><ins>+    String resourceName = makeString("IRC_", subjectName, "_C_R0195_T", pad('0', 3, azimuth), "_P", pad('0', 3, positiveElevation));
</ins><span class="cx"> 
</span><span class="cx">     RefPtr<AudioBus> impulseResponse(AudioBus::loadPlatformResource(resourceName.utf8().data(), sampleRate));
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebCoreplatformmockMockRealtimeVideoSourcecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp  2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp     2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -350,10 +350,10 @@
</span><span class="cx">     FloatPoint timeLocation(captureSize.width() * .05, captureSize.height() * .15);
</span><span class="cx">     context.setFillColor(Color::white);
</span><span class="cx">     context.setTextDrawingMode(TextModeFill);
</span><del>-    String string = String::format("%02u:%02u:%02u.%03u", hours, minutes, seconds, milliseconds % 1000);
</del><ins>+    String string = makeString(pad('0', 2, hours), ':', pad('0', 2, minutes), ':', pad('0', 2, seconds), '.', pad('0', 3, milliseconds % 1000));
</ins><span class="cx">     context.drawText(timeFont, TextRun((StringView(string))), timeLocation);
</span><span class="cx"> 
</span><del>-    string = String::format("%06u", m_frameNumber++);
</del><ins>+    string = makeString(pad('0', 6, m_frameNumber++));
</ins><span class="cx">     timeLocation.move(0, m_baseFontSize);
</span><span class="cx">     context.drawText(timeFont, TextRun((StringView(string))), timeLocation);
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebCorerenderingRenderLayerCompositorcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/rendering/RenderLayerCompositor.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebCore/rendering/RenderLayerCompositor.cpp        2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/rendering/RenderLayerCompositor.cpp   2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "TiledBacking.h"
</span><span class="cx"> #include "TransformState.h"
</span><ins>+#include <wtf/HexNumber.h>
</ins><span class="cx"> #include <wtf/MemoryPressureHandler.h>
</span><span class="cx"> #include <wtf/SetForScope.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="lines">@@ -1323,10 +1324,8 @@
</span><span class="cx">     absoluteBounds.move(layer.offsetFromAncestor(m_renderView.layer()));
</span><span class="cx">     
</span><span class="cx">     StringBuilder logString;
</span><del>-    logString.append(String::format("%*p id %" PRIu64 " (%.3f,%.3f-%.3f,%.3f) %.2fKB", 12 + depth * 2, &layer, backing->graphicsLayer()->primaryLayerID(),
-        absoluteBounds.x().toFloat(), absoluteBounds.y().toFloat(), absoluteBounds.maxX().toFloat(), absoluteBounds.maxY().toFloat(),
-        backing->backingStoreMemoryEstimate() / 1024));
-    
</del><ins>+    logString.append(makeString(pad(' ', 12 + depth * 2, hex(reinterpret_cast<uintptr_t>(&layer))), " id ", backing->graphicsLayer()->primaryLayerID(), " (", FormattedNumber::fixedWidth(absoluteBounds.x().toFloat(), 3), ',', FormattedNumber::fixedWidth(absoluteBounds.y().toFloat(), 3), '-', FormattedNumber::fixedWidth(absoluteBounds.maxX().toFloat(), 3), ',', FormattedNumber::fixedWidth(absoluteBounds.maxY().toFloat(), 3), ") ", FormattedNumber::fixedWidth(backing->backingStoreMemoryEstimate() / 1024, 2), "KB"));
+
</ins><span class="cx">     if (!layer.renderer().style().hasAutoZIndex())
</span><span class="cx">         logString.append(makeString(" z-index: ", layer.renderer().style().zIndex()));
</span><span class="cx"> 
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebCorerenderingRenderThemecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/rendering/RenderTheme.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebCore/rendering/RenderTheme.cpp  2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/rendering/RenderTheme.cpp     2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> #include "TextControlInnerElements.h"
</span><span class="cx"> #include <wtf/FileSystem.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><ins>+#include <wtf/text/StringConcatenateNumbers.h>
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(METER_ELEMENT)
</span><span class="cx"> #include "HTMLMeterElement.h"
</span><span class="lines">@@ -568,18 +569,14 @@
</span><span class="cx"> {
</span><span class="cx">     if (!std::isfinite(time))
</span><span class="cx">         time = 0;
</span><del>-    int seconds = (int)fabsf(time);
</del><ins>+    // FIXME: Seems like it would be better to use std::lround here.
+    int seconds = static_cast<int>(std::abs(time));
</ins><span class="cx">     int hours = seconds / (60 * 60);
</span><span class="cx">     int minutes = (seconds / 60) % 60;
</span><span class="cx">     seconds %= 60;
</span><del>-    if (hours) {
-        if (hours > 9)
-            return String::format("%s%02d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds);
-
-        return String::format("%s%01d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds);
-    }
-
-    return String::format("%s%02d:%02d", (time < 0 ? "-" : ""), minutes, seconds);
</del><ins>+    if (hours)
+        return makeString((time < 0 ? "-" : ""), hours, ':', pad('0', 2, minutes), ':', pad('0', 2, seconds));
+    return makeString((time < 0 ? "-" : ""), pad('0', 2, minutes), ':', pad('0', 2, seconds));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String RenderTheme::formatMediaControlsCurrentTime(float currentTime, float /*duration*/) const
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog   2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/ChangeLog      2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2019-03-01  Darin Adler  <darin@apple.com>
+
+        Finish removing String::format
+        https://bugs.webkit.org/show_bug.cgi?id=194893
+
+        Reviewed by Daniel Bates.
+
+        * UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
+        (WebKit::LocalAuthenticator::getAssertion): Use makeString, attempting to fix
+        a problem where we passed an NSData * to format with a "%s"."
+
</ins><span class="cx"> 2019-03-01  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitUIProcessWebAuthenticationCocoaLocalAuthenticatormm"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm     2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm        2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -400,8 +400,10 @@
</span><span class="cx"> 
</span><span class="cx">         weakThis->continueGetAssertionAfterUserConsented(consent, context, credentialId, userhandle);
</span><span class="cx">     };
</span><ins>+    NSData *idData = selectedCredentialAttributes[(id)kSecAttrApplicationTag];
+    StringView idStringView { static_cast<const LChar*>([idData bytes]), static_cast<unsigned>([idData length]) };
</ins><span class="cx">     m_connection->getUserConsent(
</span><del>-        String::format("Log into %s with %s.", requestData().requestOptions.rpId.utf8().data(), selectedCredentialAttributes[(id)kSecAttrApplicationTag]),
</del><ins>+        makeString("Log into ", requestData().requestOptions.rpId, " with ", idStringView, '.'),
</ins><span class="cx">         (__bridge SecAccessControlRef)selectedCredentialAttributes[(id)kSecAttrAccessControl],
</span><span class="cx">         WTFMove(callback));
</span><span class="cx"> #endif // PLATFORM(IOS_FAMILY)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitLegacywinChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKitLegacy/win/ChangeLog (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKitLegacy/win/ChangeLog 2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKitLegacy/win/ChangeLog    2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2019-02-20  Darin Adler  <darin@apple.com>
+
+        Finish removing String::format
+        https://bugs.webkit.org/show_bug.cgi?id=194893
+
+        Reviewed by Daniel Bates.
+
+        * FullscreenVideoController.cpp:
+        (timeToString): Use makeString and pad.
+
</ins><span class="cx"> 2019-02-26  Philippe Normand  <pnormand@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         [WPE] Add API for webview background color configuration
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224SourceWebKitLegacywinFullscreenVideoControllercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Source/WebKitLegacy/win/FullscreenVideoController.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Source/WebKitLegacy/win/FullscreenVideoController.cpp     2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Source/WebKitLegacy/win/FullscreenVideoController.cpp        2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include <WebCore/TextRun.h>
</span><span class="cx"> #include <windowsx.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><ins>+#include <wtf/text/StringConcatenateNumbers.h>
</ins><span class="cx"> 
</span><span class="cx"> #if USE(CA)
</span><span class="cx"> #include <WebCore/PlatformCALayerClient.h>
</span><span class="lines">@@ -470,14 +471,9 @@
</span><span class="cx">     int hours = seconds / (60 * 60);
</span><span class="cx">     int minutes = (seconds / 60) % 60;
</span><span class="cx">     seconds %= 60;
</span><del>-
-    if (hours) {
-        if (hours > 9)
-            return String::format("%s%02d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds);
-        return String::format("%s%01d:%02d:%02d", (time < 0 ? "-" : ""), hours, minutes, seconds);
-    }
-
-    return String::format("%s%02d:%02d", (time < 0 ? "-" : ""), minutes, seconds);
</del><ins>+    if (hours)
+        return makeString((time < 0 ? "-" : ""), hours, ':', pad('0', 2, minutes), ':', pad('0', 2, seconds));
+    return makeString((time < 0 ? "-" : ""), pad('0', 2, minutes), ':', pad('0', 2, seconds));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FullscreenVideoController::draw()
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224ToolsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Tools/ChangeLog (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Tools/ChangeLog   2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Tools/ChangeLog      2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2019-03-01  Darin Adler  <darin@apple.com>
+
+        Finish removing String::format
+        https://bugs.webkit.org/show_bug.cgi?id=194893
+
+        Reviewed by Daniel Bates.
+'
+        * Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp: Add tests for pad().
+
</ins><span class="cx"> 2019-03-01  Yusuke Suzuki  <ysuzuki@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, fix lldb webkitpy tests
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit224ToolsTestWebKitAPITestsWTFStringConcatenatecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.24/Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp (242489 => 242490)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.24/Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp       2019-03-05 17:22:58 UTC (rev 242489)
+++ releases/WebKitGTK/webkit-2.24/Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp  2019-03-05 17:23:14 UTC (rev 242490)
</span><span class="lines">@@ -26,11 +26,12 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> 
</span><span class="cx"> #include "WTFStringUtilities.h"
</span><del>-#include <wtf/text/StringConcatenate.h>
-#include <wtf/text/StringConcatenateNumbers.h>
</del><span class="cx"> #include <cstddef>
</span><span class="cx"> #include <cstdint>
</span><span class="cx"> #include <unicode/uvernum.h>
</span><ins>+#include <wtf/HexNumber.h>
+#include <wtf/text/StringConcatenate.h>
+#include <wtf/text/StringConcatenateNumbers.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace TestWebKitAPI {
</span><span class="cx"> 
</span><span class="lines">@@ -156,4 +157,16 @@
</span><span class="cx">     EXPECT_STREQ("hello 0.000 world", makeString("hello ", FormattedNumber::fixedWidth(0.0, 3) , " world").utf8().data());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+TEST(WTF, StringConcatenate_Pad)
+{
+    EXPECT_STREQ("", makeString(pad('x', 0, "")).utf8().data());
+    EXPECT_STREQ("x", makeString(pad('x', 1, "")).utf8().data());
+    EXPECT_STREQ("y", makeString(pad('x', 1, "y")).utf8().data());
+    EXPECT_STREQ("xy", makeString(pad('x', 2, "y")).utf8().data());
+
+    EXPECT_STREQ("xxxxxxxxxxxxxxx1E240", makeString(pad('x', 20, hex(123456))).utf8().data());
+    EXPECT_STREQ("xxxxxxxxxxxxxxx1E2400.000", makeString(pad('x', 20, hex(123456)), FormattedNumber::fixedWidth(0.f, 3)).utf8().data());
+    EXPECT_STREQ(" B32AF0071F9 id 1231232312313231 (0.000,0.000-0.000,0.000) 0.00KB", makeString(pad(' ', 12, hex(12312312312313)), " id ", 1231232312313231, " (", FormattedNumber::fixedWidth(0.f, 3), ',', FormattedNumber::fixedWidth(0.f, 3), '-', FormattedNumber::fixedWidth(0.f, 3), ',', FormattedNumber::fixedWidth(0.f, 3), ") ", FormattedNumber::fixedWidth(0.f, 2), "KB").utf8().data());
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre>
</div>
</div>

</body>
</html>