Bug 183489 - [Mac] WebKit fails to receive file promises when the embedding app is sandboxed
Summary: [Mac] WebKit fails to receive file promises when the embedding app is sandboxed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andy Estes
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-03-08 17:32 PST by Andy Estes
Modified: 2018-03-12 09:35 PDT (History)
12 users (show)

See Also:


Attachments
Patch (4.06 KB, patch)
2018-03-08 17:36 PST, Andy Estes
ews-watchlist: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-sierra (2.61 MB, application/zip)
2018-03-08 18:37 PST, EWS Watchlist
no flags Details
Archive of layout-test-results from ews114 for mac-sierra (2.93 MB, application/zip)
2018-03-08 19:13 PST, EWS Watchlist
no flags Details
Patch (9.85 KB, patch)
2018-03-08 21:25 PST, Andy Estes
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.