Bug 183489

Summary: [Mac] WebKit fails to receive file promises when the embedding app is sandboxed
Product: WebKit Reporter: Andy Estes <aestes>
Component: New BugsAssignee: Andy Estes <aestes>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, bfulgham, commit-queue, darin, dbates, enrica, ews-watchlist, rniwa, thorton, webkit-bug-importer, wenson_hsieh, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-watchlist: commit-queue-
Archive of layout-test-results from ews100 for mac-sierra
none
Archive of layout-test-results from ews114 for mac-sierra
none
Patch none

Description Andy Estes 2018-03-08 17:32:20 PST
[Mac] WebKit fails to receive file promises when the embedding app is sandboxed
Comment 1 Andy Estes 2018-03-08 17:33:10 PST
rdar://problem/38267517
Comment 2 Andy Estes 2018-03-08 17:36:53 PST Comment hidden (obsolete)
Comment 3 EWS Watchlist 2018-03-08 18:37:22 PST Comment hidden (obsolete)
Comment 4 EWS Watchlist 2018-03-08 18:37:23 PST Comment hidden (obsolete)
Comment 5 EWS Watchlist 2018-03-08 19:13:51 PST Comment hidden (obsolete)
Comment 6 EWS Watchlist 2018-03-08 19:13:53 PST Comment hidden (obsolete)
Comment 7 Andy Estes 2018-03-08 21:25:39 PST
Created attachment 335391 [details]
Patch
Comment 8 WebKit Commit Bot 2018-03-09 07:11:06 PST
Comment on attachment 335391 [details]
Patch

Clearing flags on attachment: 335391

Committed r229462: <https://trac.webkit.org/changeset/229462>
Comment 9 WebKit Commit Bot 2018-03-09 07:11:08 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Darin Adler 2018-03-10 17:29:08 PST
Comment on attachment 335391 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=335391&action=review

> Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:3742
>                  if (errorOrNil)
>                      return;

Seems that both dragData and fileNames might leak if we don’t eventually get all the files we expect; I don’t understand how the error handling works here. Also seems we have two identical copies of this code, here and in legacy WebKit, so I guess the code is pretty old. I think it could be factored more cleanly so the call to performDragOperation isn’t nested so deep inside both blocks and loops.
Comment 11 Andy Estes 2018-03-12 09:35:50 PDT
(In reply to Darin Adler from comment #10)
> Comment on attachment 335391 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=335391&action=review
> 
> > Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:3742
> >                  if (errorOrNil)
> >                      return;
> 
> Seems that both dragData and fileNames might leak if we don’t eventually get
> all the files we expect; I don’t understand how the error handling works
> here. Also seems we have two identical copies of this code, here and in
> legacy WebKit, so I guess the code is pretty old. I think it could be
> factored more cleanly so the call to performDragOperation isn’t nested so
> deep inside both blocks and loops.

I agree. I have an idea for how to clean this up and get rid of the manual memory management.