Bug 180795

Summary: Use BlockPtrs and lambdas instead of new/delete to pass parameters to blocks in WebViewImpl::performDragOperation
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: REOPENED    
Severity: Normal CC: aestes, bfulgham, commit-queue, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 183152    
Bug Blocks:    
Attachments:
Description Flags
Patch bfulgham: review+

Alex Christensen
Reported 2017-12-13 19:07:41 PST
Use BlockPtrs and lambdas instead of new/delete to pass parameters to blocks in WebViewImpl::performDragOperation
Attachments
Patch (6.38 KB, patch)
2017-12-13 19:08 PST, Alex Christensen
bfulgham: review+
Alex Christensen
Comment 1 2017-12-13 19:08:01 PST
Brent Fulgham
Comment 2 2017-12-28 14:05:34 PST
Comment on attachment 329311 [details] Patch Nice! r=me.
Alex Christensen
Comment 3 2018-01-02 12:03:02 PST
Radar WebKit Bug Importer
Comment 4 2018-01-02 12:57:55 PST
Andy Estes
Comment 5 2018-02-24 20:10:30 PST
Comment on attachment 329311 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=329311&action=review > Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:3723 > + [item receivePromisedFilesAtDestination:dropLocation.get() options:options operationQueue:queue.get() reader:BlockPtr<void(NSURL *, NSError *)>::fromCallable([this, fileNames = WTFMove(fileNames), fileCount, dragData = WTFMove(dragData), pasteboardName](NSURL * _Nonnull fileURL, NSError * _Nullable errorOrNil) mutable { You can't move fileNames here. The outer lambda that captured fileNames is called multiple times by -enumerateDraggingItems..., and you'll end up moving from the same variable multiple times, which is illegal. > Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:3729 > + if (fileNames.size() == fileCount) { Because of how fileNames is being moved, this condition will never be true if fileCount is greater than 1.
WebKit Commit Bot
Comment 6 2018-02-26 15:18:55 PST
Re-opened since this is blocked by bug 183152
Note You need to log in before you can comment on or make changes to this bug.