Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 649a89a5f4628f38549bf2a18969873a5fe86eaf
https://github.com/WebKit/WebKit/commit/649a89a5f4628f38549bf2a18969873a5fe86eaf
Author: Gavin Phillips <[email protected]>
Date: 2026-01-17 (Sat, 17 Jan 2026)
Changed paths:
M Source/WebCore/platform/SharedMemory.h
M Source/WebCore/platform/android/SharedMemoryAndroid.cpp
M Source/WebCore/platform/cocoa/SharedMemoryCocoa.mm
M Source/WebCore/platform/graphics/ShareableBitmap.cpp
M Source/WebCore/platform/graphics/ShareableBitmap.h
M Source/WebCore/platform/unix/SharedMemoryUnix.cpp
M Source/WebCore/platform/win/SharedMemoryWin.cpp
M
Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp
M Tools/TestWebKitAPI/CMakeLists.txt
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
A Tools/TestWebKitAPI/Tests/WebCore/ShareableBitmap.cpp
M Tools/TestWebKitAPI/Tests/WebCore/SharedMemoryTests.cpp
Log Message:
-----------
Expose CopyOnWrite as part of SharedMemory object mappings
https://bugs.webkit.org/show_bug.cgi?id=304934
rdar://167545782
Reviewed by Simon Fraser.
Expose the ability to map using CopyOnWrite as part of our SharedMemory
implementation. This is then adopted for ShareableBitmap.
Note: This change supports Darwin platforms only. The CopyOnWrite behavior
for Windows & Unix differ when it comes to writes to the mapping, by the
originator, after the receiver requests a private/copy on write
mapping. On Darwin platforms, these changes are caught by CoW and are not
visible in the receiver. On Unix & Windows, these writes are visible by
the receiver.
* Source/WebCore/platform/SharedMemory.h:
* Source/WebCore/platform/android/SharedMemoryAndroid.cpp:
(WebCore::SharedMemory::map):
* Source/WebCore/platform/cocoa/SharedMemoryCocoa.mm:
(WebCore::SharedMemory::map):
* Source/WebCore/platform/graphics/ShareableBitmap.cpp:
(WebCore::ShareableBitmap::create):
(WebCore::ShareableBitmap::createReadOnly):
* Source/WebCore/platform/graphics/ShareableBitmap.h:
* Source/WebCore/platform/unix/SharedMemoryUnix.cpp:
(WebCore::SharedMemory::map):
* Source/WebCore/platform/win/SharedMemoryWin.cpp:
(WebCore::SharedMemory::map):
* Source/WebKit/WebProcess/GPU/graphics/ImageBufferShareableBitmapBackend.cpp:
(WebKit::ImageBufferShareableBitmapBackend::create):
* Tools/TestWebKitAPI/CMakeLists.txt:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebCore/ShareableBitmap.cpp: Added.
(TestWebKitAPI::fillTestPattern):
(TestWebKitAPI::expectTestPattern):
(TestWebKitAPI::TEST(ShareableBitmap, ensureCOWBothMapsRWSenderWrite)):
(TestWebKitAPI::TEST(ShareableBitmap,
ensureCOWBothMapsRWSenderWriteReceiverWrite)):
(TestWebKitAPI::TEST(ShareableBitmap, ensureCOWBothMapsROSenderWrite)):
* Tools/TestWebKitAPI/Tests/WebCore/SharedMemoryTests.cpp:
(TestWebKitAPI::TEST_P):
Canonical link: https://commits.webkit.org/305762@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications