Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2830ec003bed1b2bd596d3e2c5d337ee49813112
https://github.com/WebKit/WebKit/commit/2830ec003bed1b2bd596d3e2c5d337ee49813112
Author: Kimmo Kinnunen <[email protected]>
Date: 2025-12-16 (Tue, 16 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
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
A Tools/TestWebKitAPI/Tests/IPC/TransferStringObjCTests.mm
A Tools/TestWebKitAPI/Tests/IPC/TransferStringTests.cpp
M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewEvaluateJavaScript.mm
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.
Reland:
Original reverted in 304433@main.
Relanding with null-checking added for cases where client calls
-[WKWebView _evaluateJavaScript:...] with
NSString *javaScriptString == nil.
Add a test that evaluating @"" and nil behaves the same, similar to
before this patch.
* 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/304521@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications