Simplify StringBuilder API/align with makeString by removing appendFixed* functions...
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jan 2020 19:31:56 +0000 (19:31 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Jan 2020 19:31:56 +0000 (19:31 +0000)
commitcc8527f6b449c8eee45a247a28bc7d3cfa43f50b
tree328126074d7256d4b4a33651d0b11f5874aa90ed
parent86f662ceee49eb9c7e4b107961bc26781b55e448
Simplify StringBuilder API/align with makeString by removing appendFixed* functions and using FormatNumber struct instead
https://bugs.webkit.org/show_bug.cgi?id=205671

Reviewed by Alex Christensen.

Source/JavaScriptCore:

* API/tests/ExecutionTimeLimitTest.cpp:
(testExecutionTimeLimit):
* runtime/Options.cpp:
(JSC::OptionReader::Option::dump const):
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...)).

Source/WebCore:

* css/CSSFontVariationValue.cpp:
* css/CSSKeyframeRule.cpp:
* css/CSSTimingFunctionValue.cpp:
* css/parser/CSSParserToken.cpp:
* html/HTMLImageElement.cpp:
* page/scrolling/AxisScrollSnapOffsets.cpp:
* platform/graphics/Color.cpp:
* platform/graphics/ExtendedColor.cpp:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
* platform/graphics/freetype/FontCacheFreeType.cpp:
* svg/SVGNumberList.h:
* svg/SVGPathStringBuilder.cpp:
* svg/SVGPointList.h:
* svg/SVGTransformValue.h:
* svg/properties/SVGPropertyTraits.h:
* testing/Internals.cpp:
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...))
and builder.appendFixedWidthNumber(...) with with builder.append(FormattedNumber::fixedWidth(...))

Source/WebKit:

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::dumpContentsToFile):
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::asJSON const):
* Shared/Gamepad/GamepadData.cpp:
(WebKit::GamepadData::loggingString const):
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...)).

Source/WTF:

In an ongoing attempt to simplify the StringBuilder interface and unify it's functionality with makeString,
this change removes appendFixedPrecisionNumber() and appendFixedWidthNumber(), replacing their uses
with direct calls to append(), using a FormattedNumber object to direct it to the appropriate StringTypeAdapter.

* wtf/text/StringBuilder.h:
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendFixedPrecisionNumber): Deleted.
(WTF::StringBuilder::appendFixedWidthNumber): Deleted.
Remove StringBuilder::appendFixedPrecisionNumber() and StringBuilder::appendFixedWidthNumber(). The same functionality
is available and more flexible by passing FormattedNumbers to the variadic append() function.

* wtf/text/TextStream.cpp:
(WTF::TextStream::operator<<):
* wtf/MediaTime.cpp:
(WTF::MediaTime::toString const):
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...))
and builder.appendFixedWidthNumber(...) with with builder.append(FormattedNumber::fixedWidth(...))

Tools:

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
Replace all uses of builder.appendFixedPrecisionNumber(...) with builder.append(FormattedNumber::fixedPrecision(...)).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
31 files changed:
Source/JavaScriptCore/API/tests/ExecutionTimeLimitTest.cpp
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/Options.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/MediaTime.cpp
Source/WTF/wtf/text/StringBuilder.cpp
Source/WTF/wtf/text/StringBuilder.h
Source/WTF/wtf/text/TextStream.cpp
Source/WebCore/ChangeLog
Source/WebCore/css/CSSFontVariationValue.cpp
Source/WebCore/css/CSSKeyframeRule.cpp
Source/WebCore/css/CSSTimingFunctionValue.cpp
Source/WebCore/css/parser/CSSParserToken.cpp
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp
Source/WebCore/platform/graphics/Color.cpp
Source/WebCore/platform/graphics/ExtendedColor.cpp
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp
Source/WebCore/svg/SVGNumberList.h
Source/WebCore/svg/SVGPathStringBuilder.cpp
Source/WebCore/svg/SVGPointList.h
Source/WebCore/svg/SVGTransformValue.h
Source/WebCore/svg/properties/SVGPropertyTraits.h
Source/WebCore/testing/Internals.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cache/NetworkCache.cpp
Source/WebKit/NetworkProcess/cache/NetworkCacheEntry.cpp
Source/WebKit/Shared/Gamepad/GamepadData.cpp
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp