New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 705097 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Last visit 22 days ago
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug

Blocking:
issue 705107



Sign in to add a comment

Make MHTML save cancellable

Project Member Reported by chili@chromium.org, Mar 24 2017

Issue description

A lot of our main issues are caused by the save operation not being cancellable.

Related to a bunch of TODOs
 

Comment 1 by chili@chromium.org, Mar 24 2017

Labels: -Hotlist-Fixit
From pete: we should simply delete the saved page if we detect that we cancelled in the middle.

Comment 2 by chili@chromium.org, Mar 24 2017

Blocking: 705107

Comment 3 by dim...@chromium.org, Mar 29 2017

Owner: chili@chromium.org
Status: Assigned (was: Available)
Perhaps handling duplicate IDs could be another way to solve this. Once started, it's hard to cleanly and reliably prevent the save from happening.
To clarify a bit:  My suggestion is that we remember we got a cancel request while in the middle of saving a page, and then when the save page call returns, we should delete the archived page then.
This bug has unclear initial description - what exactly are the main issues?
Today if a user cancels an offlining request via a notification, and the downloading has completed, but the request is in the saving stage, the request to cancel is dropped, and the request is not actually canceled.  Since we can't actually stop the saving while it is in progress, we should remember that the user asked us to cancel, and when the saving to a MHTML file step is done, we should delete the file.
I see. Interesting that since save happens async and some parts are done on file thread, the cancelable save would have to do a very similar trick - try to cancel, then delete the file (and perhaps a DB record) if the cancel did not catch.
Note that we should be able to make changes to MHTMLGenerationManager and the saving call chain to allow for cancellations, especially as for now we are sending one IPC per frame to the renderer(s). I can help with context and ideas on how to do so.

If/when we move to one IPC per renderer (that may hold many frames) this cancellation will get trickier (require at least one more IPC tot he current renderer serializing its contents).

Comment 9 by chili@chromium.org, Apr 22 2017

I think short term solution should be we delete the page that was saved if cancel was called in the middle. In the background loading case, this will allow the request to save subsequently without running into ALREADY_EXISTS errors
Status: Fixed (was: Assigned)

Sign in to add a comment