Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4cd0b19673f3acab0f0193cd46cb6a69ac3de7a7
      
https://github.com/WebKit/WebKit/commit/4cd0b19673f3acab0f0193cd46cb6a69ac3de7a7
  Author: Chris Dumez <[email protected]>
  Date:   2026-09-28 (Mon, 28 Sep 2026)

  Changed paths:
    M Source/WTF/wtf/text/CString.h
    M Source/WTF/wtf/text/StringView.h
    M Tools/TestWebKitAPI/Tests/WTF/CString.cpp

  Log Message:
  -----------
  Stop offering an untyped const char* from CStringBase
https://bugs.webkit.org/show_bug.cgi?id=325572

Reviewed by Yusuke Suzuki.

CStringBase does not know its encoding, but its public data() still handed out 
a const char*
for Latin-1 bytes as readily as for UTF-8 or ASCII. Every typed CString already 
hides it with
a data() that carries the encoding, so the only remaining callers were 
safePrintfType() and
the WTF API tests binding a const CStringBase&. Make it protected.

safePrintfType(const CStringBase&) uses spanIncludingNullTerminator() instead, 
so
printf-style formatting still accepts the encoding-erased base.

Also drop a stale FIXME on StringView::fromLatin1(): Latin1CString::span() 
already
returns the span<const Latin1Character> it takes.

* Source/WTF/wtf/text/CString.h:
(WTF::safePrintfType):
* Source/WTF/wtf/text/StringView.h:
* Tools/TestWebKitAPI/Tests/WTF/CString.cpp:
(TEST(WTF, CStringNullStringConstructor)):
(TEST(WTF, CStringLegacyCStringPointer)):
(requires):

Canonical link: https://commits.webkit.org/322129@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to