WebPasteboardProxy::getPasteboardStringsForType() and WebPasteboardProxy::readURLFromPasteboard() should check return value of SharedMemory::createHandle(). <rdar://problem/60103950>
Created attachment 397525 [details] Patch v1
Comment on attachment 397525 [details] Patch v1 This code is only used on Apple platforms, so adding cq+ and ignoring build errors on GTK and WPE ports.
Committed r260689: <https://trac.webkit.org/changeset/260689> All reviewed patches have been landed. Closing bug and clearing flags on attachment 397525 [details].
Are we going to add WARN_UNUSED_RETURN to createHandle?
(In reply to Darin Adler from comment #4) > Are we going to add WARN_UNUSED_RETURN to createHandle? Yes, after we fix all the individual issues. Tracked by <rdar://problem/62274167>.
Great!
Re-opened since this is blocked by bug 211542
Created attachment 407698 [details] Patch
Thanks for the review Wenson. Going to wait for EWS before I cq+.
Comment on attachment 407698 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407698&action=review > Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:217 > - sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly); > + if (!sharedMemoryBuffer->createHandle(handle, SharedMemory::Protection::ReadOnly)) > + return completionHandler({ }); To find all places where this return value should be changed (and to prevent this from being re-introduced), change this in Source/WebKit/Platform/SharedMemory.h: bool createHandle(Handle&, Protection); To this: WARN_UNUSED_RETURN bool createHandle(Handle&, Protection); Then fix all the warnings. (Not necessary to do for this patch.)
Comment on attachment 407698 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=407698&action=review >> Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:217 >> + return completionHandler({ }); > > To find all places where this return value should be changed (and to prevent this from being re-introduced), change this in Source/WebKit/Platform/SharedMemory.h: > > bool createHandle(Handle&, Protection); > > To this: > > WARN_UNUSED_RETURN bool createHandle(Handle&, Protection); > > Then fix all the warnings. (Not necessary to do for this patch.) Aaaaaand...I should have read the comments first. :)
(In reply to David Kilzer (:ddkilzer) from comment #11) > Comment on attachment 407698 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=407698&action=review > > >> Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:217 > >> + return completionHandler({ }); > > > > To find all places where this return value should be changed (and to prevent this from being re-introduced), change this in Source/WebKit/Platform/SharedMemory.h: > > > > bool createHandle(Handle&, Protection); > > > > To this: > > > > WARN_UNUSED_RETURN bool createHandle(Handle&, Protection); > > > > Then fix all the warnings. (Not necessary to do for this patch.) > > Aaaaaand...I should have read the comments first. :) It's a good reminder! I can tackle that next.
Committed r266416: <https://trac.webkit.org/changeset/266416> All reviewed patches have been landed. Closing bug and clearing flags on attachment 407698 [details].