Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 51cc3ec2d8f317616c72419425b37e8818625d2b
      
https://github.com/WebKit/WebKit/commit/51cc3ec2d8f317616c72419425b37e8818625d2b
  Author: Kimmo Kinnunen <[email protected]>
  Date:   2025-12-04 (Thu, 04 Dec 2025)

  Changed paths:
    M LayoutTests/ipc/serialized-type-info.html
    M Source/JavaScriptCore/API/JSStringRefCF.cpp
    M Source/WTF/wtf/cf/VectorCF.h
    M Source/WTF/wtf/text/StringView.h
    M Source/WTF/wtf/text/cf/AtomStringImplCF.cpp
    M Source/WTF/wtf/text/cf/StringCF.cpp
    M Source/WTF/wtf/text/cf/StringConcatenateCF.h
    M Source/WebKit/CMakeLists.txt
    M Source/WebKit/DerivedSources-input.xcfilelist
    M Source/WebKit/DerivedSources.make
    A Source/WebKit/Platform/IPC/TransferString.cpp
    A Source/WebKit/Platform/IPC/TransferString.h
    A Source/WebKit/Platform/IPC/TransferString.serialization.in
    M Source/WebKit/Platform/Sources.txt
    M Source/WebKit/Scripts/webkit/opaque_ipc_types.tracking.in
    M Source/WebKit/Shared/RunJavaScriptParameters.h
    A Source/WebKit/Shared/RunJavaScriptParameters.serialization.in
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/UIProcess/API/C/WKPage.cpp
    M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
    M Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp
    M 
Source/WebKit/UIProcess/Inspector/socket/RemoteInspectorProtocolHandler.cpp
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp

  Log Message:
  -----------
  Add possibility to use large strings in WebPage::runJavaScript without copies
https://bugs.webkit.org/show_bug.cgi?id=303295
rdar://165603388

Reviewed by Ben Nham.

Add IPC::TransferString to support explicit serialization of large
strings. In subsequent patches, this will be used to pass large JS
strings as memory that is shared between multiple WebContent processes.

Avoids extra NSString * -> wtf::String copy that was done only to
send the string via IPC.

To be conservative, the feature is added as explicit TransferString
instead of being built-in to IPC string serialization. If the feature
turns out to be non-problematic and receive-side API issues are solved,
it may be merged as the default String serialization.

* Source/JavaScriptCore/API/JSStringRefCF.cpp:
(JSStringCreateWithCFString):
* Source/WTF/wtf/cf/VectorCF.h:
(WTF::CFStringGetLatin1CStringSpan):
(WTF::CFStringGetCharactersSpan):
(WTF::CFStringCopyCharactersSpan):
* Source/WTF/wtf/text/StringView.h:
(WTF::StringView::sizeInBytes const):
* Source/WTF/wtf/text/cf/AtomStringImplCF.cpp:
(WTF::AtomStringImpl::add):
* Source/WTF/wtf/text/cf/StringCF.cpp:
(WTF::String::String):
* Source/WTF/wtf/text/cf/StringConcatenateCF.h:
(WTF::StringTypeAdapter<CFStringRef>::writeTo<char16_t> const):
* Source/WebKit/DerivedSources-input.xcfilelist:
* Source/WebKit/DerivedSources.make:
* Source/WebKit/Platform/Sources.txt:
* Source/WebKit/Scripts/webkit/opaque_ipc_types.tracking.in:
* Source/WebKit/Shared/RunJavaScriptParameters.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/UIProcess/API/C/WKPage.cpp:
(WKPageEvaluateJavaScriptInFrame):
(callAsyncJavaScript):
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(unknownError):
(-[WKWebView 
_evaluateJavaScript:asAsyncFunction:withSourceURL:withArguments:forceUserGesture:inFrame:inWorld:completionHandler:]):
* Source/WebKit/UIProcess/Inspector/socket/RemoteInspectorProtocolHandler.cpp:
(WebKit::RemoteInspectorProtocolHandler::runScript):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::runJavaScript):

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



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

Reply via email to