WebKit Bugzilla
Attachment 358249 Details for
Bug 193101
: Create a different syntax for incorporating single characters in makeString
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193101-20190103111235.patch (text/plain), 60.95 KB, created by
Charlie Turner
on 2019-01-03 03:12:37 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Charlie Turner
Created:
2019-01-03 03:12:37 PST
Size:
60.95 KB
patch
obsolete
>Subversion Revision: 239558 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 8e5c858959c96f04584f543a187b7513029373bd..d69bf2dc31b8be194e44bc14f5c11ad8bdbc0cb5 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,41 @@ >+2019-01-03 Charlie Turner <cturner@igalia.com> >+ >+ Create a different syntax for incorporating single characters in makeString >+ https://bugs.webkit.org/show_bug.cgi?id=193101 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update several places using raw character literals in makeString / >+ String concatenation. >+ >+ * inspector/agents/InspectorConsoleAgent.cpp: >+ (Inspector::InspectorConsoleAgent::count): >+ * jsc.cpp: >+ (currentWorkingDirectory): >+ * runtime/Error.cpp: >+ (JSC::throwDOMAttributeGetterTypeError): >+ * runtime/ExceptionHelpers.cpp: >+ (JSC::errorDescriptionForValue): >+ (JSC::createError): >+ (JSC::createErrorForInvalidGlobalAssignment): >+ * runtime/IntlObject.cpp: >+ (JSC::resolveLocale): >+ * runtime/JSFunction.cpp: >+ (JSC::JSFunction::setFunctionName): >+ * runtime/LiteralParser.cpp: >+ (JSC::LiteralParser<CharType>::Lexer::lex): >+ (JSC::LiteralParser<CharType>::parse): >+ * runtime/RegExpPrototype.cpp: >+ (JSC::regExpProtoFuncToString): >+ * runtime/Symbol.cpp: >+ (JSC::Symbol::descriptiveString const): >+ * runtime/TypeSet.cpp: >+ (JSC::TypeSet::displayName const): >+ * tools/FunctionWhitelist.cpp: >+ (JSC::FunctionWhitelist::contains const): >+ * wasm/WasmIndexOrName.cpp: >+ (JSC::Wasm::makeString): >+ > 2018-12-28 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > [JSC] Remove one indirection in JSObject::toStringName >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 4803c26e9159ac9375aca59941896e0b22331842..631e9850a20108938f3f6fa9f220260bd8ad4196 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,18 @@ >+2019-01-03 Charlie Turner <cturner@igalia.com> >+ >+ Create a different syntax for incorporating single characters in makeString >+ https://bugs.webkit.org/show_bug.cgi?id=193101 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * wtf/CMakeLists.txt: Add a new LiteralCharacter class >+ * wtf/URL.cpp: >+ (WTF::URL::setFragmentIdentifier): >+ * wtf/text/StringConcatenate.h: Remove explicit specializations >+ for UChar and LChar, UChar causes ambiguities in template >+ deduction, since different platforms define that as different >+ unsigned 16-bit types. >+ > 2018-12-27 Alex Christensen <achristensen@webkit.org> > > Resurrect Mac CMake build >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 07c098758ecf84eee9926d3c5de1fc84707190f6..da283138acc198a0f72b4f1165f9820caf401828 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,82 @@ >+2019-01-03 Charlie Turner <cturner@igalia.com> >+ >+ Create a different syntax for incorporating single characters in makeString >+ https://bugs.webkit.org/show_bug.cgi?id=193101 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Update several places using raw character literals in >+ makeString/String concatenation. >+ >+ Covered by existing tests. >+ >+ * Modules/webdatabase/Database.cpp: >+ (WebCore::guidForOriginAndName): >+ * bindings/js/JSDOMExceptionHandling.cpp: >+ (WebCore::throwAttributeTypeError): >+ (WebCore::makeGetterTypeErrorMessage): >+ (WebCore::throwSetterTypeError): >+ (WebCore::makeThisTypeErrorMessage): >+ * css/CSSAspectRatioValue.cpp: >+ (WebCore::CSSAspectRatioValue::customCSSText const): >+ * css/CSSCanvasValue.cpp: >+ (WebCore::CSSCanvasValue::customCSSText const): >+ * css/CSSNamedImageValue.cpp: >+ (WebCore::CSSNamedImageValue::customCSSText const): >+ * css/CSSPrimitiveValue.cpp: >+ (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): >+ * css/CSSReflectValue.cpp: >+ (WebCore::CSSReflectValue::customCSSText const): >+ * css/Pair.h: >+ (WebCore::Pair::cssText const): >+ * css/Rect.h: >+ * css/StyleProperties.cpp: >+ (WebCore::StyleProperties::borderSpacingValue const): >+ * dom/QualifiedName.h: >+ (WebCore::QualifiedName::toString const): >+ * fileapi/BlobURL.cpp: >+ (WebCore::BlobURL::createBlobURL): >+ * html/FTPDirectoryDocument.cpp: >+ (WebCore::processFileDateString): >+ * html/URLUtils.h: >+ (WebCore::URLUtils<T>::protocol const): >+ (WebCore::URLUtils<T>::setHost): >+ * html/ValidationMessage.cpp: >+ (WebCore::ValidationMessage::updateValidationMessage): >+ * html/canvas/CanvasRenderingContext2D.cpp: >+ (WebCore::CanvasRenderingContext2D::font const): >+ * html/parser/HTMLTreeBuilder.cpp: >+ (WebCore::addNamesWithPrefix): >+ * inspector/InspectorOverlay.cpp: >+ (WebCore::evaluateCommandInOverlay): >+ * inspector/agents/WebConsoleAgent.cpp: >+ (WebCore::WebConsoleAgent::didReceiveResponse): >+ * loader/FormSubmission.cpp: >+ (WebCore::appendMailtoPostFormDataToURL): >+ * loader/FrameLoader.cpp: >+ (WebCore::FrameLoader::reportAuthenticationChallengeBlocked): >+ * loader/cache/CachedResourceLoader.cpp: >+ (WebCore::CachedResourceLoader::printAccessDeniedMessage const): >+ * page/PrintContext.cpp: >+ (WebCore::PrintContext::pageProperty): >+ (WebCore::PrintContext::pageSizeAndMarginsInPixels): >+ * page/SecurityOriginData.cpp: >+ (WebCore::SecurityOriginData::toString const): >+ * page/csp/ContentSecurityPolicyDirective.h: >+ (WebCore::ContentSecurityPolicyDirective::ContentSecurityPolicyDirective): >+ * platform/LocalizedStrings.cpp: >+ (WebCore::truncatedStringForLookupMenuItem): >+ * platform/glib/UserAgentGLib.cpp: >+ (WebCore::standardUserAgent): >+ * platform/network/CredentialStorage.cpp: >+ (WebCore::originStringFromURL): >+ * platform/network/ResourceResponseBase.cpp: >+ (WebCore::ResourceResponseBase::sanitizeSuggestedFilename): >+ * svg/SVGAnimatedTransformList.cpp: >+ (WebCore::SVGAnimatedTransformListAnimator::constructFromString): >+ * workers/service/ServiceWorkerRegistrationKey.cpp: >+ (WebCore::ServiceWorkerRegistrationKey::toDatabaseKey const): >+ > 2018-12-28 Yusuke Suzuki <yusukesuzuki@slowstart.org> > > [JSC] Remove one indirection in JSObject::toStringName >diff --git a/Source/WebDriver/ChangeLog b/Source/WebDriver/ChangeLog >index 11c827022c7373d0b5de6f7366d26aa3194193e2..85454a75aee5856a60d99ac7a7a53d65feb7b540 100644 >--- a/Source/WebDriver/ChangeLog >+++ b/Source/WebDriver/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-03 Charlie Turner <cturner@igalia.com> >+ >+ Create a different syntax for incorporating single characters in makeString >+ https://bugs.webkit.org/show_bug.cgi?id=193101 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Session.cpp: >+ (WebDriver::Session::executeScript): >+ > 2018-12-21 Carlos Garcia Campos <cgarcia@igalia.com> > > [GLIB] WebDriver: dbusConnectionClosedCallback can be called after SessionHost has been deleted >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 33e8fdb18ff47187a54c50ba1b6f0fcc162bfcd0..cfe1d733d775e3c65722d07170fcfdd2e39ad34f 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,21 @@ >+2019-01-03 Charlie Turner <cturner@igalia.com> >+ >+ Create a different syntax for incorporating single characters in makeString >+ https://bugs.webkit.org/show_bug.cgi?id=193101 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/ios/ChildProcessIOS.mm: >+ (WebKit::ChildProcess::initializeSandbox): >+ * Shared/mac/ChildProcessMac.mm: >+ (WebKit::initializeSandboxParameters): >+ * UIProcess/API/APIContentRuleListStore.cpp: >+ (API::constructedPathFilter): >+ * UIProcess/Automation/WebAutomationSession.cpp: >+ (WebKit::domainByAddingDotPrefixIfNeeded): >+ * WebProcess/cocoa/WebProcessCocoa.mm: >+ (WebKit::origin): >+ > 2018-12-28 Wenson Hsieh <wenson_hsieh@apple.com> > > Move WKEditCommandObjC and WKEditorUndoTargetObjC into a separate file >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index 6f70827f3da4290e6b94b825804310161938c723..7c72ca257b5190bcf348b74bb9d4f602ddb0a5f7 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,13 @@ >+2019-01-03 Charlie Turner <cturner@igalia.com> >+ >+ Create a different syntax for incorporating single characters in makeString >+ https://bugs.webkit.org/show_bug.cgi?id=193101 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebCoreSupport/WebInspectorClient.cpp: >+ (WebInspectorFrontendClient::updateWindowTitle): >+ > 2018-12-24 Fujii Hironori <Hironori.Fujii@sony.com> > > Remove "using namespace std;" >diff --git a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp >index 4cfed7c55f468db4eb1b50f50a824c3fdd7fea99..af7324cb187852abac6d218c31dcaf34b821b79b 100644 >--- a/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp >+++ b/Source/JavaScriptCore/inspector/agents/InspectorConsoleAgent.cpp >@@ -190,11 +190,11 @@ void InspectorConsoleAgent::count(JSC::ExecState* state, Ref<ScriptArguments>&& > if (!arguments->argumentCount()) { > // '@' prefix for engine generated labels. > title = "Global"_s; >- identifier = makeString('@', title); >+ identifier = makeString('@'_ch, title); > } else { > // '#' prefix for user labels. > arguments->getFirstArgumentAsString(title); >- identifier = makeString('#', title); >+ identifier = makeString('#'_ch, title); > } > > auto result = m_counts.add(identifier, 1); >diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp >index add5a4e2ab51bccba4c74952a4ad6966f4c3eaa1..36d7936e657a2dce64ef94fa13f5b77b721a84aa 100644 >--- a/Source/JavaScriptCore/jsc.cpp >+++ b/Source/JavaScriptCore/jsc.cpp >@@ -763,7 +763,7 @@ static Optional<DirectoryName> currentWorkingDirectory() > if (directoryString[directoryString.length() - 1] == pathSeparator()) > return extractDirectoryName(directoryString); > // Append the seperator to represents the file name. extractDirectoryName only accepts the absolute file name. >- return extractDirectoryName(makeString(directoryString, pathSeparator())); >+ return extractDirectoryName(makeString(directoryString, LiteralCharacter<UChar>(pathSeparator()))); > } > > static String resolvePath(const DirectoryName& directoryName, const ModuleName& moduleName) >diff --git a/Source/JavaScriptCore/runtime/Error.cpp b/Source/JavaScriptCore/runtime/Error.cpp >index 6388e4ed3c93848f776a5973a2028875a5a46bec..10f63807ba48628cc72f9c2bb76cb45280e957bc 100644 >--- a/Source/JavaScriptCore/runtime/Error.cpp >+++ b/Source/JavaScriptCore/runtime/Error.cpp >@@ -293,7 +293,7 @@ JSObject* throwSyntaxError(ExecState* exec, ThrowScope& scope, const String& mes > > JSValue throwDOMAttributeGetterTypeError(ExecState* exec, ThrowScope& scope, const ClassInfo* classInfo, PropertyName propertyName) > { >- return throwTypeError(exec, scope, makeString("The ", classInfo->className, '.', String(propertyName.uid()), " getter can only be used on instances of ", classInfo->className)); >+ return throwTypeError(exec, scope, makeString("The ", classInfo->className, '.'_ch, String(propertyName.uid()), " getter can only be used on instances of ", classInfo->className)); > } > > JSObject* createError(ExecState* exec, const String& message) >diff --git a/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp b/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp >index 8a617b480f5bcf334eda8947f8eea1a4b64d1e5d..19bf12d85ae9c7c7f0eb278dc7b537fdab671504 100644 >--- a/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp >+++ b/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp >@@ -93,7 +93,7 @@ JSObject* createUndefinedVariableError(ExecState* exec, const Identifier& ident) > JSString* errorDescriptionForValue(ExecState* exec, JSValue v) > { > if (v.isString()) >- return jsNontrivialString(exec, makeString('"', asString(v)->value(exec), '"')); >+ return jsNontrivialString(exec, makeString('"'_ch, asString(v)->value(exec), '"'_ch)); > if (v.isSymbol()) > return jsNontrivialString(exec, asSymbol(v)->descriptiveString()); > if (v.isObject()) { >@@ -267,7 +267,7 @@ JSObject* createError(ExecState* exec, JSValue value, const String& message, Err > VM& vm = exec->vm(); > auto scope = DECLARE_CATCH_SCOPE(vm); > >- String errorMessage = tryMakeString(errorDescriptionForValue(exec, value)->value(exec), ' ', message); >+ String errorMessage = tryMakeString(errorDescriptionForValue(exec, value)->value(exec), ' '_ch, message); > if (errorMessage.isNull()) > return createOutOfMemoryError(exec); > scope.assertNoException(); >@@ -317,7 +317,7 @@ JSObject* createNotAnObjectError(ExecState* exec, JSValue value) > > JSObject* createErrorForInvalidGlobalAssignment(ExecState* exec, const String& propertyName) > { >- return createReferenceError(exec, makeString("Strict mode forbids implicit creation of global property '", propertyName, '\'')); >+ return createReferenceError(exec, makeString("Strict mode forbids implicit creation of global property '", propertyName, '\''_ch)); > } > > JSObject* createTDZError(ExecState* exec) >diff --git a/Source/JavaScriptCore/runtime/IntlObject.cpp b/Source/JavaScriptCore/runtime/IntlObject.cpp >index 7a18b3dbd898063f543d97bb4d0a378f935c08f8..ef5e399da9b7db097e473a2819800ce409b53ad5 100644 >--- a/Source/JavaScriptCore/runtime/IntlObject.cpp >+++ b/Source/JavaScriptCore/runtime/IntlObject.cpp >@@ -767,7 +767,7 @@ HashMap<String, String> resolveLocale(ExecState& state, const HashSet<String>& a > const String& requestedValue = extensionSubtags[keyPos + 1]; > if (keyLocaleData.contains(requestedValue)) { > value = requestedValue; >- supportedExtensionAddition = makeString('-', key, '-', value); >+ supportedExtensionAddition = makeString('-'_ch, key, '-'_ch, value); > } > } else if (keyLocaleData.contains(static_cast<String>("true"_s))) { > value = "true"_s; >diff --git a/Source/JavaScriptCore/runtime/JSFunction.cpp b/Source/JavaScriptCore/runtime/JSFunction.cpp >index 50568e846b6a7f0388c9ea469df9edfc77504ab3..ae64b8fde8bc4bb4c50ee2af9f9d9bb4a054fc3e 100644 >--- a/Source/JavaScriptCore/runtime/JSFunction.cpp >+++ b/Source/JavaScriptCore/runtime/JSFunction.cpp >@@ -673,7 +673,7 @@ void JSFunction::setFunctionName(ExecState* exec, JSValue value) > if (uid.isNullSymbol()) > name = emptyString(); > else >- name = makeString('[', String(&uid), ']'); >+ name = makeString('['_ch, String(&uid), ']'_ch); > } else { > JSString* jsStr = value.toString(exec); > RETURN_IF_EXCEPTION(scope, void()); >diff --git a/Source/JavaScriptCore/runtime/LiteralParser.cpp b/Source/JavaScriptCore/runtime/LiteralParser.cpp >index 84939b5e21745770a2cf5558424c77adde5c8f85..2bba44b47fca44d21d7767f9e1fbb5a80b525636 100644 >--- a/Source/JavaScriptCore/runtime/LiteralParser.cpp >+++ b/Source/JavaScriptCore/runtime/LiteralParser.cpp >@@ -516,7 +516,7 @@ ALWAYS_INLINE TokenType LiteralParser<CharType>::Lexer::lex(LiteralParserToken<C > return tokenType; > } > } >- m_lexErrorMessage = makeString("Unrecognized token '", StringView { m_ptr, 1 }, '\''); >+ m_lexErrorMessage = makeString("Unrecognized token '", StringView { m_ptr, 1 }, '\''_ch); > return TokError; > } > >@@ -996,9 +996,9 @@ JSValue LiteralParser<CharType>::parse(ParserState initialState) > case TokIdentifier: { > typename Lexer::LiteralParserTokenPtr token = m_lexer.currentToken(); > if (token->stringIs8Bit) >- m_parseErrorMessage = makeString("Unexpected identifier \"", StringView { token->stringToken8, token->stringLength }, '"'); >+ m_parseErrorMessage = makeString("Unexpected identifier \"", StringView { token->stringToken8, token->stringLength }, '"'_ch); > else >- m_parseErrorMessage = makeString("Unexpected identifier \"", StringView { token->stringToken16, token->stringLength }, '"'); >+ m_parseErrorMessage = makeString("Unexpected identifier \"", StringView { token->stringToken16, token->stringLength }, '"'_ch); > return JSValue(); > } > case TokColon: >diff --git a/Source/JavaScriptCore/runtime/RegExpPrototype.cpp b/Source/JavaScriptCore/runtime/RegExpPrototype.cpp >index 7831679638d3e4b37b5f2bdc599d536604e38bc2..255519630c4f72029daf178c4ad8c85e1593c317 100644 >--- a/Source/JavaScriptCore/runtime/RegExpPrototype.cpp >+++ b/Source/JavaScriptCore/runtime/RegExpPrototype.cpp >@@ -247,7 +247,7 @@ EncodedJSValue JSC_HOST_CALL regExpProtoFuncToString(ExecState* exec) > String flags = flagsValue.toWTFString(exec); > RETURN_IF_EXCEPTION(scope, encodedJSValue()); > >- RELEASE_AND_RETURN(scope, JSValue::encode(jsMakeNontrivialString(exec, '/', source, '/', flags))); >+ RELEASE_AND_RETURN(scope, JSValue::encode(jsMakeNontrivialString(exec, '/'_ch, source, '/'_ch, flags))); > } > > EncodedJSValue JSC_HOST_CALL regExpProtoGetterGlobal(ExecState* exec) >diff --git a/Source/JavaScriptCore/runtime/Symbol.cpp b/Source/JavaScriptCore/runtime/Symbol.cpp >index d83e31d1029c3ea29931c1de23b00bc4ecf6c109..52a2fb62ef48dbc949d1ca02013ab3ce44ebf5ea 100644 >--- a/Source/JavaScriptCore/runtime/Symbol.cpp >+++ b/Source/JavaScriptCore/runtime/Symbol.cpp >@@ -100,7 +100,7 @@ void Symbol::destroy(JSCell* cell) > > String Symbol::descriptiveString() const > { >- return makeString("Symbol(", String(privateName().uid()), ')'); >+ return makeString("Symbol(", String(privateName().uid()), ')'_ch); > } > > String Symbol::description() const >diff --git a/Source/JavaScriptCore/runtime/TypeSet.cpp b/Source/JavaScriptCore/runtime/TypeSet.cpp >index ae3102ed0524b8a136eed6869f3b283c0d454483..462e8a6ec0f1e305ecbdddfc68d71f6da2b88242 100644 >--- a/Source/JavaScriptCore/runtime/TypeSet.cpp >+++ b/Source/JavaScriptCore/runtime/TypeSet.cpp >@@ -165,7 +165,7 @@ String TypeSet::displayName() const > if (doesTypeConformTo(TypeObject)) > return ctorName; > if (doesTypeConformTo(TypeObject | TypeNull | TypeUndefined)) >- return ctorName + '?'; >+ return ctorName + '?'_ch; > } > > // The order of these checks are important. For example, if a value is only a function, it conforms to TypeFunction, but it also conforms to TypeFunction | TypeNull. >diff --git a/Source/JavaScriptCore/tools/FunctionWhitelist.cpp b/Source/JavaScriptCore/tools/FunctionWhitelist.cpp >index c3081e77ac3f712af72a6c8b319bc529d5a4a26f..4cdb6d956a94b9ae1a93b254dc7452d25b58d43f 100644 >--- a/Source/JavaScriptCore/tools/FunctionWhitelist.cpp >+++ b/Source/JavaScriptCore/tools/FunctionWhitelist.cpp >@@ -89,7 +89,7 @@ bool FunctionWhitelist::contains(CodeBlock* codeBlock) const > if (m_entries.contains(hash)) > return true; > >- return m_entries.contains(name + '#' + hash); >+ return m_entries.contains(name + '#'_ch + hash); > } > > } // namespace JSC >diff --git a/Source/JavaScriptCore/wasm/WasmIndexOrName.cpp b/Source/JavaScriptCore/wasm/WasmIndexOrName.cpp >index 4120ae6a9494fd4469f97b8f4088d7fcac318a88..b5fe521f78ab961a6d63a1329ac3e3f736fb9d34 100644 >--- a/Source/JavaScriptCore/wasm/WasmIndexOrName.cpp >+++ b/Source/JavaScriptCore/wasm/WasmIndexOrName.cpp >@@ -49,8 +49,8 @@ String makeString(const IndexOrName& ion) > return "wasm-stub"_s; > const String moduleName = ion.nameSection()->moduleName.size() ? String(ion.nameSection()->moduleName.data(), ion.nameSection()->moduleName.size()) : String(ion.nameSection()->moduleHash.data(), ion.nameSection()->moduleHash.size()); > if (ion.isIndex()) >- return makeString(moduleName, ".wasm-function[", String::number(ion.m_indexName.index & ~IndexOrName::indexTag), ']'); >- return makeString(moduleName, ".wasm-function[", String(ion.m_indexName.name->data(), ion.m_indexName.name->size()), ']'); >+ return makeString(moduleName, ".wasm-function[", String::number(ion.m_indexName.index & ~IndexOrName::indexTag), ']'_ch); >+ return makeString(moduleName, ".wasm-function[", String(ion.m_indexName.name->data(), ion.m_indexName.name->size()), ']'_ch); > } > > } } // namespace JSC::Wasm >diff --git a/Source/WTF/wtf/CMakeLists.txt b/Source/WTF/wtf/CMakeLists.txt >index cee1cce1e57184d13bd2cd519ef6a20dffb1a96a..0a361b96aa2ffda7ce1820b35f86e5e4cb135748 100644 >--- a/Source/WTF/wtf/CMakeLists.txt >+++ b/Source/WTF/wtf/CMakeLists.txt >@@ -296,6 +296,7 @@ set(WTF_PUBLIC_HEADERS > text/LChar.h > text/LineBreakIteratorPoolICU.h > text/LineEnding.h >+ text/LiteralCharacter.h > text/NullTextBreakIterator.h > text/OrdinalNumber.h > text/StringBuffer.h >@@ -428,6 +429,7 @@ set(WTF_SOURCES > text/CString.cpp > text/ExternalStringImpl.cpp > text/LineEnding.cpp >+ text/LiteralCharacter.cpp > text/StringBuilder.cpp > text/StringBuilderJSON.cpp > text/StringImpl.cpp >diff --git a/Source/WTF/wtf/URL.cpp b/Source/WTF/wtf/URL.cpp >index 64b4a0b1755e1b79dc2e45c3b518c9d262e1dba5..2da4d81c54e6a752d924f60e39bb54c08d36b7ce 100644 >--- a/Source/WTF/wtf/URL.cpp >+++ b/Source/WTF/wtf/URL.cpp >@@ -606,7 +606,7 @@ void URL::setFragmentIdentifier(StringView identifier) > > // FIXME: Optimize the case where the identifier already happens to be equal to what was passed? > // FIXME: Is it correct to do this without encoding and escaping non-ASCII characters? >- *this = URLParser { makeString(StringView { m_string }.substring(0, m_queryEnd), '#', identifier) }.result(); >+ *this = URLParser { makeString(StringView { m_string }.substring(0, m_queryEnd), '#'_ch, identifier) }.result(); > } > > void URL::removeFragmentIdentifier() >diff --git a/Source/WTF/wtf/text/StringConcatenate.h b/Source/WTF/wtf/text/StringConcatenate.h >index 19f231210fd9d75c7eda6f8399a0f586b1eaac3f..3dcb8aad6c2d994edfb0225a69055bae347bd8d8 100644 >--- a/Source/WTF/wtf/text/StringConcatenate.h >+++ b/Source/WTF/wtf/text/StringConcatenate.h >@@ -28,6 +28,7 @@ > #include <string.h> > #include <wtf/CheckedArithmetic.h> > #include <wtf/text/AtomicString.h> >+#include <wtf/text/LiteralCharacter.h> > #include <wtf/text/StringView.h> > > // This macro is helpful for testing how many intermediate Strings are created while evaluating an >@@ -41,59 +42,32 @@ namespace WTF { > template<typename StringType, typename> > class StringTypeAdapter; > >-template<> >-class StringTypeAdapter<char, void> { >+template<typename T> >+class StringTypeAdapter<LiteralCharacter<T>, void> { > public: >- StringTypeAdapter(char character) >+ StringTypeAdapter(LiteralCharacter<T> character) > : m_character(character) > { > } > > unsigned length() { return 1; } >- bool is8Bit() { return true; } >- >- void writeTo(LChar* destination) const >- { >- *destination = m_character; >- } >- >- void writeTo(UChar* destination) const >- { >- *destination = m_character; >- } >- >- String toString() const { return String(&m_character, 1); } >- >-private: >- char m_character; >-}; >- >-template<> >-class StringTypeAdapter<UChar, void> { >-public: >- StringTypeAdapter(UChar character) >- : m_character(character) >- { >- } >- >- unsigned length() const { return 1; } >- bool is8Bit() const { return m_character <= 0xff; } >+ bool is8Bit() { return m_character.is8Bit(); } > > void writeTo(LChar* destination) const > { > ASSERT(is8Bit()); >- *destination = static_cast<LChar>(m_character); >+ *destination = static_cast<LChar>(m_character.value()); > } > > void writeTo(UChar* destination) const > { >- *destination = m_character; >+ *destination = static_cast<UChar>(m_character.value()); > } > >- String toString() const { return String(&m_character, 1); } >+ String toString() const { return String(&m_character.value(), 1); } > > private: >- UChar m_character; >+ LiteralCharacter<T> m_character; > }; > > template<> >diff --git a/Source/WebCore/Modules/webdatabase/Database.cpp b/Source/WebCore/Modules/webdatabase/Database.cpp >index c875f3bf458c9838ffefdf7cf7ac90f9e92dd6a2..0a75455dcb05a11637383a3a47b19747b23253fa 100644 >--- a/Source/WebCore/Modules/webdatabase/Database.cpp >+++ b/Source/WebCore/Modules/webdatabase/Database.cpp >@@ -186,7 +186,7 @@ static HashMap<DatabaseGUID, HashSet<Database*>>& guidToDatabaseMap() > static inline DatabaseGUID guidForOriginAndName(const String& origin, const String& name) > { > static NeverDestroyed<HashMap<String, DatabaseGUID>> map; >- return map.get().ensure(makeString(origin, '/', name), [] { >+ return map.get().ensure(makeString(origin, '/'_ch, name), [] { > static DatabaseGUID lastUsedGUID; > return ++lastUsedGUID; > }).iterator->value; >diff --git a/Source/WebCore/bindings/js/JSDOMExceptionHandling.cpp b/Source/WebCore/bindings/js/JSDOMExceptionHandling.cpp >index 1311c9da05a9c01cd6953fff2fc4799dfe049693..f92605b3e87d208649cd130acf78d1ac798a88e3 100644 >--- a/Source/WebCore/bindings/js/JSDOMExceptionHandling.cpp >+++ b/Source/WebCore/bindings/js/JSDOMExceptionHandling.cpp >@@ -233,7 +233,7 @@ JSC::EncodedJSValue throwArgumentTypeError(JSC::ExecState& state, JSC::ThrowScop > > void throwAttributeTypeError(JSC::ExecState& state, JSC::ThrowScope& scope, const char* interfaceName, const char* attributeName, const char* expectedType) > { >- throwTypeError(state, scope, makeString("The ", interfaceName, '.', attributeName, " attribute must be an instance of ", expectedType)); >+ throwTypeError(state, scope, makeString("The ", interfaceName, '.'_ch, attributeName, " attribute must be an instance of ", expectedType)); > } > > JSC::EncodedJSValue throwRequiredMemberTypeError(JSC::ExecState& state, JSC::ThrowScope& scope, const char* memberName, const char* dictionaryName, const char* expectedType) >@@ -265,7 +265,7 @@ void throwNonFiniteTypeError(ExecState& state, JSC::ThrowScope& scope) > > String makeGetterTypeErrorMessage(const char* interfaceName, const char* attributeName) > { >- return makeString("The ", interfaceName, '.', attributeName, " getter can only be used on instances of ", interfaceName); >+ return makeString("The ", interfaceName, '.'_ch, attributeName, " getter can only be used on instances of ", interfaceName); > } > > JSC::EncodedJSValue throwGetterTypeError(JSC::ExecState& state, JSC::ThrowScope& scope, const char* interfaceName, const char* attributeName) >@@ -280,13 +280,13 @@ JSC::EncodedJSValue rejectPromiseWithGetterTypeError(JSC::ExecState& state, cons > > bool throwSetterTypeError(JSC::ExecState& state, JSC::ThrowScope& scope, const char* interfaceName, const char* attributeName) > { >- throwTypeError(state, scope, makeString("The ", interfaceName, '.', attributeName, " setter can only be used on instances of ", interfaceName)); >+ throwTypeError(state, scope, makeString("The ", interfaceName, '.'_ch, attributeName, " setter can only be used on instances of ", interfaceName)); > return false; > } > > String makeThisTypeErrorMessage(const char* interfaceName, const char* functionName) > { >- return makeString("Can only call ", interfaceName, '.', functionName, " on instances of ", interfaceName); >+ return makeString("Can only call ", interfaceName, '.'_ch, functionName, " on instances of ", interfaceName); > } > > EncodedJSValue throwThisTypeError(JSC::ExecState& state, JSC::ThrowScope& scope, const char* interfaceName, const char* functionName) >diff --git a/Source/WebCore/css/CSSAspectRatioValue.cpp b/Source/WebCore/css/CSSAspectRatioValue.cpp >index 5c414aba91e381a61a6e9334303e47f977a83b33..61bcf440b57c6a7162d8f0ffaac2067df1692dbb 100644 >--- a/Source/WebCore/css/CSSAspectRatioValue.cpp >+++ b/Source/WebCore/css/CSSAspectRatioValue.cpp >@@ -33,7 +33,7 @@ namespace WebCore { > > String CSSAspectRatioValue::customCSSText() const > { >- return String::number(m_numeratorValue) + '/' + String::number(m_denominatorValue); >+ return String::number(m_numeratorValue) + '/'_ch + String::number(m_denominatorValue); > } > > bool CSSAspectRatioValue::equals(const CSSAspectRatioValue& other) const >diff --git a/Source/WebCore/css/CSSCanvasValue.cpp b/Source/WebCore/css/CSSCanvasValue.cpp >index b880deeacd69f14baffb69cd5ec0bd799fa3dc28..a1bdb630b47742b57fdb2463b4496a5cb359cb77 100644 >--- a/Source/WebCore/css/CSSCanvasValue.cpp >+++ b/Source/WebCore/css/CSSCanvasValue.cpp >@@ -38,7 +38,7 @@ CSSCanvasValue::~CSSCanvasValue() > > String CSSCanvasValue::customCSSText() const > { >- return makeString("-webkit-canvas(", m_name, ')'); >+ return makeString("-webkit-canvas(", m_name, ')'_ch); > } > > void CSSCanvasValue::canvasChanged(HTMLCanvasElement&, const FloatRect& changedRect) >diff --git a/Source/WebCore/css/CSSNamedImageValue.cpp b/Source/WebCore/css/CSSNamedImageValue.cpp >index 35750c79cee1714eaeeb779bcd8af225aa29784b..8879d8b5e84d7497dccb9298e255bf8531a5e33b 100644 >--- a/Source/WebCore/css/CSSNamedImageValue.cpp >+++ b/Source/WebCore/css/CSSNamedImageValue.cpp >@@ -32,7 +32,7 @@ namespace WebCore { > > String CSSNamedImageValue::customCSSText() const > { >- return makeString("-webkit-named-image(", m_name, ')'); >+ return makeString("-webkit-named-image(", m_name, ')'_ch); > } > > RefPtr<Image> CSSNamedImageValue::image(RenderElement*, const FloatSize& size) >diff --git a/Source/WebCore/css/CSSPrimitiveValue.cpp b/Source/WebCore/css/CSSPrimitiveValue.cpp >index 06ffb60ea46ed118f32f464f64c95fc44a35732d..f101405a027e1bd72d94415d4caba4010e9e2975 100644 >--- a/Source/WebCore/css/CSSPrimitiveValue.cpp >+++ b/Source/WebCore/css/CSSPrimitiveValue.cpp >@@ -1040,7 +1040,7 @@ ALWAYS_INLINE String CSSPrimitiveValue::formatNumberForCustomCSSText() const > return result.toString(); > } > case CSS_COUNTER_NAME: >- return "counter(" + String(m_value.string) + ')'; >+ return "counter(" + String(m_value.string) + ')'_ch; > case CSS_COUNTER: { > StringBuilder result; > String separator = m_value.counter->separator(); >diff --git a/Source/WebCore/css/CSSReflectValue.cpp b/Source/WebCore/css/CSSReflectValue.cpp >index 5b8b8a8dd7b69ec4b1a582dff00d45d97670f507..f6bfd87d4a52cdfd5412bd6cd9ec7eb73984307c 100644 >--- a/Source/WebCore/css/CSSReflectValue.cpp >+++ b/Source/WebCore/css/CSSReflectValue.cpp >@@ -33,8 +33,8 @@ namespace WebCore { > String CSSReflectValue::customCSSText() const > { > if (m_mask) >- return m_direction->cssText() + ' ' + m_offset->cssText() + ' ' + m_mask->cssText(); >- return m_direction->cssText() + ' ' + m_offset->cssText(); >+ return m_direction->cssText() + ' '_ch + m_offset->cssText() + ' '_ch + m_mask->cssText(); >+ return m_direction->cssText() + ' '_ch + m_offset->cssText(); > } > > bool CSSReflectValue::equals(const CSSReflectValue& other) const >diff --git a/Source/WebCore/css/Pair.h b/Source/WebCore/css/Pair.h >index e0ef452717ba2c217528105caba6fdbae5efd016..37c8434e76cd78b9bb56a3f255e50dfa0b2b606b 100644 >--- a/Source/WebCore/css/Pair.h >+++ b/Source/WebCore/css/Pair.h >@@ -54,7 +54,7 @@ public: > String second = this->second()->cssText(); > if (m_encoding == IdenticalValueEncoding::Coalesce && first == second) > return first; >- return first + ' ' + second; >+ return first + ' '_ch + second; > } > > bool equals(const Pair& other) const { return compareCSSValuePtr(m_first, other.m_first) && compareCSSValuePtr(m_second, other.m_second); } >diff --git a/Source/WebCore/css/Rect.h b/Source/WebCore/css/Rect.h >index ec1aae825958152f6a309db42475db04922b5bcd..cc8198f3ee308ff2274fbed280f85912e23bc411 100644 >--- a/Source/WebCore/css/Rect.h >+++ b/Source/WebCore/css/Rect.h >@@ -70,7 +70,7 @@ private: > Rect() = default; > static String generateCSSString(const String& top, const String& right, const String& bottom, const String& left) > { >- return "rect(" + top + ", " + right + ", " + bottom + ", " + left + ')'; >+ return "rect(" + top + ", " + right + ", " + bottom + ", " + left + ')'_ch; > } > }; > >diff --git a/Source/WebCore/css/StyleProperties.cpp b/Source/WebCore/css/StyleProperties.cpp >index 7bddbdc353563ab7482ad6a7de415a651b11b881..b3274f24ddeb6cc4f96f833eefbd52745394bd16 100644 >--- a/Source/WebCore/css/StyleProperties.cpp >+++ b/Source/WebCore/css/StyleProperties.cpp >@@ -287,7 +287,7 @@ String StyleProperties::borderSpacingValue(const StylePropertyShorthand& shortha > String verticalValueCSSText = verticalValue->cssText(); > if (horizontalValueCSSText == verticalValueCSSText) > return horizontalValueCSSText; >- return horizontalValueCSSText + ' ' + verticalValueCSSText; >+ return horizontalValueCSSText + ' '_ch + verticalValueCSSText; > } > > void StyleProperties::appendFontLonghandValueIfExplicit(CSSPropertyID propertyID, StringBuilder& result, String& commonValue) const >diff --git a/Source/WebCore/dom/QualifiedName.h b/Source/WebCore/dom/QualifiedName.h >index 8b762e5e89f78d24f17e8f8049106d27b1985d7e..9568ad59e5c2b16471d19961bb58eaf5d9e5ad75 100644 >--- a/Source/WebCore/dom/QualifiedName.h >+++ b/Source/WebCore/dom/QualifiedName.h >@@ -141,7 +141,7 @@ inline String QualifiedName::toString() const > if (!hasPrefix()) > return localName(); > >- return prefix().string() + ':' + localName().string(); >+ return prefix().string() + ':'_ch + localName().string(); > } > > } // namespace WebCore >diff --git a/Source/WebCore/fileapi/BlobURL.cpp b/Source/WebCore/fileapi/BlobURL.cpp >index 146c0db049d71548d0fc2d889e46bb6f55649ae7..2f67e8a2b4b6f475a8d825a46285c6ead44d8556 100644 >--- a/Source/WebCore/fileapi/BlobURL.cpp >+++ b/Source/WebCore/fileapi/BlobURL.cpp >@@ -72,7 +72,7 @@ String BlobURL::getIdentifier(const URL& url) > URL BlobURL::createBlobURL(const String& originString) > { > ASSERT(!originString.isEmpty()); >- String urlString = "blob:" + originString + '/' + createCanonicalUUIDString(); >+ String urlString = "blob:" + originString + '/'_ch + createCanonicalUUIDString(); > return URL({ }, urlString); > } > >diff --git a/Source/WebCore/html/FTPDirectoryDocument.cpp b/Source/WebCore/html/FTPDirectoryDocument.cpp >index d78110cc9edb9da004d41584ac49dbae0024e9f2..8a763646baf85196d715a6b6db38b1a6d37c3eec 100644 >--- a/Source/WebCore/html/FTPDirectoryDocument.cpp >+++ b/Source/WebCore/html/FTPDirectoryDocument.cpp >@@ -247,9 +247,9 @@ static String processFileDateString(const FTPTime& fileTime) > String dateString; > > if (fileTime.tm_year > -1) >- dateString = makeString(months[month], ' ', String::number(fileTime.tm_mday), ", ", String::number(fileTime.tm_year)); >+ dateString = makeString(months[month], ' '_ch, String::number(fileTime.tm_mday), ", ", String::number(fileTime.tm_year)); > else >- dateString = makeString(months[month], ' ', String::number(fileTime.tm_mday), ", ", String::number(now.year())); >+ dateString = makeString(months[month], ' '_ch, String::number(fileTime.tm_mday), ", ", String::number(now.year())); > > return dateString + timeOfDay; > } >diff --git a/Source/WebCore/html/URLUtils.h b/Source/WebCore/html/URLUtils.h >index 3a8d5413f93148e13f49f968550629f4c09c3404..71787e43fc3e7f27acc86b8536c91f4afa69519c 100644 >--- a/Source/WebCore/html/URLUtils.h >+++ b/Source/WebCore/html/URLUtils.h >@@ -90,7 +90,7 @@ String URLUtils<T>::origin() const > template <typename T> > String URLUtils<T>::protocol() const > { >- return makeString(href().protocol(), ':'); >+ return makeString(href().protocol(), ':'_ch); > } > > template <typename T> >@@ -172,7 +172,7 @@ void URLUtils<T>::setHost(const String& value) > // http://dev.w3.org/html5/spec/infrastructure.html#url-decomposition-idl-attributes > // specifically goes against RFC 3986 (p3.2) and > // requires setting the port to "0" if it is set to empty string. >- url.setHostAndPort(value.substring(0, separator + 1) + '0'); >+ url.setHostAndPort(value.substring(0, separator + 1) + '0'_ch); > } else { > if (WTF::isDefaultPortForProtocol(port, url.protocol())) > url.setHostAndPort(value.substring(0, separator)); >diff --git a/Source/WebCore/html/ValidationMessage.cpp b/Source/WebCore/html/ValidationMessage.cpp >index 4cc00bc1624142e1b414db2db27e8be079c187d1..29ca5887498404df246ff4b762d39f5ab28e7817 100644 >--- a/Source/WebCore/html/ValidationMessage.cpp >+++ b/Source/WebCore/html/ValidationMessage.cpp >@@ -91,7 +91,7 @@ void ValidationMessage::updateValidationMessage(const String& message) > if (!updatedMessage.isEmpty()) { > const AtomicString& title = m_element->attributeWithoutSynchronization(titleAttr); > if (!title.isEmpty()) >- updatedMessage = updatedMessage + '\n' + title; >+ updatedMessage = updatedMessage + '\n'_ch + title; > } > } > >diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >index 77b6df21aaa3cc44bef6355aae323cd5f8e3cd7f..d4280c87e07e44ac95a01d0cccc47d9114acdb20 100644 >--- a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp >@@ -113,7 +113,7 @@ String CanvasRenderingContext2D::font() const > if (family.startsWith("-webkit-")) > family = family.substring(8); > if (family.contains(' ')) >- family = makeString('"', family, '"'); >+ family = makeString('"'_ch, family, '"'_ch); > > serializedFont.append(' '); > serializedFont.append(family); >diff --git a/Source/WebCore/html/parser/HTMLTreeBuilder.cpp b/Source/WebCore/html/parser/HTMLTreeBuilder.cpp >index 5244b25cbc7c9e8b5097908928ec1a1701df91cd..9116f3fd5f3aa4facb6f6bd4a1c15f6e119ea059 100644 >--- a/Source/WebCore/html/parser/HTMLTreeBuilder.cpp >+++ b/Source/WebCore/html/parser/HTMLTreeBuilder.cpp >@@ -530,7 +530,7 @@ static void addNamesWithPrefix(HashMap<AtomicString, QualifiedName>& map, const > for (unsigned i = 0; i < length; ++i) { > const QualifiedName& name = *names[i]; > const AtomicString& localName = name.localName(); >- map.add(prefix + ':' + localName, QualifiedName(prefix, localName, name.namespaceURI())); >+ map.add(prefix + ':'_ch + localName, QualifiedName(prefix, localName, name.namespaceURI())); > } > } > >diff --git a/Source/WebCore/inspector/InspectorOverlay.cpp b/Source/WebCore/inspector/InspectorOverlay.cpp >index 3e3bc816ea90c6436313ca5e3c8f0d985e53d9aa..94b3296127ae42419cb24f9c141aec3b14edbc6a 100644 >--- a/Source/WebCore/inspector/InspectorOverlay.cpp >+++ b/Source/WebCore/inspector/InspectorOverlay.cpp >@@ -787,7 +787,7 @@ static void evaluateCommandInOverlay(Page* page, Ref<JSON::Array>&& command) > if (!page) > return; > >- page->mainFrame().script().evaluate(ScriptSourceCode(makeString("dispatch(", command->toJSONString(), ')'))); >+ page->mainFrame().script().evaluate(ScriptSourceCode(makeString("dispatch(", command->toJSONString(), ')'_ch))); > } > > void InspectorOverlay::evaluateInOverlay(const String& method) >diff --git a/Source/WebCore/inspector/agents/WebConsoleAgent.cpp b/Source/WebCore/inspector/agents/WebConsoleAgent.cpp >index d3d43b6f6fe3e29d94a130a322de532ab9f1b5c1..ed8f42bb2420f82a33269052a8874d2fcfa759c4 100644 >--- a/Source/WebCore/inspector/agents/WebConsoleAgent.cpp >+++ b/Source/WebCore/inspector/agents/WebConsoleAgent.cpp >@@ -148,7 +148,7 @@ void WebConsoleAgent::didReceiveResponse(unsigned long requestIdentifier, const > return; > > if (response.httpStatusCode() >= 400) { >- String message = "Failed to load resource: the server responded with a status of " + String::number(response.httpStatusCode()) + " (" + response.httpStatusText() + ')'; >+ String message = "Failed to load resource: the server responded with a status of " + String::number(response.httpStatusCode()) + " (" + response.httpStatusText() + ')'_ch; > addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::Network, MessageType::Log, MessageLevel::Error, message, response.url().string(), 0, 0, nullptr, requestIdentifier)); > } > } >diff --git a/Source/WebCore/loader/FormSubmission.cpp b/Source/WebCore/loader/FormSubmission.cpp >index 9b8e60473cc63b12d835c99307606a0b88c24b23..fa98e6cf70629fb0839c58974fe2fc164ea6e3e1 100644 >--- a/Source/WebCore/loader/FormSubmission.cpp >+++ b/Source/WebCore/loader/FormSubmission.cpp >@@ -81,7 +81,7 @@ static void appendMailtoPostFormDataToURL(URL& url, const FormData& data, const > if (query.isEmpty()) > url.setQuery(body); > else >- url.setQuery(query + '&' + body); >+ url.setQuery(query + '&'_ch + body); > } > > void FormSubmission::Attributes::parseAction(const String& action) >diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp >index 51bb9488e59c7df3b633a02059db12f91c3208f1..d2ba6ad2a2f1083282f50fb19b86dda224de2fe3 100644 >--- a/Source/WebCore/loader/FrameLoader.cpp >+++ b/Source/WebCore/loader/FrameLoader.cpp >@@ -1669,7 +1669,7 @@ void FrameLoader::reportAuthenticationChallengeBlocked(Frame* frame, const URL& > if (!frame) > return; > >- frame->document()->addConsoleMessage(MessageSource::Security, MessageLevel::Error, makeString("Blocked ", url.stringCenterEllipsizedToLength(), " from asking for credentials because ", reason, '.')); >+ frame->document()->addConsoleMessage(MessageSource::Security, MessageLevel::Error, makeString("Blocked ", url.stringCenterEllipsizedToLength(), " from asking for credentials because ", reason, '.'_ch)); > } > > const ResourceRequest& FrameLoader::initialRequest() const >diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp >index d3fedc8e0a2810f9faf7ed45ddf80349749af19e..9bd0e297bf022a19e98ec00026f07d6625906e14 100644 >--- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp >+++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp >@@ -1216,7 +1216,7 @@ void CachedResourceLoader::printAccessDeniedMessage(const URL& url) const > > String message; > if (!m_document || m_document->url().isNull()) >- message = makeString("Unsafe attempt to load URL ", url.stringCenterEllipsizedToLength(), '.'); >+ message = makeString("Unsafe attempt to load URL ", url.stringCenterEllipsizedToLength(), '.'_ch); > else > message = makeString("Unsafe attempt to load URL ", url.stringCenterEllipsizedToLength(), " from origin ", m_document->origin(), ". Domains, protocols and ports must match.\n"); > >diff --git a/Source/WebCore/page/PrintContext.cpp b/Source/WebCore/page/PrintContext.cpp >index 6d2b7fc8b3269c39cbec66d630398a081f217778..70ecc9042061a42339ab5511b6b32fe4d0595099 100644 >--- a/Source/WebCore/page/PrintContext.cpp >+++ b/Source/WebCore/page/PrintContext.cpp >@@ -335,7 +335,7 @@ String PrintContext::pageProperty(Frame* frame, const char* propertyName, int pa > if (!strcmp(propertyName, "font-family")) > return style->fontDescription().firstFamily(); > if (!strcmp(propertyName, "size")) >- return String::number(style->pageSize().width.value()) + ' ' + String::number(style->pageSize().height.value()); >+ return String::number(style->pageSize().width.value()) + ' '_ch + String::number(style->pageSize().height.value()); > > return makeString("pageProperty() unimplemented for: ", propertyName); > } >@@ -350,8 +350,7 @@ String PrintContext::pageSizeAndMarginsInPixels(Frame* frame, int pageNumber, in > IntSize pageSize(width, height); > frame->document()->pageSizeAndMarginsInPixels(pageNumber, pageSize, marginTop, marginRight, marginBottom, marginLeft); > >- return "(" + String::number(pageSize.width()) + ", " + String::number(pageSize.height()) + ") " + >- String::number(marginTop) + ' ' + String::number(marginRight) + ' ' + String::number(marginBottom) + ' ' + String::number(marginLeft); >+ return "(" + String::number(pageSize.width()) + ", " + String::number(pageSize.height()) + ") " + String::number(marginTop) + ' '_ch + String::number(marginRight) + ' '_ch + String::number(marginBottom) + ' '_ch + String::number(marginLeft); > } > > bool PrintContext::beginAndComputePageRectsWithPageSize(Frame& frame, const FloatSize& pageSizeInPixels) >diff --git a/Source/WebCore/page/SecurityOriginData.cpp b/Source/WebCore/page/SecurityOriginData.cpp >index 05f8b19dae5879d0cdfda7c7649eca2b44c398a6..0945d477a9e29e5b581d5b517b2bbc1ccdd4dff6 100644 >--- a/Source/WebCore/page/SecurityOriginData.cpp >+++ b/Source/WebCore/page/SecurityOriginData.cpp >@@ -43,7 +43,7 @@ String SecurityOriginData::toString() const > > if (!port) > return makeString(protocol, "://", host); >- return makeString(protocol, "://", host, ':', static_cast<uint32_t>(*port)); >+ return makeString(protocol, "://", host, ':'_ch, static_cast<uint32_t>(*port)); > } > > SecurityOriginData SecurityOriginData::fromFrame(Frame* frame) >diff --git a/Source/WebCore/page/csp/ContentSecurityPolicyDirective.h b/Source/WebCore/page/csp/ContentSecurityPolicyDirective.h >index a8f1d4f0bde14f14b88aa3940edd8c896261e3de..c514cd3dbac5b679b3ffac6b29bec9432cb4880a 100644 >--- a/Source/WebCore/page/csp/ContentSecurityPolicyDirective.h >+++ b/Source/WebCore/page/csp/ContentSecurityPolicyDirective.h >@@ -36,7 +36,7 @@ class ContentSecurityPolicyDirective { > public: > ContentSecurityPolicyDirective(const ContentSecurityPolicyDirectiveList& directiveList, const String& name, const String& value) > : m_name(name) >- , m_text(name + ' ' + value) >+ , m_text(name + ' '_ch + value) > , m_directiveList(directiveList) > { > } >diff --git a/Source/WebCore/platform/LocalizedStrings.cpp b/Source/WebCore/platform/LocalizedStrings.cpp >index 301aa397edee27d9f92f75fc1486d67ab8fb60bf..fd2368c2e27df88db5077020115a3fd4482a5d91 100644 >--- a/Source/WebCore/platform/LocalizedStrings.cpp >+++ b/Source/WebCore/platform/LocalizedStrings.cpp >@@ -88,7 +88,7 @@ static String truncatedStringForLookupMenuItem(const String& original) > > String trimmed = original.stripWhiteSpace(); > unsigned numberOfCharacters = numCodeUnitsInGraphemeClusters(trimmed, maxNumberOfGraphemeClustersInLookupMenuItem); >- return numberOfCharacters == trimmed.length() ? trimmed : makeString(trimmed.left(numberOfCharacters), horizontalEllipsis); >+ return numberOfCharacters == trimmed.length() ? trimmed : makeString(trimmed.left(numberOfCharacters), LiteralCharacter<UChar>(horizontalEllipsis)); > } > > #endif >diff --git a/Source/WebCore/platform/glib/UserAgentGLib.cpp b/Source/WebCore/platform/glib/UserAgentGLib.cpp >index a3ba4e46dc28395d852ce8fb68c70b5799e27724..23c44f3f7fccb3d51f59a8d6eb86753c09edf0d3 100644 >--- a/Source/WebCore/platform/glib/UserAgentGLib.cpp >+++ b/Source/WebCore/platform/glib/UserAgentGLib.cpp >@@ -132,7 +132,7 @@ String standardUserAgent(const String& applicationName, const String& applicatio > if (finalApplicationVersion.isEmpty()) > finalApplicationVersion = versionForUAString(); > >- return standardUserAgentStatic() + ' ' + applicationName + '/' + finalApplicationVersion; >+ return standardUserAgentStatic() + ' '_ch + applicationName + '/'_ch + finalApplicationVersion; > } > > String standardUserAgentForURL(const URL& url) >diff --git a/Source/WebCore/platform/network/CredentialStorage.cpp b/Source/WebCore/platform/network/CredentialStorage.cpp >index b9af422aef2efab48b4949f9b634f5097093f87c..c0f4f148a05f7fae51b695f99aa60627d43a2559 100644 >--- a/Source/WebCore/platform/network/CredentialStorage.cpp >+++ b/Source/WebCore/platform/network/CredentialStorage.cpp >@@ -42,7 +42,7 @@ CredentialStorage& CredentialStorage::defaultCredentialStorage() > > static String originStringFromURL(const URL& url) > { >- return makeString(url.protocol(), "://", url.hostAndPort(), '/'); >+ return makeString(url.protocol(), "://", url.hostAndPort(), '/'_ch); > } > > static String protectionSpaceMapKeyFromURL(const URL& url) >diff --git a/Source/WebCore/platform/network/ResourceResponseBase.cpp b/Source/WebCore/platform/network/ResourceResponseBase.cpp >index c8909755e55ec48f11eed63c8a4e218fa2d01492..afce303455d48286350c87606b2a3c354c5aca91 100644 >--- a/Source/WebCore/platform/network/ResourceResponseBase.cpp >+++ b/Source/WebCore/platform/network/ResourceResponseBase.cpp >@@ -279,7 +279,7 @@ String ResourceResponseBase::sanitizeSuggestedFilename(const String& suggestedFi > ResourceResponse response(URL({ }, "http://example.com/"), String(), -1, String()); > response.setHTTPStatusCode(200); > String escapedSuggestedFilename = String(suggestedFilename).replace('\\', "\\\\").replace('"', "\\\""); >- String value = makeString("attachment; filename=\"", escapedSuggestedFilename, '"'); >+ String value = makeString("attachment; filename=\"", escapedSuggestedFilename, '"'_ch); > response.setHTTPHeaderField(HTTPHeaderName::ContentDisposition, value); > return response.suggestedFilename(); > } >diff --git a/Source/WebCore/svg/SVGAnimatedTransformList.cpp b/Source/WebCore/svg/SVGAnimatedTransformList.cpp >index e6fcd0d6c922a3350e49bd8cfe527c811e9f0588..de478dc0e135f505d208ae7f7bc87bd93ed9fe49 100644 >--- a/Source/WebCore/svg/SVGAnimatedTransformList.cpp >+++ b/Source/WebCore/svg/SVGAnimatedTransformList.cpp >@@ -41,7 +41,7 @@ SVGAnimatedTransformListAnimator::SVGAnimatedTransformListAnimator(SVGAnimationE > > std::unique_ptr<SVGAnimatedType> SVGAnimatedTransformListAnimator::constructFromString(const String& string) > { >- return SVGAnimatedType::create(SVGPropertyTraits<SVGTransformListValues>::fromString(m_transformTypeString + string + ')')); >+ return SVGAnimatedType::create(SVGPropertyTraits<SVGTransformListValues>::fromString(m_transformTypeString + string + ')'_ch)); > } > > std::unique_ptr<SVGAnimatedType> SVGAnimatedTransformListAnimator::startAnimValAnimation(const SVGElementAnimatedPropertyList& animatedTypes) >diff --git a/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp b/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp >index 0d53bcf923ed6126539f35dd2b949ca14b7b567c..78962d4831b319224e162cb755aab1c959b20fb1 100644 >--- a/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp >+++ b/Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp >@@ -30,6 +30,7 @@ > > #include "SecurityOrigin.h" > #include <wtf/URLHash.h> >+#include <wtf/text/LiteralCharacter.h> > > namespace WebCore { > >@@ -89,9 +90,10 @@ static const char separatorCharacter = '_'; > > String ServiceWorkerRegistrationKey::toDatabaseKey() const > { >+ auto separator = LiteralCharacter<char>(separatorCharacter); > if (m_topOrigin.port) >- return makeString(m_topOrigin.protocol, separatorCharacter, m_topOrigin.host, separatorCharacter, String::number(m_topOrigin.port.value()), separatorCharacter, m_scope.string()); >- return makeString(m_topOrigin.protocol, separatorCharacter, m_topOrigin.host, separatorCharacter, separatorCharacter, m_scope.string()); >+ return makeString(m_topOrigin.protocol, separator, m_topOrigin.host, separator, String::number(m_topOrigin.port.value()), separator, m_scope.string()); >+ return makeString(m_topOrigin.protocol, separator, m_topOrigin.host, separator, m_scope.string()); > } > > Optional<ServiceWorkerRegistrationKey> ServiceWorkerRegistrationKey::fromDatabaseKey(const String& key) >diff --git a/Source/WebDriver/Session.cpp b/Source/WebDriver/Session.cpp >index 9a2cb52bfe3b2d06f0a6056b521f8c5588c35799..44b84345033a1328f52ade64445503178c5f9d83 100644 >--- a/Source/WebDriver/Session.cpp >+++ b/Source/WebDriver/Session.cpp >@@ -33,6 +33,7 @@ > #include <wtf/HashSet.h> > #include <wtf/HexNumber.h> > #include <wtf/NeverDestroyed.h> >+#include <wtf/text/LiteralCharacter.h> > > namespace WebDriver { > >@@ -1864,7 +1865,7 @@ void Session::executeScript(const String& script, RefPtr<JSON::Array>&& argument > parameters->setString("browsingContextHandle"_s, m_toplevelBrowsingContext.value()); > if (m_currentBrowsingContext) > parameters->setString("frameHandle"_s, m_currentBrowsingContext.value()); >- parameters->setString("function"_s, "function(){" + script + '}'); >+ parameters->setString("function"_s, "function(){" + script + '}'_ch); > parameters->setArray("arguments"_s, WTFMove(arguments)); > if (mode == ExecuteScriptMode::Async) { > parameters->setBoolean("expectsImplicitCallbackArgument"_s, true); >diff --git a/Source/WebKit/Shared/ios/ChildProcessIOS.mm b/Source/WebKit/Shared/ios/ChildProcessIOS.mm >index 81d54f3bf009efaf05d402d6f5cfea8d10f4b567..a61fee1d95fc11596f54c2e853e074335ebff7ff 100644 >--- a/Source/WebKit/Shared/ios/ChildProcessIOS.mm >+++ b/Source/WebKit/Shared/ios/ChildProcessIOS.mm >@@ -64,7 +64,7 @@ void ChildProcess::initializeSandbox(const ChildProcessInitializationParameters& > NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKWebView")]; > String defaultProfilePath = [webkit2Bundle pathForResource:[[NSBundle mainBundle] bundleIdentifier] ofType:@"sb"]; > if (sandboxParameters.userDirectorySuffix().isNull()) { >- String defaultUserDirectorySuffix = makeString(String([[NSBundle mainBundle] bundleIdentifier]), '+', parameters.clientIdentifier); >+ String defaultUserDirectorySuffix = makeString(String([[NSBundle mainBundle] bundleIdentifier]), '+'_ch, parameters.clientIdentifier); > sandboxParameters.setUserDirectorySuffix(defaultUserDirectorySuffix); > } > >diff --git a/Source/WebKit/Shared/mac/ChildProcessMac.mm b/Source/WebKit/Shared/mac/ChildProcessMac.mm >index 20c4a9c1a42776e667110b6160a882593388f5a1..628fa32fb4dd7f5ed14a7990350ced876fd8f0dd 100644 >--- a/Source/WebKit/Shared/mac/ChildProcessMac.mm >+++ b/Source/WebKit/Shared/mac/ChildProcessMac.mm >@@ -607,12 +607,12 @@ static void initializeSandboxParameters(const ChildProcessInitializationParamete > if (sandboxParameters.userDirectorySuffix().isNull()) { > auto userDirectorySuffix = parameters.extraInitializationData.find("user-directory-suffix"); > if (userDirectorySuffix != parameters.extraInitializationData.end()) >- sandboxParameters.setUserDirectorySuffix([makeString(userDirectorySuffix->value, '/', String([[NSBundle mainBundle] bundleIdentifier])) fileSystemRepresentation]); >+ sandboxParameters.setUserDirectorySuffix([makeString(userDirectorySuffix->value, '/'_ch, String([[NSBundle mainBundle] bundleIdentifier])) fileSystemRepresentation]); > else { > String clientIdentifier = codeSigningIdentifier(parameters.connectionIdentifier.xpcConnection.get()); > if (clientIdentifier.isNull()) > clientIdentifier = parameters.clientIdentifier; >- String defaultUserDirectorySuffix = makeString(String([[NSBundle mainBundle] bundleIdentifier]), '+', clientIdentifier); >+ String defaultUserDirectorySuffix = makeString(String([[NSBundle mainBundle] bundleIdentifier]), '+'_ch, clientIdentifier); > sandboxParameters.setUserDirectorySuffix(defaultUserDirectorySuffix); > } > } >diff --git a/Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp b/Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp >index 38f42cb91a538ede68e225941050f96af67b9698..7f631189c3114bc23078fb288be99ddb043fd3de 100644 >--- a/Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp >+++ b/Source/WebKit/UIProcess/API/APIContentRuleListStore.cpp >@@ -106,7 +106,7 @@ static const WTF::String& constructedPathPrefix(bool legacyFilename) > > static const WTF::String constructedPathFilter(bool legacyFilename) > { >- return makeString(constructedPathPrefix(legacyFilename), '*'); >+ return makeString(constructedPathPrefix(legacyFilename), '*'_ch); > } > > static WTF::String constructedPath(const WTF::String& base, const WTF::String& identifier, bool legacyFilename) >diff --git a/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp b/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >index d209fae99d3ea7600c72c6af3ea84430a2f1ff49..d2aab9f289ea5207703133261f371eb5a8b1179c 100644 >--- a/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >+++ b/Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp >@@ -1298,7 +1298,7 @@ static String domainByAddingDotPrefixIfNeeded(String domain) > // RFC 2965: If an explicitly specified value does not start with a dot, the user agent supplies a leading dot. > // Assume that any host that ends with a digit is trying to be an IP address. > if (!URL::hostIsIPAddress(domain)) >- return makeString('.', domain); >+ return makeString('.'_ch, domain); > } > > return domain; >diff --git a/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm b/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >index 83ab80f5e7bdb0b9ba54df420e0337044ee8a1a2..1157cea76e0a98043050c7063be8b75d103a3d2c 100644 >--- a/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >+++ b/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >@@ -467,7 +467,7 @@ static NSURL *origin(WebPage& page) > if (!mainFrameOrigin->isUnique()) > mainFrameOriginString = mainFrameOrigin->toRawString(); > else >- mainFrameOriginString = makeString(mainFrameURL.protocol(), ':'); // toRawString() is not supposed to work with unique origins, and would just return "://". >+ mainFrameOriginString = makeString(mainFrameURL.protocol(), ':'_ch); // toRawString() is not supposed to work with unique origins, and would just return "://". > > // +[NSURL URLWithString:] returns nil when its argument is malformed. It's unclear when we would have a malformed URL here, > // but it happens in practice according to <rdar://problem/14173389>. Leaving an assertion in to catch a reproducible case. >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp b/Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp >index 221e22f38605a51f0737ead3c8be9c395c424dc7..be6250fc095adcc67aaf2f9e3b5b3ef26c96711f 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebInspectorClient.cpp >@@ -449,7 +449,7 @@ void WebInspectorFrontendClient::destroyInspectorView() > > void WebInspectorFrontendClient::updateWindowTitle() > { >- String title = makeString("Web Inspector ", static_cast<UChar>(0x2014), ' ', m_inspectedURL); >+ String title = makeString("Web Inspector ", static_cast<UChar>(0x2014), ' '_ch, m_inspectedURL); > ::SetWindowText(m_frontendHwnd, title.charactersWithNullTermination().data()); > } > >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 2842d800182ad71f6aa1308e45e47a6cb82481e3..7df7f96e94e1cdcaf1e18ced63de097f126d829a 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,12 @@ >+2019-01-03 Charlie Turner <cturner@igalia.com> >+ >+ Create a different syntax for incorporating single characters in makeString >+ https://bugs.webkit.org/show_bug.cgi?id=193101 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Tests/WTF/StringConcatenate.cpp: >+ > 2018-12-27 Alex Christensen <achristensen@webkit.org> > > Resurrect Mac CMake build >diff --git a/Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp b/Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp >index 388b30e3086fc3e1a58b9dc1f9a24494e7aaa5dd..b61239094aa6bf17a03d1d8a769d9e20b0b1e662 100644 >--- a/Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp >+++ b/Tools/TestWebKitAPI/Tests/WTF/StringConcatenate.cpp >@@ -81,11 +81,8 @@ TEST(WTF, StringConcatenate_Unsigned) > EXPECT_EQ("hello 0 world", makeString("hello ", 0u , " world")); > > EXPECT_EQ("hello 42 world", makeString("hello ", static_cast<unsigned char>(42) , " world")); >-#if PLATFORM(WIN) > EXPECT_EQ("hello 42 world", makeString("hello ", static_cast<unsigned short>(42) , " world")); >-#else >- EXPECT_EQ("hello * world", makeString("hello ", static_cast<unsigned short>(42) , " world")); // Treated as a character. >-#endif >+ EXPECT_EQ("hello * world", makeString("hello ", '*'_ch , " world")); > EXPECT_EQ("hello 4 world", makeString("hello ", sizeof(int) , " world")); // size_t > EXPECT_EQ("hello 4 world", makeString("hello ", offsetof(S, i) , " world")); // size_t > EXPECT_EQ("hello 3235839742 world", makeString("hello ", static_cast<size_t>(0xc0defefe), " world")); >diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp >index 6d4dffb49656524c64d962e79fe238384c69c0c6..62490106c0dabca01efb60521b94ec6faa268227 100644 >--- a/Tools/WebKitTestRunner/TestController.cpp >+++ b/Tools/WebKitTestRunner/TestController.cpp >@@ -451,7 +451,7 @@ WKRetainPtr<WKContextConfigurationRef> TestController::generateContextConfigurat > if (const char* dumpRenderTreeTemp = libraryPathForTesting()) { > String temporaryFolder = String::fromUTF8(dumpRenderTreeTemp); > >- const char separator = '/'; >+ auto separator = '/'_ch; > > WKContextConfigurationSetApplicationCacheDirectory(configuration.get(), toWK(temporaryFolder + separator + "ApplicationCache").get()); > WKContextConfigurationSetDiskCacheDirectory(configuration.get(), toWK(temporaryFolder + separator + "Cache").get()); >@@ -2668,7 +2668,7 @@ WKContextRef TestController::platformAdjustContext(WKContextRef context, WKConte > > if (const char* dumpRenderTreeTemp = libraryPathForTesting()) { > String temporaryFolder = String::fromUTF8(dumpRenderTreeTemp); >- const char separator = '/'; >+ auto separator = '/'_ch; > > WKWebsiteDataStoreSetServiceWorkerRegistrationDirectory(dataStore, toWK(temporaryFolder + separator + "ServiceWorkers").get()); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193101
:
358249
|
358250
|
358255
|
358264
|
358269
|
359008
|
359010