Make MHTML save cancellable |
||||
Issue descriptionA lot of our main issues are caused by the save operation not being cancellable. Related to a bunch of TODOs
,
Mar 24 2017
,
Mar 29 2017
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.
,
Mar 31 2017
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.
,
Apr 1 2017
This bug has unclear initial description - what exactly are the main issues?
,
Apr 4 2017
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.
,
Apr 4 2017
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.
,
Apr 22 2017
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).
,
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
,
May 2 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2915191f0a64f34fcdf8c4e4a0a5d89b2271d816 commit 2915191f0a64f34fcdf8c4e4a0a5d89b2271d816 Author: petewil <petewil@chromium.org> Date: Tue May 02 00:51:09 2017 If MHTML saving is cancelled, delete the page afterwards. BUG= 705097 Review-Url: https://codereview.chromium.org/2850943002 Cr-Commit-Position: refs/heads/master@{#468515} [modify] https://crrev.com/2915191f0a64f34fcdf8c4e4a0a5d89b2271d816/chrome/browser/android/offline_pages/background_loader_offliner.cc [modify] https://crrev.com/2915191f0a64f34fcdf8c4e4a0a5d89b2271d816/chrome/browser/android/offline_pages/background_loader_offliner.h [modify] https://crrev.com/2915191f0a64f34fcdf8c4e4a0a5d89b2271d816/chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc
,
May 2 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by chili@chromium.org
, Mar 24 2017