commit | e1c00f7f733063aa42a7439f880a0772926ed095 | [log] [tgz] |
---|---|---|
author | darin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc> | Mon May 24 21:51:47 2021 +0000 |
committer | darin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc> | Mon May 24 21:51:47 2021 +0000 |
tree | 061678b60ee921aa7c6fa88acbb9f6dc79b44a52 | |
parent | efd456bb609b0bd17ec7afde816f4b8b596f4669 [diff] |
Remove StringBuilder::appendLiteral https://bugs.webkit.org/show_bug.cgi?id=226137 Reviewed by Chris Dumez. Source/JavaScriptCore: * API/tests/PingPongStackOverflowTest.cpp: (PingPongStackOverflowObject_hasInstance): Use append instead of appendLiteral. * bindings/ScriptFunctionCall.cpp: (Deprecated::ScriptCallArgumentHandler::appendArgument): Remove unnecessary cast from const char* to String, which defeats optimization and has no benefit. * bytecompiler/NodesCodegen.cpp: (JSC::ArrayPatternNode::toString const): Use append instead of appendLiteral. (JSC::RestParameterNode::toString const): Ditto. * heap/HeapSnapshotBuilder.cpp: (JSC::HeapSnapshotBuilder::json): Use append instead of appendLiteral. Removed unnecesary use of appendQuotedJSONString to append the result of snapshotTypeToString and edgeTypeToString, which return a const char* that never contains characters that require special quoting consideration, so can be appended efficiently with the normal append function. * inspector/agents/InspectorAuditAgent.cpp: (Inspector::InspectorAuditAgent::run): Use makeString instead of StringBuilder. * inspector/agents/InspectorConsoleAgent.cpp: Use auto for the result of makeString. * jsc.cpp: Use appned instead of appendLiteral. * parser/ParserArena.cpp: (JSC::IdentifierArena::makePrivateIdentifier): Use auto for the result of makeString. * runtime/ConsoleClient.cpp: (JSC::ConsoleClient::printConsoleMessage): Use append instead of appendLiteral. Also use variadic append when practical for better efficiency. (JSC::ConsoleClient::printConsoleMessageWithArguments): Ditto. * runtime/DateConversion.cpp: (JSC::formatDateTime): Ditto. * runtime/ErrorInstance.cpp: (JSC::ErrorInstance::sanitizedToString): Use makeString instead of StringBuilder. * runtime/ExceptionHelpers.cpp: (JSC::notAFunctionSourceAppender): Use append instead of appendLiteral. * runtime/IntlDateTimeFormat.cpp: (JSC::IntlDateTimeFormat::initializeDateTimeFormat): Ditto. * runtime/IntlNumberFormat.cpp: (JSC::IntlNumberFormat::initializeNumberFormat): Ditto. * runtime/JSCustomGetterFunction.cpp: (JSC::JSCustomGetterFunction::create): Use auto and cut down on reference count churn by using passing the StringImpl to makeString. * runtime/JSCustomSetterFunction.cpp: (JSC::JSCustomSetterFunction::create): Ditto. * runtime/JSGlobalObjectFunctions.cpp: Use more const and use variadic append for better efficiency. * runtime/JSONObject.cpp: (JSC::Stringifier::appendStringifiedValue): Use append instead of appendLiteral. (JSC::Stringifier::Holder::appendNextProperty): Ditto. * runtime/JSStringJoiner.h: Deleted unused appendLiteral function. Unrelated to StringBuilder::appendLiteral, but dead code. * runtime/Options.cpp: (JSC::Options::dumpOption): Use append instead of appendLiteral. * runtime/RegExpPrototype.cpp: (JSC::appendLineTerminatorEscape<UChar>): Ditto. * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::reportTopFunctions): Use auto for the result of makeString. (JSC::SamplingProfiler::reportTopBytecodes): Ditto. * runtime/TypeProfiler.cpp: (JSC::TypeProfiler::typeInformationForExpressionAtOffset): Use append instead of appendLiteral. * runtime/TypeSet.cpp: (JSC::TypeSet::dumpTypes const): Use append instead of appendLiteral. (JSC::TypeSet::toJSONString const): Ditto. (JSC::StructureShape::propertyHash): Ditto. (JSC::StructureShape::toJSONString const): Ditto. Source/WebCore: * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::packageFormData): Use auto for the result of makeString. * Modules/indexeddb/IDBKeyData.cpp: (WebCore::IDBKeyData::loggingString const): Use append instead of appendLiteral. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use auto for the result of makeString. * Modules/indexeddb/server/SQLiteIDBCursor.cpp: (WebCore::IDBServer::buildPreIndexStatement): Use makeString instead of StringBuilder. (WebCore::IDBServer::buildIndexStatement): Ditto. (WebCore::IDBServer::buildObjectStoreStatement): Ditto. * Modules/websockets/WebSocket.cpp: (WebCore::encodeProtocolString): Use append instead of appendLiteral. * Modules/websockets/WebSocketExtensionDispatcher.cpp: (WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension): Ditto. * Modules/websockets/WebSocketHandshake.cpp: (WebCore::WebSocketHandshake::clientHandshakeMessage const): Use makeString instead of StringBuilder. (WebCore::WebSocketHandshake::clientHandshakeRequest const): Tweak to match the function above more closely, and use ASCIILiteral. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (formatForDebugger): Use makeString instead of StringBuilder. * contentextensions/CombinedURLFilters.cpp: (WebCore::ContentExtensions::prefixTreeVertexToString): Use append instead of appendLiteral. * css/CSSBasicShapes.cpp: (WebCore::buildCircleString): Ditto. (WebCore::buildEllipseString): Ditto. (WebCore::buildPathString): Ditto. (WebCore::buildPolygonString): Ditto. (WebCore::buildInsetString): Ditto. * css/CSSGradientValue.cpp: (WebCore::CSSLinearGradientValue::customCSSText const): Ditto. (WebCore::CSSRadialGradientValue::customCSSText const): Ditto. (WebCore::CSSConicGradientValue::customCSSText const): Ditto. * css/CSSGridIntegerRepeatValue.cpp: (WebCore::CSSGridIntegerRepeatValue::customCSSText const): Use makeString instead of StringBuilder. * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::customCSSText const): Use append instead of appendLiteral. * css/CSSImportRule.cpp: (WebCore::CSSImportRule::cssText const): Use makeString instead of StringBuilder. * css/CSSKeyframeRule.cpp: (WebCore::StyleRuleKeyframe::cssText const): Ditto. * css/CSSKeyframesRule.cpp: (WebCore::CSSKeyframesRule::cssText const): Use variadic append. * css/CSSLineBoxContainValue.cpp: (WebCore::CSSLineBoxContainValue::customCSSText const): Use append instead of appendLiteral. * css/CSSNamespaceRule.cpp: (WebCore::CSSNamespaceRule::cssText const): Ditto. * css/CSSPageRule.cpp: (WebCore::CSSPageRule::cssText const): Use makeString instead of StringBuilder. * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::customCSSText const): Ditto. * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): Use append instead of appendLiteral. * css/CSSSelector.cpp: (WebCore::appendLangArgumentList): Use variadic append. (WebCore::CSSSelector::selectorText const): Ditto. Also use append instead of appendLiteral and make some improvements to cut down on allocations a little. * css/CSSSelectorList.cpp: (WebCore::CSSSelectorList::buildSelectorsText const): Use append instead of appendLiteral. * css/CSSStyleSheet.cpp: (WebCore::CSSStyleSheet::CSSStyleSheet): Moved more of the data member initialization to the class definition. (WebCore::CSSStyleSheet::addRule): Use makeString instead of StringBuilder. * css/CSSStyleSheet.h: Moved initialization here. * css/CSSTimingFunctionValue.cpp: (WebCore::CSSStepsTimingFunctionValue::customCSSText const): Use makeString instead of StringBuilder. (WebCore::CSSSpringTimingFunctionValue::customCSSText const): Ditto. * css/MediaList.cpp: (WebCore::MediaQuerySet::mediaText const): Use append instead of appendLiteral. * css/MediaQuery.cpp: (WebCore::MediaQuery::serialize const): Ditto. * css/MediaQueryExpression.cpp: (WebCore::MediaQueryExpression::serialize const): Use makeString instead of StringBuilder. * css/StyleProperties.cpp: (WebCore::StyleProperties::getLayeredShorthandValue const): Use append instead of appendLiteral. * css/parser/CSSParserToken.cpp: (WebCore::CSSParserToken::serialize const): Removed a lot of unnecessary braces. Use variadic append and append instead of appendLiteral. * dom/Document.cpp: (WebCore::Document::initSecurityContext): Use auto for the result of makeString. * dom/Element.cpp: (WebCore::appendAttributes): Use variadic append and append instead of appendLiteral. * dom/SecurityContext.cpp: (WebCore::SecurityContext::parseSandboxPolicy): Ditto. * editing/HTMLInterchange.cpp: (WebCore::convertHTMLTextToInterchangeFormat): Ditto. * editing/TextIterator.cpp: (WebCore::createSearcher): Use auto for the result of makeString. * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::appendStyleNodeOpenTag): Use append instead of appendLiteral. (WebCore::StyledMarkupAccumulator::appendStartTag): Ditto. (WebCore::urlToMarkup): Ditto. * html/FormController.cpp: (WebCore::recordFormStructure): Ditto. * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::reportValidity): Use auto for the result of makeString. * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::validateInteractively): Ditto. * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::completeURLsInAttributeValue const): Use append insteaed of appendLiteral. * html/MediaElementSession.cpp: (WebCore::restrictionNames): Use auto for the result of makeString. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::getUniformLocation): Ditto. * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemaining): Ditto. * html/parser/XSSAuditorDelegate.cpp: (WebCore::buildConsoleError): Use makeString instead of StringBuilder. * html/track/TextTrackCue.cpp: (WebCore::TextTrackCue::rebuildDisplayTree): Ditto. * inspector/InspectorFrontendAPIDispatcher.cpp: (WebCore::expressionForEvaluatingCommand): Use append instead of appendLiteral. * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::drawElementTitle): Use auto for the result of makeString. * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyleSheet::addRule): Use append instead of appendLiteral. * inspector/agents/InspectorApplicationCacheAgent.cpp: (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource): Use makeString instead of StringBuilder. * inspector/agents/WebConsoleAgent.cpp: (WebCore::WebConsoleAgent::didReceiveResponse): Use auto for the result of makeString. (WebCore::WebConsoleAgent::didFailLoading): Ditto. * loader/MixedContentChecker.cpp: (WebCore::logWarning): Ditto (WebCore::MixedContentChecker::checkFormForMixedContent): Ditto * loader/PrivateClickMeasurement.cpp: (WebCore::makeValidURL): Added. Used for various cases below that all construct URLs in the same way with the same kinds of checks. Use makeString here instead of StringBuilder. (WebCore::attributionReportURL): Call makeValidURL. (WebCore::PrivateClickMeasurement::tokenSignatureURL const): Ditto. (WebCore::PrivateClickMeasurement::tokenPublicKeyURL const): Ditto. * loader/ResourceLoadStatistics.cpp: (WebCore::appendBoolean): Use append instead of appendLiteral. (WebCore::appendHashSet): Ditto. (WebCore::appendNavigatorAPIOptionSet): Ditto. (WebCore::appendScreenAPIOptionSet): Ditto. (WebCore::ResourceLoadStatistics::toString const): Ditto. * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::loadResourceSynchronously): Use auto for the result of makeString. * page/DOMWindow.cpp: (WebCore::DOMWindow::postMessage): Ditto. * page/Frame.cpp: (WebCore::createRegExpForLabels): Use append instead of appendLiteral. Also tweak coding style a bit. * page/FrameView.cpp: (WebCore::FrameView::logMockScrollAnimatorMessage const): Use makeString instead of StringBuilder. * page/PageSerializer.cpp: (WebCore::PageSerializer::SerializerMarkupAccumulator::appendStartTag): Use append instead of appendLiteral. (WebCore::PageSerializer::serializeCSSStyleSheet): Ditto. (WebCore::PageSerializer::urlForBlankFrame): Use auto for the result of makeString. * page/PerformanceLoggingClient.cpp: (WebCore::PerformanceLoggingClient::synchronousScrollingReasonsAsString): Use makeString instead of StringBuilder. * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::ResourceUsageOverlay::platformDraw): Use auto for the result of makeString. * page/csp/ContentSecurityPolicy.cpp: (WebCore::consoleMessageForViolation): Use makeString instsead of StringBuilder. (WebCore::ContentSecurityPolicy::allowRunningOrDisplayingInsecureContent): Ditto. (WebCore::ContentSecurityPolicy::reportInvalidDirectiveValueCharacter const): Get rid of local variable for result of makeString. (WebCore::ContentSecurityPolicy::reportInvalidPathCharacter const): Ditto. (WebCore::ContentSecurityPolicy::reportInvalidSourceExpression const): Ditto. * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::ContentSecurityPolicyDirectiveList::create): Get rid of local variable for result of makeString. * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText): Use makeString instead of StringBulder. * platform/Decimal.cpp: (WebCore::Decimal::toString const): Use append instead of appendLiteral. * platform/animation/TimingFunction.cpp: (WebCore::TimingFunction::createFromCSSText): Use makeString instead of StringBuilder. * platform/audio/HRTFElevation.cpp: (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation): Use auto for the result of makeString. * platform/glib/UserAgentGLib.cpp: (WebCore::buildUserAgentString): Use append instead of appendLiteral. * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: (WebCore::InbandTextTrackPrivateAVF::processCueAttributes): Use append instead of appendLiteral. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::recursiveCommitChanges): Got rid of local variable for result of makeString. (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): Use auto for result of makeString. * platform/graphics/ca/TileController.cpp: (WebCore::TileController::tileRevalidationTimerFired): Update to use OptionSet. * platform/graphics/ca/TileGrid.cpp: (WebCore::validationPolicyAsString): Use OptionSet. (WebCore::TileGrid::setNeedsDisplayInRect): Use auto for iterator and range-based for loop. (WebCore::TileGrid::updateTileLayerProperties): Ditto. (WebCore::TileGrid::blankPixelCount const): Ditto. (WebCore::TileGrid::removeTiles): Use HashCountedSet. (WebCore::TileGrid::revalidateTiles): Use OptionSet. (WebCore::TileGrid::retainedTileBackingStoreMemory const): Use ranged-based for loop. (WebCore::TileGrid::drawTileMapContents const): Use range-based for loop and use writeIntegerToBuffer instead of String::number. (WebCore::TileGrid::platformCALayerRepaintCount const): Use HashCountedSet. (WebCore::TileGrid::platformCALayerIncrementRepaintCount): Ditto. This cuts us down from 3 hash table lookups to 1. (WebCore::TileGrid::removeUnparentedTilesNow): Removed local variable to make code a little tighter. * platform/graphics/ca/TileGrid.h: Use OptionSet and HashCountedSet. Removed some type names. * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: (WebCore::PlatformCAFilters::setFiltersOnLayer): Use auto for reuslt of makeString. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): Ditto. * platform/mock/ScrollAnimatorMock.cpp: (WebCore::ScrollAnimatorMock::scrollbarPrefix const): Added helper function for use below. (WebCore::ScrollAnimatorMock::mouseEnteredScrollbar const): Use makeString instead of StringBuilder. (WebCore::ScrollAnimatorMock::mouseExitedScrollbar const): Ditto. (WebCore::ScrollAnimatorMock::mouseIsDownInScrollbar const): Ditto. * platform/mock/ScrollAnimatorMock.h: Ditto. * platform/network/ProxyServer.cpp: (WebCore::appendProxyServerString): Use append instead of appendLiteral. (WebCore::toString): Ditto. * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::sanitizeSuggestedFilename): Get rid of local variable with result of maekString in it. * platform/playstation/UserAgentPlayStation.cpp: (WebCore::platformForUAString): Deleted. No need for a global variable to hold the result of something called only once. (WebCore::platformVersionForUAString): Ditto. (WebCore::buildUserAgentString): Deleted. (WebCore::standardUserAgentStatic): Moved the logic from buildUserAgentString here, using makeString instead of StringBuilder. * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): Use auto for result of makeString. * platform/sql/SQLiteFileSystem.cpp: (WebCore::SQLiteFileSystem::deleteDatabaseFile): Ditto. * platform/text/DateTimeFormat.cpp: (WebCore::DateTimeFormat::quoteAndAppendLiteral): Use append instead of appendLiteral and StringView::substring instead of String::substring. * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::replaceNewlinesWithWindowsStyleNewlines): Use append instead of appendLiteral. * platform/win/UserAgentWin.cpp: (WebCore::standardUserAgent): Use makeString instead of StringBuildeer. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::name const): Ditto. (WebCore::RenderLayer::debugDescription const): Ditto. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::logLayerInfo): Use append instead of appendLiteral. * rendering/RenderTreeAsText.cpp: (WebCore::quoteAndEscapeNonPrintables): Ditto. (WebCore::nodePosition): Ditto. * svg/SVGPathStringBuilder.cpp: (WebCore::SVGPathStringBuilder::moveTo): Ditto. (WebCore::SVGPathStringBuilder::lineTo): Ditto. (WebCore::SVGPathStringBuilder::lineToHorizontal): Ditto. (WebCore::SVGPathStringBuilder::lineToVertical): Ditto. (WebCore::SVGPathStringBuilder::curveToCubic): Ditto. (WebCore::SVGPathStringBuilder::curveToCubicSmooth): Ditto. (WebCore::SVGPathStringBuilder::curveToQuadratic): Ditto. (WebCore::SVGPathStringBuilder::curveToQuadraticSmooth): Ditto. (WebCore::SVGPathStringBuilder::arcTo): Ditto. (WebCore::SVGPathStringBuilder::closePath): Ditto. * testing/Internals.cpp: (WebCore::Internals::dumpMarkerRects): Ditto. (WebCore::appendOffsets): (WebCore::Internals::scrollSnapOffsets): Ditto. * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::validateWorkerResponse): Use auto for reuslt of makeString. Source/WebKit: * NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp: (WebKit::ResourceLoadStatisticsDatabaseStore::ensureAndMakeDomainList): Use append instead of appendLiteral. (WebKit::domainsToString): Ditto. (WebKit::buildList): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::findNotVeryPrevalentResources): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::dumpResourceLoadStatistics): Ditto. (WebKit::appendBoolean): Ditto. (WebKit::appendNextEntry): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::appendSubStatisticList const): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::resourceToString const): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::attributionToString): Ditto. (WebKit::ResourceLoadStatisticsDatabaseStore::privateClickMeasurementToString): Ditto. * NetworkProcess/Classifier/ResourceLoadStatisticsMemoryStore.cpp: (WebKit::ResourceLoadStatisticsMemoryStore::dumpResourceLoadStatistics): Ditto. * NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp: Ditto. (WebKit::domainsToString): Ditto. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp: (WebKit::WebResourceLoadStatisticsStore::create): Moved this here from the header. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::toString const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::encode const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::decode): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyDataForSpecificFirstParty::operator== const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::toString const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::encode const): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::decode): Ditto. (WebKit::WebResourceLoadStatisticsStore::ThirdPartyData::operator< const): Ditto. * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h: Moved member functions of the nested structures into the implementation file and fixed the indentation of the structures to indicate the nesting. * NetworkProcess/NetworkLoadChecker.cpp: (WebKit::NetworkLoadChecker::continueCheckingRequest): Do not use a local variable for the reuslt of makeString. * NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::newTestingSession): Ditto. * NetworkProcess/cache/NetworkCache.cpp: (WebKit::NetworkCache::Cache::dumpContentsToFile): Use append instead of appendLiteral * NetworkProcess/cache/NetworkCacheEntry.cpp: (WebKit::NetworkCache::Entry::asJSON const): Ditto. * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::makeVersionedDirectoryPath): Do not use a local variable for the result of makeString. * NetworkProcess/soup/NetworkProcessSoup.cpp: (WebKit::buildAcceptLanguages): Use append instead of appendLiteral. * NetworkProcess/soup/WebSocketTaskSoup.cpp: (WebKit::WebSocketTask::acceptedExtensions const): Ditto. * NetworkProcess/webrtc/NetworkMDNSRegister.cpp: (WebKit::NetworkMDNSRegister::registerMDNSName): Use auto for the result of makeString. * Shared/WebMemorySampler.cpp: (WebKit::WebMemorySampler::writeHeaders): Ditto. * Shared/mac/AuxiliaryProcessMac.mm: (WebKit::initializeSandboxParameters): Do not use a local variable for the result of makeString. Also, take advantage of the support for concatenating an NSString instead of converting it to a WTF::String. * Shared/mac/WebMemorySampler.mac.mm: (WebKit::WebMemorySampler::sampleWebKit const): Use ASCIILiteral and remove explicit conversion to String. * UIProcess/API/glib/WebKitWebView.cpp: (webkitWebViewRunJavaScriptCallback): Use append instead of appendLiteral. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::fileCanBeAcceptedForUpload): Use auto for result of makeString. * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: Use makeString instead of StringBuilder. * UIProcess/Network/NetworkProcessProxy.cpp: (WebKit::NetworkProcessProxy::requestStorageSpace): Use auto for result of makeString. * UIProcess/WebBackForwardList.cpp: (WebKit::WebBackForwardList::loggingString): Use append instead of appendLiteral. * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processDidFinishLaunching): Use auto for result of makeString. (WebKit::WebProcessPool::startMemorySampler): Ditto. * WebProcess/WebPage/WebPage.cpp: (WebKit::dumpHistoryItem): Use append instead of appendLiteral. (WebKit::WebPage::getContentsAsString): Ditto. Source/WebKitLegacy: * WebCoreSupport/NetworkStorageSessionMap.cpp: (NetworkStorageSessionMap::switchToNewTestingSession): Do not use local for return value of makeString. Source/WebKitLegacy/mac: * WebView/WebHTMLRepresentation.mm: (regExpForLabels): Use append instead of appendLiteral. Also imrpove local variable names a bit. Source/WebKitLegacy/win: * AccessibleBase.cpp: (AccessibleBase::get_accKeyboardShortcut): Use append instead of appnedLiteral. * WebView.cpp: Ditto. Source/WTF: The optimization done by appendLiteral has minimal value and is something we can do without. It does not cut down the number of allocations, which is the main cost of the StringBuilder class. Getting rid of the differently named appendLiteral improves the design of the StringBuilder class for callers. Our goal is to get as close as possible to a single append function. If we decide we need an optimization for literals, we can come up with a different way that is compatible with append. For example, we could assume that any char array is a literal and check that at compile time in StringConcatenate; that optimization would work for both makeString and StringBuilder. Or we could use a strategy like ASCIILiteral. * wtf/FileSystem.cpp: (WTF::FileSystemImpl::encodeForFileName): Streamline logic, and use variadic append to make this more efficient. * wtf/JSONValues.cpp: (WTF::JSONImpl::Value::escapeString): Use append instead of appendLiteral. (WTF::JSONImpl::Value::writeJSON const): Ditto. * wtf/Logger.h: (WTF::Logger::log): Use auto for result of makeString. (WTF::Logger::logVerbose): Ditto. * wtf/MediaTime.cpp: (WTF::MediaTime::toString const): Use makeString instead of StringBuilder. * wtf/text/IntegerToStringConversion.h: Made lengthOfIntegerAsString a constexpr function so we can use it to compute the required size of arrays for conversion. Added using for both lengthOfIntegerAsString and writeIntegerToBuffer so we can use them without the WTF prefix as is customary for functions in WTF. * wtf/text/StringBuilder.h: (WTF::StringBuilder::appendLiteral): Deleted. * wtf/text/StringConcatenate.h: Added support for appending StringImpl&, StringImpl*, AtomStringImpl&, and AtomStringImpl*. Tools: * TestWebKitAPI/Tests/WTF/StringBuilder.cpp: Use append instead of appendLiteral. * TestWebKitAPI/Tests/WebCore/FileMonitor.cpp: (TestWebKitAPI::createCommand): Use makeString instead of StringBuilder. * TestWebKitAPI/Tests/WebCore/Logging.cpp: (TestWebKitAPI::TEST_F): Made lots of fixes to code inside #if TEST_OUTPUT, which hasn't compiled in a long time. Still not 100% there, but closer. * TestWebKitAPI/Tests/WebCore/TextCodec.cpp: (TestWebKitAPI::testDecode): Use append instead of appendLiteral. * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: (WTR::AccessibilityUIElement::helpText const): Ditto. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@277967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit is a cross-platform web browser engine. On iOS and macOS, it powers Safari, Mail, iBooks, and many other applications.
Visit WebKit Feature Status page to see which Web API has been implemented, in development, or under consideration.
On macOS, download Safari Technology Preview to test the latest version of WebKit. On Linux, download Epiphany Technology Preview. On Windows, you'll have to build it yourself.
Once your bug is filed, you will receive email when it is updated at each stage in the bug life cycle. After the bug is considered fixed, you may be asked to download the latest nightly and confirm that the fix works for you.
On Windows, follow the instructions on our website.
Run the following command to clone WebKit's Git SVN repository:
git clone git@github.com:WebKit/WebKit.git WebKit
or
git clone https://github.com/WebKit/WebKit.git WebKit
If you want to be able to track Subversion revision from your git checkout, you can run the following command to do so:
Tools/Scripts/git-webkit setup-git-svn
For information about this, and other aspects of using Git with WebKit, read the wiki page.
If you don‘t want to use Git, run the following command to check out WebKit’s Subversion repository:
svn checkout https://svn.webkit.org/repository/webkit/trunk WebKit
Install Xcode and its command line tools if you haven't done so already:
xcode-select --install
Run the following command to build a debug build with debugging symbols and assertions:
Tools/Scripts/build-webkit --debug
For performance testing, and other purposes, use --release
instead.
You can open WebKit.xcworkspace
to build and debug WebKit within Xcode.
If you don't use a custom build location in Xcode preferences, you have to update the workspace settings to use WebKitBuild
directory. In menu bar, choose File > Workspace Settings, then click the Advanced button, select “Custom”, “Relative to Workspace”, and enter WebKitBuild
for both Products and Intermediates.
iOS, tvOS and watchOS are all considered embedded builds. The first time after you install a new Xcode, you will need to run:
sudo Tools/Scripts/configure-xcode-for-embedded-development
Without this step, you will see the error message: “target specifies product type ‘com.apple.product-type.tool’, but there’s no such product type for the ‘iphonesimulator’ platform.
” when building target JSCLLIntOffsetsExtractor
of project JavaScriptCore
.
Run the following command to build a debug build with debugging symbols and assertions for embededded simulators:
Tools/Scripts/build-webkit --debug --<platform>-simulator
or embedded devices:
Tools/Scripts/build-webkit --debug --<platform>-device
where platform
is ios
, tvos
or watchos
.
For production builds:
cmake -DPORT=GTK -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja ninja sudo ninja install
For development builds:
Tools/gtk/install-dependencies Tools/Scripts/update-webkitgtk-libs Tools/Scripts/build-webkit --gtk --debug
For more information on building WebKitGTK+, see the wiki page.
For production builds:
cmake -DPORT=WPE -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja ninja sudo ninja install
For development builds:
Tools/wpe/install-dependencies Tools/Scripts/update-webkitwpe-libs Tools/Scripts/build-webkit --wpe --debug
For building WebKit on Windows, see the wiki page.
Run the following command to launch Safari with your local build of WebKit:
Tools/Scripts/run-safari --debug
The run-safari
script sets the DYLD_FRAMEWORK_PATH
environment variable to point to your build products, and then launches /Applications/Safari.app
. DYLD_FRAMEWORK_PATH
tells the system loader to prefer your build products over the frameworks installed in /System/Library/Frameworks
.
To run other applications with your local build of WebKit, run the following command:
Tools/Scripts/run-webkit-app <application-path>
Run the following command to launch iOS simulator with your local build of WebKit:
run-safari --debug --ios-simulator
In both cases, if you have built release builds instead, use --release
instead of --debug
.
If you have a development build, you can use the run-minibrowser script, e.g.:
run-minibrowser --debug --wpe
Pass one of --gtk
, --jsc-only
, or --wpe
to indicate the port to use.
Congratulations! You’re up and running. Now you can begin coding in WebKit and contribute your fixes and new features to the project. For details on submitting your code to the project, read Contributing Code.