Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Issue 2731293004: Move the writing of the MHTML footer to the browser process. (Closed)

Created:
3 years, 9 months ago by carlosk
Modified:
3 years, 9 months ago
Reviewers:
tkent, jam, nasko, dcheng
CC:
asanka, blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, dcheng, dglazkov+blink, jam, kinuko+watch, Ɓukasz Anforowicz, markusheintz_, mlamouri+watch-blink_chromium.org, mlamouri+watch-content_chromium.org, msramek+watch_chromium.org, nasko+codewatch_chromium.org, Pete Williamson, raymes+watch_chromium.org, jochen (gone - plz use gerrit)
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move the writing of the MHTML footer to the browser process. This change moves the MHTML generation step of writing the footer from the renderer process to the browser process. Even though this spreads MHTML code knowledge between Blink and content (a drawback) it does make the generation process more robust and allows MHTML save operations to become more robust to DOM changes. The main issue we are facing with the Offline efforts is that frames can be deleted after a MHTML save operation started and that will likely cause it to fail completely. With this modification we can allow these operations to optionally ignore missing frames. I chose to still keep the footer code generation in MHTMLArchive but make it explicit it is only used for testing purposes now. It seemed more consistent and understandable for those tests to keep on generating and reading fully valid MHTML files. BUG=672292 TBR=jam@chromium.org Review-Url: https://codereview.chromium.org/2731293004 Cr-Commit-Position: refs/heads/master@{#455935} Committed: https://chromium.googlesource.com/chromium/src/+/7ae9f6fc18857892d7ffc3d5d3203720dd198c9f

Patch Set 1 #

Total comments: 11

Patch Set 2 : Comments and naming changes. #

Total comments: 15

Patch Set 3 : More minor changes #

Patch Set 4 : More minor changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+91 lines, -66 lines) Patch
M chrome/browser/content_settings/content_settings_browsertest.cc View 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/download/mhtml_generation_manager.h View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/download/mhtml_generation_manager.cc View 1 2 3 11 chunks +75 lines, -28 lines 0 comments Download
M content/common/frame_messages.h View 1 chunk +0 lines, -3 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 chunk +2 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/platform/mhtml/MHTMLArchive.h View 1 3 chunks +7 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/web/WebFrameSerializer.cpp View 1 chunk +0 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/web/tests/MHTMLTest.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/public/web/WebFrameSerializer.h View 1 chunk +0 lines, -8 lines 0 comments Download

Messages

Total messages: 32 (12 generated)
carlosk
tkent@: PTAL at Blink changes. nasko@: PTAL at content and IPC changes. lukasza@, petewil@: FYI. ...
3 years, 9 months ago (2017-03-06 23:10:49 UTC) #4
jochen (gone - plz use gerrit)
adding the folks you asked to review the CL :)
3 years, 9 months ago (2017-03-07 11:51:47 UTC) #8
carlosk
On 2017/03/07 11:51:47, jochen wrote: > adding the folks you asked to review the CL ...
3 years, 9 months ago (2017-03-07 18:55:27 UTC) #9
tkent
third_party/WebKit lgtm
3 years, 9 months ago (2017-03-07 23:03:18 UTC) #10
nasko
Mostly small things. https://codereview.chromium.org/2731293004/diff/1/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/2731293004/diff/1/content/browser/download/mhtml_generation_manager.cc#newcode96 content/browser/download/mhtml_generation_manager.cc:96: // The exact same boundary marker ...
3 years, 9 months ago (2017-03-08 19:29:25 UTC) #11
carlosk
Thanks! https://codereview.chromium.org/2731293004/diff/1/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/2731293004/diff/1/content/browser/download/mhtml_generation_manager.cc#newcode96 content/browser/download/mhtml_generation_manager.cc:96: // The exact same boundary marker must to ...
3 years, 9 months ago (2017-03-08 21:45:54 UTC) #12
nasko
LGTM with a nit. https://codereview.chromium.org/2731293004/diff/1/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/2731293004/diff/1/content/browser/download/mhtml_generation_manager.cc#newcode276 content/browser/download/mhtml_generation_manager.cc:276: observed_renderer_process_host_.RemoveAll(); On 2017/03/08 21:45:54, carlosk ...
3 years, 9 months ago (2017-03-08 23:19:31 UTC) #13
carlosk
Thanks. dcheng@: PTAL. Also added jam@ for TBR. https://codereview.chromium.org/2731293004/diff/1/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/2731293004/diff/1/content/browser/download/mhtml_generation_manager.cc#newcode276 content/browser/download/mhtml_generation_manager.cc:276: observed_renderer_process_host_.RemoveAll(); ...
3 years, 9 months ago (2017-03-08 23:37:32 UTC) #16
dcheng
https://codereview.chromium.org/2731293004/diff/20001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/2731293004/diff/20001/content/browser/download/mhtml_generation_manager.cc#newcode81 content/browser/download/mhtml_generation_manager.cc:81: base::Callback<void(std::tuple<MhtmlSaveStatus, int64_t>)> callback, Pass by const ref. Also, I'm ...
3 years, 9 months ago (2017-03-09 01:56:51 UTC) #17
jam
lgtm
3 years, 9 months ago (2017-03-09 16:44:08 UTC) #18
carlosk
Thanks! https://codereview.chromium.org/2731293004/diff/20001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/2731293004/diff/20001/content/browser/download/mhtml_generation_manager.cc#newcode81 content/browser/download/mhtml_generation_manager.cc:81: base::Callback<void(std::tuple<MhtmlSaveStatus, int64_t>)> callback, On 2017/03/09 01:56:51, dcheng wrote: ...
3 years, 9 months ago (2017-03-09 22:03:36 UTC) #19
dcheng
https://codereview.chromium.org/2731293004/diff/20001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/2731293004/diff/20001/content/browser/download/mhtml_generation_manager.cc#newcode102 content/browser/download/mhtml_generation_manager.cc:102: std::string boundary, On 2017/03/09 22:03:36, carlosk wrote: > On ...
3 years, 9 months ago (2017-03-09 22:08:46 UTC) #20
carlosk
https://codereview.chromium.org/2731293004/diff/20001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/2731293004/diff/20001/content/browser/download/mhtml_generation_manager.cc#newcode102 content/browser/download/mhtml_generation_manager.cc:102: std::string boundary, On 2017/03/09 22:08:46, dcheng wrote: > On ...
3 years, 9 months ago (2017-03-09 23:07:30 UTC) #21
dcheng
https://codereview.chromium.org/2731293004/diff/20001/third_party/WebKit/public/web/WebFrameSerializer.h File third_party/WebKit/public/web/WebFrameSerializer.h (left): https://codereview.chromium.org/2731293004/diff/20001/third_party/WebKit/public/web/WebFrameSerializer.h#oldcode104 third_party/WebKit/public/web/WebFrameSerializer.h:104: const WebString& boundary); On 2017/03/09 23:07:29, carlosk wrote: > ...
3 years, 9 months ago (2017-03-09 23:09:17 UTC) #22
carlosk
https://codereview.chromium.org/2731293004/diff/20001/third_party/WebKit/public/web/WebFrameSerializer.h File third_party/WebKit/public/web/WebFrameSerializer.h (left): https://codereview.chromium.org/2731293004/diff/20001/third_party/WebKit/public/web/WebFrameSerializer.h#oldcode104 third_party/WebKit/public/web/WebFrameSerializer.h:104: const WebString& boundary); On 2017/03/09 23:09:17, dcheng wrote: > ...
3 years, 9 months ago (2017-03-09 23:13:45 UTC) #23
dcheng
LGTM https://codereview.chromium.org/2731293004/diff/20001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/2731293004/diff/20001/content/browser/download/mhtml_generation_manager.cc#newcode81 content/browser/download/mhtml_generation_manager.cc:81: base::Callback<void(std::tuple<MhtmlSaveStatus, int64_t>)> callback, On 2017/03/09 22:03:35, carlosk wrote: ...
3 years, 9 months ago (2017-03-09 23:16:58 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2731293004/60001
3 years, 9 months ago (2017-03-09 23:21:16 UTC) #27
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/7ae9f6fc18857892d7ffc3d5d3203720dd198c9f
3 years, 9 months ago (2017-03-10 01:00:33 UTC) #30
RE66
On 2017/03/10 01:00:33, commit-bot: I haz the power wrote: > Committed patchset #4 (id:60001) as ...
3 years, 9 months ago (2017-03-10 11:36:02 UTC) #31
carlosk
3 years, 9 months ago (2017-03-10 19:01:55 UTC) #32
Message was sent while issue was closed.
On 2017/03/10 11:36:02, RE66 wrote:
> On 2017/03/10 01:00:33, commit-bot: I haz the power wrote:
> > Committed patchset #4 (id:60001) as
> >
>
https://chromium.googlesource.com/chromium/src/+/7ae9f6fc18857892d7ffc3d5d320...
> 
> bad solution:
> It better to have lock on frames to avoid deletion while 
>  MHTML save operation is running
> 
> misuse of process isoltion

Hi Ron.

In this case we don't want to lock the frame tree/DOM because:
a) this would cause a user-facing effect due to a potentially non user-requested
actions.
b) the saving can take a long time (median at 200ms but 90th-percentile is
already above 1s).

Could you elaborate on the misuse you mentioned?

Powered by Google App Engine
This is Rietveld 408576698