You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 29a96fa
Browse filesBrowse the repository at this point in the historyBrowse files
Make CString's literal, buffer and mutable accessors reachable only through CStringWithEncoding
https://bugs.webkit.org/show_bug.cgi?id=324791
Reviewed by Darin Adler.
CString(ASCIILiteral), CString(CStringBuffer*), mutableSpan(),
mutableSpanIncludingNullTerminator() and grow() each either put bytes into a
CString or hand out a buffer to put them into, and the encoding-erased base has
no way to say what encoding those bytes are in. They become protected, joining
newUninitialized(). CString(const std::string&) is deleted: it had no callers,
and dropping it removes the implicit std::string conversion.
ASCIILiteral converts to const char*, but CString(ASCIILiteral) is the better
match, so overload resolution still selects it and the access check then rejects
the call: a literal is refused outright rather than quietly losing its length,
and any embedded null, to a strlen. A std::string does still convert to a span,
so there only the implicit conversion goes away. A FIXME marks the two remaining
raw-byte constructors.
JIT::compileTimeStats() keys its map with ASCII stat names, so it and its jsc.cpp
consumer are typed ASCIICString, whose data() is the const char* printf wants.
FormData::create() takes a UTF8CString, which is what its callers already hold;
PingLoader builds its body from a byte span instead of allocating a CString.
extractAXLogArg()'s fallback is constrained on derived_from rather than same_as,
so an already-typed UTF8CString reaches the const char* overload instead of being
passed to WTFLogAlways as a class type.
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
* Source/JavaScriptCore/jit/JIT.cpp:
(JSC::JIT::compileTimeStats):
* Source/JavaScriptCore/jit/JIT.h:
* Source/JavaScriptCore/jsc.cpp:
(runJSC):
* Source/WTF/wtf/text/CString.h:
(WTF::CString::CString):
* Source/WebCore/accessibility/AXLogger.h:
(WebCore::convertAXLogArg):
(WebCore::extractAXLogArg):
* Source/WebCore/loader/PingLoader.cpp:
(WebCore::PingLoader::sendPing):
* Source/WebCore/platform/network/FormData.cpp:
(WebCore::FormData::create):
* Source/WebCore/platform/network/FormData.h:
* Source/WebCore/testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstanceSession::requestLicense):
(WebCore::MockCDMInstanceSession::loadSession):
(WebCore::MockCDMInstanceSession::removeSessionData):
* Tools/TestWebKitAPI/Tests/WTF/CString.cpp:
(TEST(WTF, CStringCopyOnWrite)):
(TEST(WTF, CStringStdStringInterop)):
(TEST(WTF, CStringViewASCIICaseConversions)):
(requires):
* Tools/TestWebKitAPI/Tests/WTF/SynchronizedFixedQueue.cpp:
(TestWebKitAPI::textItem):
(TestWebKitAPI::toUpper):
(TestWebKitAPI::ToUpperConverter::ToUpperConverter):
(TestWebKitAPI::ToUpperConverter::startProducing):
(TestWebKitAPI::ToUpperConverter::startConsuming):
(TestWebKitAPI::ToUpperConverter::enqueueLower):
(TestWebKitAPI::TEST(WTF_SynchronizedFixedQueue, ProduceOnly)):
(TestWebKitAPI::TEST(WTF_SynchronizedFixedQueue, Limits)):
Canonical link: https://commits.webkit.org/321673@main
0 commit comments