Ignore:
Timestamp:
Apr 6, 2022, 12:05:23 PM (3 years ago)
Author:
Chris Dumez
Message:

Start replacing String(const char*) constructor with a String::fromLatin1(const char*) function
https://bugs.webkit.org/show_bug.cgi?id=238701

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

  • API/JSValue.mm:

(createStructHandlerMap):
(handerForStructTag):

  • API/JSWrapperMap.mm:

(allocateConstructorForCustomClass):

  • API/ObjCCallbackFunction.mm:

(JSC::ObjCCallbackFunctionImpl::name):

  • API/glib/JSCContext.cpp:

(jsc_context_check_syntax):

  • b3/air/testair.cpp:
  • bindings/ScriptFunctionCall.cpp:

(Deprecated::ScriptCallArgumentHandler::appendArgument):

  • debugger/DebuggerCallFrame.cpp:

(JSC::DebuggerCallFrame::functionName const):

  • heap/HeapSnapshotBuilder.cpp:

(JSC::HeapSnapshotBuilder::json):

  • inspector/JSGlobalObjectInspectorController.cpp:

(Inspector::JSGlobalObjectInspectorController::appendAPIBacktrace):

  • inspector/remote/socket/RemoteInspectorSocket.cpp:

(Inspector::RemoteInspector::sendMessageToBackend):

  • jit/ExecutableAllocator.cpp:

(JSC::dumpJITMemory):

  • jsc.cpp:

(JSC_DEFINE_HOST_FUNCTION):
(runWithOptions):
(CommandLine::parseArguments):

  • parser/Parser.cpp:

(JSC::Parser<LexerType>::parsePrimaryExpression):

  • parser/Parser.h:

(JSC::Parser::updateErrorMessage):

  • parser/SourceProvider.h:
  • runtime/BytecodeCacheError.cpp:

(JSC::BytecodeCacheError::StandardError::message const):

  • runtime/IntlLocale.cpp:

(JSC::IntlLocale::keywordValue const):
(JSC::IntlLocale::numberingSystems):

  • runtime/IntlObject.cpp:

(JSC::numberingSystemsForLocale):

  • runtime/Number.cpp:

(JSC::toStringWithRadix):
(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::numberToStringInternal):
(JSC::int52ToString):

  • runtime/Options.cpp:

(JSC::Options::overrideAliasedOptionWithHeuristic):
(JSC::Options::setAliasedOption):

  • runtime/RegExp.cpp:

(JSC::JSC_DEFINE_HOST_FUNCTION):

  • runtime/SamplingProfiler.cpp:

(JSC::SamplingProfiler::StackFrame::displayName):

  • runtime/String.cpp:

(JSC::toLocaleCase):

  • testRegExp.cpp:

(parseArguments):

  • tools/CompilerTimingScope.cpp:
  • tools/FunctionAllowlist.cpp:

(JSC::FunctionAllowlist::FunctionAllowlist):

  • wasm/js/WebAssemblyModuleConstructor.cpp:

(JSC::JSC_DEFINE_HOST_FUNCTION):

Source/WebCore:

  • Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:

(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
(WebCore::RTCStatsLogger::toJSONString const):

  • Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:

(WebCore::toException):
(WebCore::toRTCError):

  • Modules/webauthn/WebAuthenticationUtils.cpp:

(WebCore::buildAttestationMap):

  • Modules/webauthn/cbor/CBORValue.cpp:

(cbor::CBORValue::CBORValue):

  • Modules/webdatabase/Database.cpp:

(WebCore::Database::Database):
(WebCore::Database::getVersionFromDatabase):
(WebCore::Database::setVersionInDatabase):

  • animation/KeyframeEffect.cpp:

(WebCore::processPropertyIndexedKeyframes):

  • animation/KeyframeEffect.h:
  • bindings/js/SerializedScriptValue.cpp:

(WebCore::CloneSerializer::dumpIfTerminal):

  • contentextensions/ContentExtensionParser.cpp:

(WebCore::ContentExtensions::getDomainList):

  • crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
  • crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
  • crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
  • crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
  • crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
  • crypto/algorithms/CryptoAlgorithmECDSA.cpp:
  • crypto/algorithms/CryptoAlgorithmHMAC.cpp:
  • crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
  • crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
  • crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
  • crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
  • css/DOMCSSCustomPropertyDescriptor.h:
  • css/makeprop.pl:
  • dom/DataTransfer.cpp:

(WebCore::DataTransfer::types const):

  • dom/TextDecoder.cpp:

(WebCore::TextDecoder::encoding const):

  • editing/ApplyStyleCommand.cpp:

(WebCore::styleSpanClassString):

  • editing/ReplaceSelectionCommand.cpp:

(WebCore::isInterchangeNewlineNode):
(WebCore::isInterchangeConvertedSpaceSpan):

  • editing/TextInsertionBaseCommand.cpp:

(WebCore::canAppendNewLineFeedToSelection):

  • html/HiddenInputType.cpp:

(WebCore::HiddenInputType::appendFormData const):

  • html/MediaFragmentURIParser.cpp:

(WebCore::MediaFragmentURIParser::parseFragments):

  • html/canvas/WebGLRenderingContext.cpp:

(WebCore::WebGLRenderingContext::getSupportedExtensions):

  • html/parser/HTMLPreloadScanner.cpp:

(WebCore::testPreloadScannerViewportSupport):

  • loader/FormSubmission.cpp:

(WebCore::FormSubmission::create):

  • loader/MediaResourceLoader.cpp:

(WebCore::MediaResource::responseReceived):

  • loader/cache/CachedApplicationManifest.cpp:

(WebCore::CachedApplicationManifest::encoding const):

  • loader/cache/CachedCSSStyleSheet.cpp:

(WebCore::CachedCSSStyleSheet::didAddClient):
(WebCore::CachedCSSStyleSheet::encoding const):
(WebCore::CachedCSSStyleSheet::checkNotify):

  • loader/cache/CachedSVGDocument.cpp:

(WebCore::CachedSVGDocument::encoding const):

  • loader/cache/CachedScript.cpp:

(WebCore::CachedScript::encoding const):

  • loader/cache/CachedXSLStyleSheet.cpp:

(WebCore::CachedXSLStyleSheet::encoding const):

  • page/cocoa/ResourceUsageThreadCocoa.mm:

(WebCore::threadInfos):

  • platform/cocoa/PasteboardCocoa.mm:

(WebCore::Pasteboard::read):

  • platform/gamepad/GamepadConstants.cpp:

(WebCore::standardGamepadMappingString):
(WebCore::xrStandardGamepadMappingString):

  • platform/graphics/FourCC.h:

(WTF::LogArgument<WebCore::FourCC>::toString):

  • platform/graphics/angle/GraphicsContextGLANGLE.cpp:

(WebCore::GraphicsContextGLANGLE::initialize):
(WebCore::GraphicsContextGLANGLE::getString):

  • platform/mac/ThreadCheck.mm:

(WebCoreReportThreadViolation):

  • platform/mediastream/RealtimeMediaSourceCenter.cpp:

(WebCore::RealtimeMediaSourceCenter::hashStringWithSalt):

  • platform/mock/PlatformSpeechSynthesizerMock.cpp:

(WebCore::PlatformSpeechSynthesizerMock::initializeVoiceList):

  • platform/sql/SQLiteDatabase.cpp:

(WebCore::SQLiteDatabase::authorizerFunction):

  • platform/text/cocoa/LocaleCocoa.mm:

(WebCore::LocaleCocoa::monthLabels):
(WebCore::LocaleCocoa::shortMonthLabels):

  • testing/Internals.cpp:

(WebCore::Internals::testDictionaryLogging):

  • xml/XPathValue.h:

(WebCore::XPath::Value::Value):

  • xml/XSLTProcessorLibxslt.cpp:

(WebCore::XSLTProcessor::parseErrorFunc):
(WebCore::docLoaderFunc):
(WebCore::XSLTProcessor::transformToString):

  • xml/parser/XMLDocumentParserLibxml2.cpp:

(WebCore::openFunc):

Source/WebCore/PAL:

  • pal/graphics/WebGPU/Impl/WebGPUAdapterImpl.cpp:

(PAL::WebGPU::adapterName):

  • pal/graphics/WebGPU/Impl/WebGPUDeviceImpl.cpp:

(PAL::WebGPU::DeviceImpl::popErrorScope):

Source/WebGPU:

  • WebGPU/APIConversions.h:

(WebGPU::fromAPI):

  • WebGPU/Adapter.mm:

(WebGPU::Adapter::requestDevice):

  • WebGPU/ComputePipeline.mm:

(WebGPU::createConstantValues):
(WebGPU::Device::createComputePipeline):

  • WebGPU/ShaderModule.mm:

(WebGPU::earlyCompileShaderModule):
(WebGPU::Device::createShaderModule):

Source/WTF:

  • wtf/Logger.h:

(WTF::LogArgument::toString):

  • wtf/text/WTFString.cpp:

(string):

  • wtf/text/WTFString.h:
Location:
trunk/Source/JavaScriptCore/parser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/Parser.cpp

    r291779r292487 
    50105010        if (!re) {
    50115011            Yarr::ErrorCode errorCode = Yarr::checkSyntax(pattern->string(), flags->string());
    5012             regexFail(String { Yarr::errorMessage(errorCode) });
     5012            regexFail(String::fromLatin1(Yarr::errorMessage(errorCode)));
    50135013        }
    50145014        return re;
  • trunk/Source/JavaScriptCore/parser/Parser.h

    r291946r292487 
    16311631    {
    16321632        ASSERT(msg);
    1633         m_errorMessage = String(msg);
     1633        m_errorMessage = String::fromLatin1(msg);
    16341634        ASSERT(!m_errorMessage.isNull());
    16351635    }
  • trunk/Source/JavaScriptCore/parser/SourceProvider.h

    r290300r292487 
    179179        WebAssemblySourceProvider(Vector<uint8_t>&& data, const SourceOrigin& sourceOrigin, String&& sourceURL)
    180180            : BaseWebAssemblySourceProvider(sourceOrigin, WTFMove(sourceURL))
    181             , m_source("[WebAssembly source]")
     181            , m_source("[WebAssembly source]"_s)
    182182            , m_data(WTFMove(data))
    183183        {
Note: See TracChangeset for help on using the changeset viewer.