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

Issue 2379823003: Move MHTML file writing out of the renderer main thread. (Closed)

Created:
4 years, 2 months ago by carlosk
Modified:
4 years, 2 months ago
CC:
chromium-reviews, nasko+codewatch_chromium.org, mlamouri+watch-content_chromium.org, jam, darin-cc_chromium.org, creis+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move MHTML file writing out of the renderer main thread. This change moves the step of writing MHTML serialized and encoded data to file out of the renderer main thread, into its FILE thread. The less we block the main one, the more responsive the renderer remains which is good. Note: I mande a correction to the logic tracked by the UMA histogram PageSerialization.MhtmlGeneration.WriteToDiskTime.SingleFrame to make sure it includes the file close operation that might involve a buffer flush that could be significant. BUG=651525, 645686 Committed: https://crrev.com/27fa065af52591c67adba826584ff854beaa0a35 Cr-Commit-Position: refs/heads/master@{#423331}

Patch Set 1 #

Patch Set 2 : Rebased upon latest version of base change. #

Patch Set 3 : Fixed logic bug. #

Total comments: 2

Patch Set 4 : No special casing for serialization failures (aka always thread hop to File thread). #

Patch Set 5 : Rebase (fix patching error). #

Patch Set 6 : MHTML file writing timing UMA report now encompasses base::File::Close call. #

Patch Set 7 : HACK: do not use WebData for inter-thread data sharing #

Patch Set 8 : Using std::vector to store raw MHTML data #

Patch Set 9 : A few move semantics fixes (I think). #

Total comments: 3

Patch Set 10 : Rebase #

Patch Set 11 : Removed unneeded std::move calls that clang was complaining about. #

Total comments: 1

Patch Set 12 : Revert back to appropriate Blink guidelines but now using WebThreadSafeData #

Total comments: 6

Patch Set 13 : Address dcheng@ comments. #

Total comments: 14

Patch Set 14 : Address reviewer comments. #

Patch Set 15 : Address reviewer comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+131 lines, -78 lines) Patch
M content/renderer/render_frame_impl.h View 1 2 3 4 5 6 7 8 9 14 1 chunk +8 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 12 chunks +80 lines, -41 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 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/web/WebFrameSerializer.cpp View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +13 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/web/tests/MHTMLTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +16 lines, -14 lines 0 comments Download
M third_party/WebKit/public/web/WebFrameSerializer.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +8 lines, -6 lines 0 comments Download

Messages

Total messages: 71 (48 generated)
carlosk
nasko@chromium.org, lukasza@chromium.org: PTAL.
4 years, 2 months ago (2016-09-29 19:10:40 UTC) #8
Łukasz Anforowicz
Everything looks good, but we need to figure out how to close the file after ...
4 years, 2 months ago (2016-09-29 19:56:18 UTC) #11
carlosk
Thanks. It seems that the change you suggested also fixed the Android test failure. The ...
4 years, 2 months ago (2016-09-30 00:20:18 UTC) #16
carlosk
These same trybot failing tests I see here are passing when I run them locally ...
4 years, 2 months ago (2016-09-30 03:23:10 UTC) #23
carlosk
dewittj@ just showed me what seems to be the issue with my patch: WebData instances ...
4 years, 2 months ago (2016-09-30 22:47:16 UTC) #24
carlosk
dcheng@: could you PTAL on my changes to replace the usage of WebData for MHTML ...
4 years, 2 months ago (2016-10-03 23:51:05 UTC) #34
dcheng
https://codereview.chromium.org/2379823003/diff/210001/third_party/WebKit/public/web/WebFrameSerializer.h File third_party/WebKit/public/web/WebFrameSerializer.h (right): https://codereview.chromium.org/2379823003/diff/210001/third_party/WebKit/public/web/WebFrameSerializer.h#newcode81 third_party/WebKit/public/web/WebFrameSerializer.h:81: BLINK_EXPORT static std::vector<char> generateMHTMLHeader( We don't allow STL containers ...
4 years, 2 months ago (2016-10-04 04:34:48 UTC) #47
carlosk
Thanks. I reverted back this last set of changes but switched the raw data container ...
4 years, 2 months ago (2016-10-04 21:49:54 UTC) #51
dcheng
+dmurph as the blobs expert, just to confirm that this isn't a super surprising way ...
4 years, 2 months ago (2016-10-04 22:05:33 UTC) #53
dmurph
The use of WebThreadSafeData lgtm
4 years, 2 months ago (2016-10-05 00:08:27 UTC) #54
carlosk
Thanks. https://codereview.chromium.org/2379823003/diff/230001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/2379823003/diff/230001/content/renderer/render_frame_impl.cc#newcode5280 content/renderer/render_frame_impl.cc:5280: base::Passed(std::move(mhtml_contents)), On 2016/10/04 22:05:33, dcheng wrote: > This ...
4 years, 2 months ago (2016-10-05 00:24:14 UTC) #55
dcheng
LGTM with a comment for the tests https://codereview.chromium.org/2379823003/diff/250001/third_party/WebKit/Source/web/tests/MHTMLTest.cpp File third_party/WebKit/Source/web/tests/MHTMLTest.cpp (right): https://codereview.chromium.org/2379823003/diff/250001/third_party/WebKit/Source/web/tests/MHTMLTest.cpp#newcode248 third_party/WebKit/Source/web/tests/MHTMLTest.cpp:248: SharedBuffer::create(rawData->data(), rawData->length()); ...
4 years, 2 months ago (2016-10-05 00:58:16 UTC) #56
carlosk
Thanks. tkent@: PTAL at MHTMLArchive.* lucasza@: do you have more comments? https://codereview.chromium.org/2379823003/diff/250001/third_party/WebKit/Source/web/tests/MHTMLTest.cpp File third_party/WebKit/Source/web/tests/MHTMLTest.cpp (right): ...
4 years, 2 months ago (2016-10-05 01:03:11 UTC) #58
tkent
> tkent@: PTAL at MHTMLArchive.* lgtm
4 years, 2 months ago (2016-10-05 02:04:02 UTC) #59
Łukasz Anforowicz
LGTM
4 years, 2 months ago (2016-10-05 18:34:37 UTC) #60
nasko
Just a few small things. https://codereview.chromium.org/2379823003/diff/250001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/2379823003/diff/250001/content/renderer/render_frame_impl.cc#newcode787 content/renderer/render_frame_impl.cc:787: bool WriteMHTMLToDisk(bool success, This ...
4 years, 2 months ago (2016-10-05 18:56:54 UTC) #61
carlosk
Thanks! https://codereview.chromium.org/2379823003/diff/250001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/2379823003/diff/250001/content/renderer/render_frame_impl.cc#newcode787 content/renderer/render_frame_impl.cc:787: bool WriteMHTMLToDisk(bool success, On 2016/10/05 18:56:54, nasko (slow) ...
4 years, 2 months ago (2016-10-05 20:23:37 UTC) #62
nasko
https://codereview.chromium.org/2379823003/diff/250001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/2379823003/diff/250001/content/renderer/render_frame_impl.cc#newcode791 content/renderer/render_frame_impl.cc:791: "WriteMHTMLToDisk (RenderFrameImpl)"); On 2016/10/05 20:23:37, carlosk wrote: > On ...
4 years, 2 months ago (2016-10-05 20:41:10 UTC) #63
carlosk
Thanks. https://codereview.chromium.org/2379823003/diff/250001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/2379823003/diff/250001/content/renderer/render_frame_impl.cc#newcode791 content/renderer/render_frame_impl.cc:791: "WriteMHTMLToDisk (RenderFrameImpl)"); On 2016/10/05 20:41:10, nasko (slow) wrote: ...
4 years, 2 months ago (2016-10-05 21:18:01 UTC) #64
nasko
LGTM
4 years, 2 months ago (2016-10-05 21:29:40 UTC) #65
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/2379823003/290001
4 years, 2 months ago (2016-10-05 21:34:58 UTC) #68
commit-bot: I haz the power
Committed patchset #15 (id:290001)
4 years, 2 months ago (2016-10-05 23:11:02 UTC) #69
commit-bot: I haz the power
4 years, 2 months ago (2016-10-05 23:13:40 UTC) #71
Message was sent while issue was closed.
Patchset 15 (id:??) landed as
https://crrev.com/27fa065af52591c67adba826584ff854beaa0a35
Cr-Commit-Position: refs/heads/master@{#423331}

Powered by Google App Engine
This is Rietveld 408576698