Ignore:
Timestamp:
May 13, 2021, 9:18:32 AM (4 years ago)
Author:
Darin Adler
Message:

Remove StringBuilder::appendNumber
https://bugs.webkit.org/show_bug.cgi?id=225732

Reviewed by Sam Weinig.

Source/JavaScriptCore:

  • API/JSContextRef.cpp:

(BacktraceFunctor::operator() const): Use append instead of appendNumber.

  • API/tests/PingPongStackOverflowTest.cpp:

(PingPongStackOverflowObject_hasInstance): Ditto.

  • heap/HeapSnapshotBuilder.cpp:

(JSC::HeapSnapshotBuilder::json): Ditto.

  • interpreter/StackVisitor.cpp:

(JSC::StackVisitor::Frame::toString const): Use makeString instead of StringBuilder.

  • runtime/ConsoleClient.cpp:

(JSC::appendURLAndPosition): Ditto.
(JSC::ConsoleClient::printConsoleMessageWithArguments): Use append instead of appendNumber.

  • runtime/JSONObject.cpp:

(JSC::Stringifier::appendStringifiedValue): Ditto.

  • runtime/Options.cpp:

(JSC::OptionReader::Option::dump const): Ditto.

  • runtime/StackFrame.cpp:

(JSC::StackFrame::toString const): Use makeString instead of StringBuilder.

Source/WebCore:

  • Modules/indexeddb/server/IndexValueStore.cpp:

(WebCore::IDBServer::IndexValueStore::loggingString const):
Use append instead of appendNumber.

  • Modules/websockets/WebSocketHandshake.cpp:

(WebCore::hostName): Use makeString instead of StringBuilder.

  • contentextensions/CombinedURLFilters.cpp:

(WebCore::ContentExtensions::prefixTreeVertexToString):
Use append instead of appendNumber.

  • contentextensions/Term.h:

(WebCore::ContentExtensions::Term::toString const): Ditto.

  • css/CSSFontFeatureValue.cpp:

(WebCore::CSSFontFeatureValue::customCSSText const): Ditto.

  • css/CSSTimingFunctionValue.cpp:

(WebCore::CSSStepsTimingFunctionValue::customCSSText const): Ditto.

  • dom/Document.cpp:

(WebCore::Document::downgradeReferrerToRegistrableDomain): Use
makeString instead of StringBuilder.

  • editing/MarkupAccumulator.cpp:

(WebCore::MarkupAccumulator::generateUniquePrefix): Ditto.

  • editing/cocoa/DataDetection.mm:

(WebCore::dataDetectorStringForPath): Use append instead of appendNumber.

  • html/HTMLAnchorElement.cpp:

(WebCore::appendServerMapMousePosition): Ditto.

  • html/HTMLCanvasElement.cpp:

(WebCore::HTMLCanvasElement::createContext2d): Use makeString
instead of StringBuilder.
(WebCore::HTMLCanvasElement::createImageBuffer const): Ditto.

  • loader/ResourceLoadStatistics.cpp:

(WebCore::ResourceLoadStatistics::toString const): Use append instead
of appendNumber.

  • loader/SubresourceIntegrity.cpp:

(WebCore::integrityMismatchDescription): Use makeString instead of
StringBuilder.

  • page/IntersectionObserver.cpp:

(WebCore::IntersectionObserver::rootMargin const): Use append instead
of appendNumber.

  • page/SecurityOriginData.cpp:

(WebCore::SecurityOriginData::databaseIdentifier const): Use makeString
instead of StringBuilder.

  • platform/Decimal.cpp:

(WebCore::Decimal::toString const): Use append instead of appendNumber.

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::animationNameForTransition): Use makeString
instead of StringBuilder.

  • platform/graphics/ca/TileController.cpp:

(WebCore::TileController::createTileLayer): Ditto.

  • platform/graphics/ca/win/PlatformCALayerWin.cpp:

(printTransform): Use single append instead of a run of them.
(printLayer): Ditto, and use append instead of apppendNumber.
(PlatformCALayerWin::layerTreeAsString const): Ditto.

  • platform/mediarecorder/MediaRecorderPrivateMock.cpp:

(WebCore::MediaRecorderPrivateMock::generateMockCounterString):
Use append instead of appendNumber.

  • platform/network/ProxyServer.cpp:

(WebCore::appendProxyServerString): Ditto.

  • rendering/RenderTreeAsText.cpp:

(WebCore::nodePosition): Ditto.

  • svg/SVGPathUtilities.cpp:

(WebCore::buildStringFromPath): Ditto.

  • testing/Internals.cpp:

(WebCore::Internals::parserMetaData): Use makeString instead of
StringBuilder.
(WebCore::appendOffsets): Use append instead of appendNumber.

  • testing/MockPageOverlayClient.cpp:

(WebCore::MockPageOverlayClient::drawRect): Use makeString instead
of StringBuilder.
(WebCore::MockPageOverlayClient::mouseEvent): Ditto.

  • xml/XMLErrors.cpp:

(WebCore::XMLErrors::appendErrorMessage): Use append instead of
appendNumber.

Source/WebDriver:

  • SessionHost.cpp:

(WebDriver::SessionHost::sendCommandToBackend): Use append instead
of appendNumber.

  • socket/HTTPServerSocket.cpp:

(WebDriver::HTTPRequestHandler::packHTTPMessage const): Ditto.

Source/WebKit:

  • NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:

(WebKit::buildList): Use append instead of appendNumber.
(WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::attributionToString): Ditto.
(WebKit::ResourceLoadStatisticsDatabaseStore::privateClickMeasurementToString): Ditto.

  • Shared/WebMemorySampler.cpp:

(WebKit::WebMemorySampler::appendCurrentMemoryUsageToFile): Ditto.

  • UIProcess/API/glib/WebKitWebView.cpp:

(webkitWebViewRunJavaScriptCallback): Ditto.

  • UIProcess/WebBackForwardList.cpp:

(WebKit::WebBackForwardList::loggingString): Ditto.

  • WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:

(PageResourceLoadClient::didReceiveResponseForResource): Use makeString instead
of StringBuilder.

  • WebProcess/Plugins/PluginView.cpp:

(WebKit::buildHTTPHeaders): Use append instead of appendNumber.

Source/WebKitLegacy/win:

  • WebKitStatistics.cpp:

(WebKitStatistics::comClassNameCounts): Use append instead of
appendNumber.

Source/WTF:

We originally added StringBuilder::appendNumber to resolve the ambiguity
between UChar and uint16_t, but that problem was solved long ago and it
is safe to use StringBuilder::append, including the variadic form, on all
types of numbers and we'll get the same results we did with appendNumber.

  • wtf/JSONValues.cpp:

(WTF::JSONImpl::Value::writeJSON const): Use append instead of appendNumber.

  • wtf/text/StringBuilder.cpp:

(WTF::StringBuilder::appendNumber): Deleted.

  • wtf/text/StringBuilder.h: Removed appendNumber.
  • wtf/text/TextStream.cpp:

(WTF::TextStream::operator<<): Use append instead of appendNumber.

Tools:

  • TestWebKitAPI/Tests/WTF/StringBuilder.cpp:

Test append with a number instead of appendNumber.

  • TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp:

Use append instead of appendNumber.

  • WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:

(WTR::dumpResponseDescriptionSuitableForTestResult): Use append instead
of appendNumber.
(WTR::dumpFrameScrollPosition): Ditto.
(WTR::InjectedBundlePage::didFinishDocumentLoadForFrame): Use makeString
instead of StringBuilder.
(WTR::InjectedBundlePage::shouldCacheResponse): Ditto.

  • WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:

(WTR::attributesOfElement): Use append instead of appendNumber.
(WTR::AccessibilityUIElement::attributedStringForRange): Ditto.
(WTR::stringAtOffset): Ditto.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSFontFeatureValue.cpp

    r230838 r277437  
    4747    builder.append('"');
    4848    // Omit the value if it's 1 as 1 is implied by default.
    49     if (m_value != 1) {
    50         builder.append(' ');
    51         builder.appendNumber(m_value);
    52     }
     49    if (m_value != 1)
     50        builder.append(' ', m_value);
    5351    return builder.toString();
    5452}
Note: See TracChangeset for help on using the changeset viewer.