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

Issue 1386873003: OOPIFs: Transitioning MHTML generation from view-oriented to frame-oriented. (Closed)

Created:
5 years, 2 months ago by Łukasz Anforowicz
Modified:
5 years ago
CC:
asanka, benjhayden+dwatch_chromium.org, blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, dglazkov+blink, jam, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@mhtml-generation-mgr-cleanup
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

OOPIFs: Transitioning MHTML generation from view-oriented to frame-oriented. IPC Messages ============ This CL replaces the following view-oriented IPC messages: IPC_MESSAGE_ROUTED2(ViewMsg_SavePageAsMHTML, int /* job_id */, IPC::PlatformFileForTransit /* file handle */) IPC_MESSAGE_CONTROL2(ViewHostMsg_SavedPageAsMHTML, int /* job_id */, int64 /* size of the MHTML file, -1 if error */) with the following frame-oriented IPC messages: IPC_MESSAGE_ROUTED5(FrameMsg_SerializeAsMHTML, int /* job_id (used to match responses to requests) */, IPC::PlatformFileForTransit /* destination file */, std::string /* mhtml boundary marker */, FrameRoutingIdToContentIdMap, bool /* is last frame */) IPC_MESSAGE_ROUTED3(FrameHostMsg_SerializeAsMHTMLResponse, int /* job_id (used to match responses to requests) */, bool /* true if success, false if error */, std::string /* mhtml boundary marker that was used */) This allows MHTML generation to work, even when some frames are in separate processes. Supporting changes ================== This CL builds on top of recent CLs below: crrev.com/1436683002 - Making PageSerializer operate on single frames only. crrev.com/1441553002 - Generating CIDs in Blink during MHTML serialization. crrev.com/1415463007 - Exposing more granular methods from MHTMLArchive. crrev.com/1380963006 - MHTMLGenerator preparation for per-frame serialization. Handling of renderer IPC messages was moved from MHTMLGenerator into RenderFrameImpl. Handling of browser IPC responses was moved from RenderProcessHostImpl into RenderFrameHostImpl. MHTMLGenerationManager now handles walking over all the frames and asking the renderer process to serialize them into MHTML (sequentially - one frame at a time). MHTMLGenerationManager also handles generating ContentIDs for all frames. BUG=538766 Committed: https://crrev.com/70b79c8c617e3e73e4df9e7e548ff675a9886a6b Cr-Commit-Position: refs/heads/master@{#365082}

Patch Set 1 : #

Patch Set 2 : Still just a draft... #

Patch Set 3 : Still not ready... #

Patch Set 4 : Rebasing... #

Patch Set 5 : Rebasing... #

Patch Set 6 : Rebasing... #

Patch Set 7 : Rebasing... #

Patch Set 8 : Rebasing... #

Total comments: 7

Patch Set 9 : Addressed first part of CR feedback from Nick. #

Patch Set 10 : Moved MHTML boundary marker generation into the browser. #

Total comments: 17

Patch Set 11 : Addressed CR feedback from dcheng@. #

Total comments: 12

Patch Set 12 : Addressed 2nd round of CR feedback from dcheng@. #

Patch Set 13 : Removing remaining references to the removed generateMHTMLBoundary method. #

Patch Set 14 : Rebasing... #

Total comments: 24

Patch Set 15 : Addressed feedback from Randy. #

Patch Set 16 : Rebasing... #

Patch Set 17 : Removing base::File::FLAG_APPEND. #

Patch Set 18 : Moving "using" declaration under a singly-included section of frame_messges.h #

Unified diffs Side-by-side diffs Delta from patch set Stats (+386 lines, -265 lines) Patch
M chrome/browser/download/save_page_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +7 lines, -15 lines 0 comments Download
M content/browser/download/mhtml_generation_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -4 lines 0 comments Download
M content/browser/download/mhtml_generation_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 9 chunks +141 lines, -26 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +7 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +0 lines, -8 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +33 lines, -0 lines 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +0 lines, -11 lines 0 comments Download
M content/content_renderer.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +0 lines, -2 lines 0 comments Download
D content/renderer/mhtml_generator.h View 1 chunk +0 lines, -38 lines 0 comments Download
D content/renderer/mhtml_generator.cc View 1 chunk +0 lines, -63 lines 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +7 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +62 lines, -0 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +0 lines, -2 lines 0 comments Download
M content/renderer/web_frame_utils.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/web_frame_utils.cc View 1 2 3 2 chunks +14 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/mhtml/MHTMLArchive.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +3 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/web/WebPageSerializer.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +57 lines, -57 lines 0 comments Download
M third_party/WebKit/Source/web/tests/MHTMLTest.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/public/web/WebPageSerializer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +42 lines, -10 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 38 (15 generated)
Łukasz Anforowicz
nick@, could you please take a look?
5 years ago (2015-12-02 21:01:47 UTC) #3
ncarter (slow)
one possible simplification (which is optional), but looks good otherwise https://codereview.chromium.org/1386873003/diff/160001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/1386873003/diff/160001/content/browser/download/mhtml_generation_manager.cc#newcode102 ...
5 years ago (2015-12-04 22:54:48 UTC) #5
Łukasz Anforowicz
nick@, can you take another look please? https://codereview.chromium.org/1386873003/diff/160001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/1386873003/diff/160001/content/browser/download/mhtml_generation_manager.cc#newcode102 content/browser/download/mhtml_generation_manager.cc:102: base::Unretained(this))); // ...
5 years ago (2015-12-05 00:18:39 UTC) #6
ncarter (slow)
lgtm https://codereview.chromium.org/1386873003/diff/160001/content/common/frame_messages.h File content/common/frame_messages.h (right): https://codereview.chromium.org/1386873003/diff/160001/content/common/frame_messages.h#newcode731 content/common/frame_messages.h:731: // FrameHostMsg_SerializeAsMHTMLResponse. On 2015/12/05 00:18:39, Łukasz Anforowicz wrote: ...
5 years ago (2015-12-07 18:39:57 UTC) #7
Łukasz Anforowicz
dcheng@, could you please take a look? (this is probably lower priority that the CLs ...
5 years ago (2015-12-07 19:23:39 UTC) #9
dcheng
https://codereview.chromium.org/1386873003/diff/200001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/1386873003/diff/200001/content/browser/download/mhtml_generation_manager.cc#newcode109 content/browser/download/mhtml_generation_manager.cc:109: DCHECK(FrameTreeNode::GloballyFindByID(pending_frame_tree_node_ids_.front()) DCHECK_EQ works here https://codereview.chromium.org/1386873003/diff/200001/content/browser/download/mhtml_generation_manager.cc#newcode179 content/browser/download/mhtml_generation_manager.cc:179: content_id_builder << "<frame" ...
5 years ago (2015-12-08 06:22:27 UTC) #10
ncarter (slow)
https://codereview.chromium.org/1386873003/diff/200001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/1386873003/diff/200001/content/browser/download/mhtml_generation_manager.cc#newcode234 content/browser/download/mhtml_generation_manager.cc:234: ss << std::hex << static_cast<uint32_t>(random_values[i]); On 2015/12/08 06:22:27, dcheng ...
5 years ago (2015-12-08 19:31:01 UTC) #11
Łukasz Anforowicz
dcheng@, could you please take another look? Thanks for reviewing. https://codereview.chromium.org/1386873003/diff/200001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/1386873003/diff/200001/content/browser/download/mhtml_generation_manager.cc#newcode109 ...
5 years ago (2015-12-08 21:26:43 UTC) #12
dcheng
https://codereview.chromium.org/1386873003/diff/220001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/1386873003/diff/220001/content/browser/download/mhtml_generation_manager.cc#newcode45 content/browser/download/mhtml_generation_manager.cc:45: bool GotMoreFramesToProcess() { Nit: HasMoreFramesToProcess() const? Got sounds like ...
5 years ago (2015-12-09 08:02:37 UTC) #13
Łukasz Anforowicz
dcheng@, could you please take another look? https://codereview.chromium.org/1386873003/diff/220001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/1386873003/diff/220001/content/browser/download/mhtml_generation_manager.cc#newcode45 content/browser/download/mhtml_generation_manager.cc:45: bool GotMoreFramesToProcess() ...
5 years ago (2015-12-09 17:33:57 UTC) #14
dcheng
lgtm
5 years ago (2015-12-09 18:12:38 UTC) #15
Łukasz Anforowicz
rdsmith@, could you please take a look?
5 years ago (2015-12-09 18:18:58 UTC) #17
Łukasz Anforowicz
tkent@, could you please take a look (mostly at third_party/WebKit/Source/platform/mhtml/MHTMLArchive.* and third_party/WebKit/Source/web/tests/MHTMLTest.cpp changes - I've ...
5 years ago (2015-12-10 01:09:05 UTC) #19
tkent
lgtm
5 years ago (2015-12-10 02:21:18 UTC) #20
Randy Smith (Not in Mondays)
content/browser, content/common looks basically good to me; nits, questions, and suggestions below. https://codereview.chromium.org/1386873003/diff/280001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc ...
5 years ago (2015-12-10 23:07:56 UTC) #21
lukasza
Randy, can you take another look please? https://codereview.chromium.org/1386873003/diff/280001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/1386873003/diff/280001/content/browser/download/mhtml_generation_manager.cc#newcode65 content/browser/download/mhtml_generation_manager.cc:65: // a ...
5 years ago (2015-12-11 00:29:03 UTC) #23
ncarter (slow)
https://codereview.chromium.org/1386873003/diff/280001/content/common/frame_messages.h File content/common/frame_messages.h (right): https://codereview.chromium.org/1386873003/diff/280001/content/common/frame_messages.h#newcode740 content/common/frame_messages.h:740: // emit the MHTML footer. On 2015/12/11 00:29:03, lukasza ...
5 years ago (2015-12-11 17:21:42 UTC) #25
Randy Smith (Not in Mondays)
LGTM; thanks! https://codereview.chromium.org/1386873003/diff/280001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/1386873003/diff/280001/content/browser/download/mhtml_generation_manager.cc#newcode65 content/browser/download/mhtml_generation_manager.cc:65: // a |site_instance|-specific, routing-id-based map. On 2015/12/11 ...
5 years ago (2015-12-14 02:47:04 UTC) #26
Łukasz Anforowicz
Thanks for reviewing. https://codereview.chromium.org/1386873003/diff/280001/content/browser/download/mhtml_generation_manager.cc File content/browser/download/mhtml_generation_manager.cc (right): https://codereview.chromium.org/1386873003/diff/280001/content/browser/download/mhtml_generation_manager.cc#newcode294 content/browser/download/mhtml_generation_manager.cc:294: uint32 file_flags = base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE; ...
5 years ago (2015-12-14 18:08:42 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1386873003/340001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1386873003/340001
5 years ago (2015-12-14 18:10:16 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1386873003/360001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1386873003/360001
5 years ago (2015-12-14 19:07:13 UTC) #34
commit-bot: I haz the power
Committed patchset #18 (id:360001)
5 years ago (2015-12-14 20:24:21 UTC) #36
commit-bot: I haz the power
5 years ago (2015-12-14 20:25:26 UTC) #38
Message was sent while issue was closed.
Patchset 18 (id:??) landed as
https://crrev.com/70b79c8c617e3e73e4df9e7e548ff675a9886a6b
Cr-Commit-Position: refs/heads/master@{#365082}

Powered by Google App Engine
This is Rietveld 408576698