Bug 176046 - [Mac] Upstream WKSetMetadataURL() from WebKitSystemInterface
Summary: [Mac] Upstream WKSetMetadataURL() from WebKitSystemInterface
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: 2017-08-28 22:40 PDT by Andy Estes
Modified: 2017-08-31 09:32 PDT (History)
9 users (show)

See Also:


Attachments
Patch (18.94 KB, patch)
2017-08-28 22:43 PDT, 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 2017-08-28 22:40:15 PDT
[Mac] Upstream WKSetMetadataURL() from WebKitSystemInterface
Comment 1 Andy Estes 2017-08-28 22:43:06 PDT
Created attachment 319246 [details]
Patch
Comment 2 WebKit Commit Bot 2017-08-29 02:10:56 PDT
Comment on attachment 319246 [details]
Patch

Clearing flags on attachment: 319246

Committed r221291: <http://trac.webkit.org/changeset/221291>
Comment 3 WebKit Commit Bot 2017-08-29 02:10:57 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Radar WebKit Bug Importer 2017-08-29 02:12:03 PDT
<rdar://problem/34128954>
Comment 5 Darin Adler 2017-08-29 17:44:50 PDT
Do we need to do something to avoid exiting the process while this write operation is still in progress?
Comment 6 Andy Estes 2017-08-29 21:37:05 PDT
(In reply to Darin Adler from comment #5)
> Do we need to do something to avoid exiting the process while this write
> operation is still in progress?

That's a good question. Are you concerned about the app terminating before the block executes on the global concurrent queue, or sudden termination while the block is executing?

For the former case, failing to add "Where From" metadata seems acceptable.

In the latter case, we could use a SuddenTerminationDisabler to ensure the MDItem operation completes.
Comment 7 Darin Adler 2017-08-31 09:32:31 PDT
(In reply to Andy Estes from comment #6)
> That's a good question. Are you concerned about the app terminating before
> the block executes on the global concurrent queue, or sudden termination
> while the block is executing?

On Mac and iOS, I’m concerned both about cases where someone explicitly chooses the Quit command and about the case where sudden termination takes effect.

There’s also the separate related issue of abnormal terminations like crashes, jetsams, reboots.

Given that we are taking about the file system, we should briefly consider all these cases, and what gets left behind.

> For the former case, failing to add "Where From" metadata seems acceptable.

I am not sure that’s great. If it’s just a normal Quit command I would like to see the quit take slightly longer so the metadata gets attached. I see this metadata as a continuation of the downloading process and I would like it to be treated similarly to the rest of that process.

There are some techniques where finishing the job looks to the user like the app is still running; looks like a "hang during the quit process". Others where the job is finished but to the user it looks like the app has already quit; roughly speaking “a daemon finishes the job”.

> In the latter case, we could use a SuddenTerminationDisabler to ensure the
> MDItem operation completes.

Sounds like a good idea. Would be nice to figure out what level of the software is responsible for tying this in with the rest of the I/O to create the file and write out its contents so the whole thing works smoothly and consistently.