Add a String literal that returns a String
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2018 18:51:59 +0000 (18:51 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Nov 2018 18:51:59 +0000 (18:51 +0000)
commit57bc2e66a402c83422e337d36436ea9b32977d71
treedb518002e7811f6c7d674c87aa197fed5a80534d
parenta390c0cfb01f5ed4a20d5273eb543c4e6630a414
Add a String literal that returns a String
https://bugs.webkit.org/show_bug.cgi?id=191425
<rdar://problem/45914556>

Reviewed by Sam Weinig.

Source/WebCore:

Use _str where possible.

API Test in WPT.

* Modules/fetch/FetchRequest.cpp:
(WebCore::computeReferrer):
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::loggingString):
* Modules/webdatabase/OriginLock.cpp:
(WebCore::OriginLock::lockFileNameForPath):
* css/CSSBasicShapes.cpp:
(WebCore::updateCornerRadiusWidthAndHeight):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getParameter):
* loader/LinkHeader.cpp:
(WebCore::parseParameterValue):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::platform):
* platform/DateComponents.cpp:
(WebCore::DateComponents::toString const):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyIdentifierForKeyEvent):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::suffix const):
* rendering/RenderMenuList.cpp:
(RenderMenuList::setText):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::userInterfaceDirectionPolicy):
(WebCore::InternalSettings::systemLayoutDirection):
* testing/Internals.cpp:
(WebCore::Internals::shadowRootType const):
(WebCore::Internals::getCurrentCursorInfo):

Source/WTF:

Add a new String literal, _str, that will return a String type.
This is useful when ""_s won't work, such as for things that
don't take an ASCIILiteral directly e.g. ExceptionOr<String>
or Variants.

* wtf/text/WTFString.h:
(WTF::StringLiterals::operator _str): Added.

Tools:

Test _str.

* TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237990 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/text/WTFString.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/fetch/FetchRequest.cpp
Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp
Source/WebCore/Modules/webdatabase/OriginLock.cpp
Source/WebCore/css/CSSBasicShapes.cpp
Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Source/WebCore/loader/LinkHeader.cpp
Source/WebCore/loader/LinkLoader.cpp
Source/WebCore/page/NavigatorBase.cpp
Source/WebCore/platform/DateComponents.cpp
Source/WebCore/platform/mac/PlatformEventFactoryMac.mm
Source/WebCore/rendering/RenderListMarker.cpp
Source/WebCore/rendering/RenderMenuList.cpp
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/Internals.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp