Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d087dce13acac618807110847add6fa1ffb6de2a
      
https://github.com/WebKit/WebKit/commit/d087dce13acac618807110847add6fa1ffb6de2a
  Author: Žan Doberšek <[email protected]>
  Date:   2023-01-16 (Mon, 16 Jan 2023)

  Changed paths:
    M Source/JavaScriptCore/inspector/InjectedScriptBase.cpp
    M Source/WTF/wtf/text/StringConcatenate.h
    M Source/WTF/wtf/text/StringOperators.h
    M Source/WTF/wtf/text/StringView.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
    M Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h

  Log Message:
  -----------
  Revert [258946@main] Improve StringTypeAdapter templates and handling
https://bugs.webkit.org/show_bug.cgi?id=250017

Unreviewed.

String literals are great, in theory, with the size of the string specified
right there in the type. But that size isn't a given, i.e. the literal can have
an escaped null character positioned inside the string, not necessarily at the
end. One way this is exhibited is by fixed-length arrays that serve as buffers
for character data, which is what's causing misconstruction of the user agent
string on Unix, in UserAgentGLib.cpp.

This could be somewhat softly validated in the relevant StringView constructor,
asserting that the result of strlen() (or an equivalent) equals the size value
integrated in the type.

The patch that's being reverted here will be updated to have these fixed-data
arrays treated as pointers of character type, effectively returning back to
enforcing strlen()-like computation of the string length.

* Source/JavaScriptCore/inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::makeCall):
(Inspector::InjectedScriptBase::makeAsyncCall):
* Source/WTF/wtf/text/StringConcatenate.h:
(WTF::are8Bit):
(WTF::stringTypeAdapterAccumulator):
(WTF::tryMakeStringImplFromAdaptersInternal):
(WTF::handleWithAdapters):
(WTF::tryMakeStringFromAdapters):
(WTF::tryMakeString):
(WTF::makeString):
(WTF::tryMakeAtomStringFromAdapters):
(WTF::tryMakeAtomString):
(WTF::makeAtomString):
* Source/WTF/wtf/text/StringOperators.h:
(WTF::StringAppend::is8Bit):
(WTF::StringAppend::writeTo):
(WTF::StringAppend::length):
(WTF::StringAppend::is8Bit const): Deleted.
(WTF::StringAppend::writeTo const): Deleted.
(WTF::StringAppend::length const): Deleted.
* Source/WTF/wtf/text/StringView.h:
(WTF::StringView::StringView):
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNodeProperties):
* Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h:

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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to