Title: [290082] trunk/Source/WebKitLegacy/mac
Revision
290082
Author
[email protected]
Date
2022-02-17 15:25:47 -0800 (Thu, 17 Feb 2022)

Log Message

Unnecessary copy/memory allocation
https://bugs.webkit.org/show_bug.cgi?id=236749
rdar://problem/89064893

Reviewed by Dean Jackson.

* WebView/WebHTMLView.mm:
(createShareMenuItem): Shared NSData constructed from a SharedBuffer instead

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (290081 => 290082)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2022-02-17 23:16:52 UTC (rev 290081)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2022-02-17 23:25:47 UTC (rev 290082)
@@ -1,5 +1,16 @@
 2022-02-17  Jean-Yves Avenard  <[email protected]>
 
+        Unnecessary copy/memory allocation
+        https://bugs.webkit.org/show_bug.cgi?id=236749
+        rdar://problem/89064893
+
+        Reviewed by Dean Jackson.
+
+        * WebView/WebHTMLView.mm:
+        (createShareMenuItem): Shared NSData constructed from a SharedBuffer instead
+
+2022-02-17  Jean-Yves Avenard  <[email protected]>
+
         CrashTracer: com.apple.WebKit.WebContent at _javascript_Core: bmalloc_allocate_impl_impl_slow
         https://bugs.webkit.org/show_bug.cgi?id=236695
         rdar://87596724

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm (290081 => 290082)


--- trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm	2022-02-17 23:16:52 UTC (rev 290081)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm	2022-02-17 23:25:47 UTC (rev 290082)
@@ -3542,8 +3542,8 @@
     }
 
     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()];
+        if (RefPtr<const WebCore::FragmentedSharedBuffer> buffer = image->data())
+            [items addObject:adoptNS([[NSImage alloc] initWithData:buffer->makeContiguous()->createNSData().get()]).get()];
     }
 
     if (!hitTestResult.selectedText().isEmpty()) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to