We see: Source/WebKitLegacy/mac/WebView/WebHTMLView.mm https://github.com/WebKit/WebKit/blob/f0427c65db487c75295c5bd757777cb5d9049030/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm#L3544-L3547 ``` if (auto* image = hitTestResult.image()) { if (RefPtr<WebCore::FragmentedSharedBuffer> buffer = image->data()) [items addObject:adoptNS([[NSImage alloc] initWithData:[NSData dataWithBytes:buffer->makeContiguous()->data() length:buffer->size()]]).get()]; } ``` we can create a NSData from the SharedBuffer directly, removing the need for the memory allocation and copy.
<rdar://problem/89064893>
Created attachment 452300 [details] Patch
Committed r290082 (247438@main): <https://commits.webkit.org/247438@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 452300 [details].