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

Issue 2411863002: [NoStatePrefetch] Kill renderer after preload scanning (Closed)

Created:
4 years, 2 months ago by pasko
Modified:
4 years, 1 month ago
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, cbentzel+watch_chromium.org, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, dglazkov+blink, eae+blinkwatch, gavinp+prer_chromium.org, gavinp+prerender_chromium.org, gavinp+loader_chromium.org, jam, Nate Chapin, kinuko+watch, loading-reviews+parser_chromium.org, loading-reviews_chromium.org, nasko+codewatch_chromium.org, rwlbuis, sof, tburkard+watch_chromium.org, tyoshino+watch_chromium.org, Yoav Weiss
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[NoStatePrefetch] Kill renderer after preload scanning The design doc is linked in the first bug. Main goal: remove Prerender. Currently NoState Prefetch uses the same logic to manage renderers as the PrerenderManager. Prefetch code is still living in PrerenderManager, separating the code from there is planned after we finalize on how much of the functionality of PrerenderManager is needed. This is the first tweak in the renderer lifetime: the renderer asks to be killed as soon as the main resource is fully preload-scanned and all possible subresources are requested, special Prerendering FinalStatus is recorded to allow: * testing * provide a hint that a new prefetch can be started soon Browsertest changes: * TestPrerender now keeps FinalStatus for longer, to be able to verify that it is correct even after the TestPrerenderContents is destroyed. * Prefetch browsertests wait only for creation of PrerenderContents, Prerender tests have more waiting for page loads on top of that * PrerenderTestUrlImpl is removed to eliminate one hop through protected method in the parent class, which also simplified the prefetch side of the tests: no need to mention how many page loads to wait for * Disabled two tests that load a non-HTML document, correctly killing the renderer will be done in later changes. BUG=632361, 649632 Committed: https://crrev.com/66351bd0a0fc8740749663fe765a301e1a175538 Cr-Commit-Position: refs/heads/master@{#427678}

Patch Set 1 #

Total comments: 10

Patch Set 2 : notify about prefetching finished earlier in the HTMLDocumentParser #

Patch Set 3 : FINAL_STATUS_NOSTATE_PREFETCH_FINISHED #

Patch Set 4 : plumb through prerender_messages #

Patch Set 5 : void prefetchFinished() override {} #

Patch Set 6 : occasional style-related changes #

Patch Set 7 : rebase and git cl format #

Total comments: 4

Patch Set 8 : Moved onPrefetchFinished() to Document::finishedParsing() #

Patch Set 9 : PrefetchNonexisting: FINAL_STATUS_UNSUPPORTED_SCHEME #

Total comments: 3

Patch Set 10 : inline Document::onPrefetchFinished() into Document::finishedParsing() #

Total comments: 2

Patch Set 11 : s/teh/the/ in a comment #

Patch Set 12 : fixed a comment, removed unnecessary change from disabled test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+291 lines, -210 lines) Patch
M chrome/browser/prerender/prerender_browsertest.cc View 1 2 3 4 5 6 7 2 chunks +35 lines, -13 lines 0 comments Download
M chrome/browser/prerender/prerender_final_status.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/prerender/prerender_final_status.cc View 1 2 3 4 5 6 1 chunk +57 lines, -56 lines 0 comments Download
M chrome/browser/prerender/prerender_manager.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/prerender/prerender_manager.cc View 1 2 3 4 5 6 7 1 chunk +13 lines, -0 lines 0 comments Download
M chrome/browser/prerender/prerender_message_filter.h View 1 2 3 4 5 3 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/prerender/prerender_message_filter.cc View 1 2 3 5 chunks +20 lines, -1 line 0 comments Download
M chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 19 chunks +80 lines, -73 lines 0 comments Download
M chrome/browser/prerender/prerender_test_utils.h View 1 2 3 4 5 6 7 9 chunks +26 lines, -32 lines 0 comments Download
M chrome/browser/prerender/prerender_test_utils.cc View 1 2 3 4 5 6 7 8 chunks +27 lines, -34 lines 0 comments Download
M chrome/common/prerender_messages.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/renderer/prerender/prerender_dispatcher.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/prerender/prerender_dispatcher.cc View 1 2 3 4 5 2 chunks +5 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/web/tests/PrerenderingTest.cpp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebPrerenderingSupport.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 74 (41 generated)
pasko
clamy: PTaL at changes in content/ (checkdeps violation and the un-beautiful use of the RenderProcessHost, ...
4 years, 2 months ago (2016-10-11 19:13:41 UTC) #6
droger
This seems like a good approach. https://codereview.chromium.org/2411863002/diff/1/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp File third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp (right): https://codereview.chromium.org/2411863002/diff/1/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp#newcode927 third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp:927: // Early determine ...
4 years, 2 months ago (2016-10-12 09:12:58 UTC) #7
clamy
Thanks! Some comments see below. https://codereview.chromium.org/2411863002/diff/1/chrome/renderer/prerender/prerender_helper.cc File chrome/renderer/prerender/prerender_helper.cc (right): https://codereview.chromium.org/2411863002/diff/1/chrome/renderer/prerender/prerender_helper.cc#newcode74 chrome/renderer/prerender/prerender_helper.cc:74: void PrerenderHelper::SendPrefetchFinished(content::RenderFrame* render_frame) { ...
4 years, 2 months ago (2016-10-12 11:19:58 UTC) #8
pasko
TL;DR: clamy: looking at fixing the layering violation, droger: Done. https://codereview.chromium.org/2411863002/diff/1/chrome/renderer/prerender/prerender_helper.cc File chrome/renderer/prerender/prerender_helper.cc (right): https://codereview.chromium.org/2411863002/diff/1/chrome/renderer/prerender/prerender_helper.cc#newcode74 ...
4 years, 2 months ago (2016-10-12 13:59:40 UTC) #9
mattcary
https://codereview.chromium.org/2411863002/diff/1/chrome/browser/prerender/prerender_final_status.h File chrome/browser/prerender/prerender_final_status.h (right): https://codereview.chromium.org/2411863002/diff/1/chrome/browser/prerender/prerender_final_status.h#newcode70 chrome/browser/prerender/prerender_final_status.h:70: FINAL_STATUS_PREFETCH_FINISHED = 55, nit: it seems likely in the ...
4 years, 2 months ago (2016-10-12 14:09:17 UTC) #10
clamy
https://codereview.chromium.org/2411863002/diff/1/chrome/renderer/prerender/prerender_helper.cc File chrome/renderer/prerender/prerender_helper.cc (right): https://codereview.chromium.org/2411863002/diff/1/chrome/renderer/prerender/prerender_helper.cc#newcode74 chrome/renderer/prerender/prerender_helper.cc:74: void PrerenderHelper::SendPrefetchFinished(content::RenderFrame* render_frame) { On 2016/10/12 13:59:40, pasko wrote: ...
4 years, 2 months ago (2016-10-12 14:16:26 UTC) #11
pasko
https://codereview.chromium.org/2411863002/diff/1/chrome/browser/prerender/prerender_final_status.h File chrome/browser/prerender/prerender_final_status.h (right): https://codereview.chromium.org/2411863002/diff/1/chrome/browser/prerender/prerender_final_status.h#newcode70 chrome/browser/prerender/prerender_final_status.h:70: FINAL_STATUS_PREFETCH_FINISHED = 55, On 2016/10/12 14:09:17, mattcary wrote: > ...
4 years, 2 months ago (2016-10-12 14:28:09 UTC) #12
pasko
clamy: PTAL the new version just uploaded sends a PrerenderHostMsg_. In the past those were ...
4 years, 2 months ago (2016-10-14 14:40:37 UTC) #15
pasko
oh, need to update some webkit_unit_tests to make them compile .. looking into it
4 years, 2 months ago (2016-10-14 14:42:01 UTC) #16
pasko
On 2016/10/14 14:42:01, pasko wrote: > oh, need to update some webkit_unit_tests to make them ...
4 years, 2 months ago (2016-10-14 15:35:05 UTC) #21
clamy
The general architecture looks reasonable to me, but I'm not an owner nor very proficient ...
4 years, 2 months ago (2016-10-14 15:42:20 UTC) #22
mattcary
lgtm
4 years, 2 months ago (2016-10-14 15:53:21 UTC) #23
pasko
mkwst: please take a look at the new IPC and the Blink side droger: this ...
4 years, 2 months ago (2016-10-17 10:19:35 UTC) #29
Mike West
IPC LGTM.
4 years, 2 months ago (2016-10-17 11:20:09 UTC) #32
pasko
csharrison: please review a small change in core/html/parser
4 years, 2 months ago (2016-10-17 11:37:24 UTC) #34
Charlie Harrison
https://codereview.chromium.org/2411863002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp File third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp (right): https://codereview.chromium.org/2411863002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp#newcode926 third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp:926: if (document()->isPrefetchOnly()) This might make a little more sense ...
4 years, 2 months ago (2016-10-17 13:25:50 UTC) #37
pasko
https://codereview.chromium.org/2411863002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp File third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp (right): https://codereview.chromium.org/2411863002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp#newcode926 third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp:926: if (document()->isPrefetchOnly()) On 2016/10/17 13:25:50, Charlie Harrison wrote: > ...
4 years, 2 months ago (2016-10-17 14:25:11 UTC) #38
Charlie Harrison
https://codereview.chromium.org/2411863002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp File third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp (right): https://codereview.chromium.org/2411863002/diff/120001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp#newcode926 third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp:926: if (document()->isPrefetchOnly()) On 2016/10/17 14:25:11, pasko wrote: > On ...
4 years, 2 months ago (2016-10-17 14:49:17 UTC) #39
droger
LGTM sorry for the delay.
4 years, 1 month ago (2016-10-24 11:32:41 UTC) #40
pasko
Merged this with the browsertests from mattcary@. (finaly) Tests should pass now! Had to disable ...
4 years, 1 month ago (2016-10-25 14:49:40 UTC) #49
Charlie Harrison
core/dom non-owner lgtm w/ nit. https://codereview.chromium.org/2411863002/diff/180001/third_party/WebKit/Source/core/dom/Document.h File third_party/WebKit/Source/core/dom/Document.h (right): https://codereview.chromium.org/2411863002/diff/180001/third_party/WebKit/Source/core/dom/Document.h#newcode386 third_party/WebKit/Source/core/dom/Document.h:386: void onPrefetchFinished() const; Can ...
4 years, 1 month ago (2016-10-25 15:05:27 UTC) #50
pasko
https://codereview.chromium.org/2411863002/diff/180001/third_party/WebKit/Source/core/dom/Document.h File third_party/WebKit/Source/core/dom/Document.h (right): https://codereview.chromium.org/2411863002/diff/180001/third_party/WebKit/Source/core/dom/Document.h#newcode386 third_party/WebKit/Source/core/dom/Document.h:386: void onPrefetchFinished() const; On 2016/10/25 15:05:27, Charlie Harrison wrote: ...
4 years, 1 month ago (2016-10-25 15:17:30 UTC) #51
Charlie Harrison
https://codereview.chromium.org/2411863002/diff/180001/third_party/WebKit/Source/core/dom/Document.h File third_party/WebKit/Source/core/dom/Document.h (right): https://codereview.chromium.org/2411863002/diff/180001/third_party/WebKit/Source/core/dom/Document.h#newcode386 third_party/WebKit/Source/core/dom/Document.h:386: void onPrefetchFinished() const; On 2016/10/25 15:17:30, pasko wrote: > ...
4 years, 1 month ago (2016-10-25 15:18:19 UTC) #52
pasko
jochen: please review changes in third_party/WebKit/Source/core/dom
4 years, 1 month ago (2016-10-25 15:32:14 UTC) #55
jochen (gone - plz use gerrit)
lgtm
4 years, 1 month ago (2016-10-26 08:17:48 UTC) #60
droger
still lgtm https://codereview.chromium.org/2411863002/diff/200001/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc File chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc (right): https://codereview.chromium.org/2411863002/diff/200001/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc#newcode424 chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc:424: // URLs are ignored in renderers, and ...
4 years, 1 month ago (2016-10-26 08:52:16 UTC) #61
pasko
thanks all for review! time to land https://codereview.chromium.org/2411863002/diff/200001/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc File chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc (right): https://codereview.chromium.org/2411863002/diff/200001/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc#newcode424 chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc:424: // URLs ...
4 years, 1 month ago (2016-10-26 09:54:52 UTC) #62
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/2411863002/240001
4 years, 1 month ago (2016-10-26 10:03:56 UTC) #65
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/284159)
4 years, 1 month ago (2016-10-26 11:06:55 UTC) #67
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/2411863002/240001
4 years, 1 month ago (2016-10-26 11:30:41 UTC) #69
commit-bot: I haz the power
Committed patchset #12 (id:240001)
4 years, 1 month ago (2016-10-26 13:48:14 UTC) #71
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/66351bd0a0fc8740749663fe765a301e1a175538 Cr-Commit-Position: refs/heads/master@{#427678}
4 years, 1 month ago (2016-10-26 13:50:02 UTC) #73
foolip
4 years, 1 month ago (2016-10-27 09:07:11 UTC) #74
Message was sent while issue was closed.
A revert of this CL (patchset #12 id:240001) has been created in
https://codereview.chromium.org/2452313002/ by foolip@chromium.org.

The reason for reverting is:
"NoStatePrefetchBrowserTest.OpenTaskManagerBeforePrefetch" became flaky
shortly after this landed.

BUG=659697
.

Powered by Google App Engine
This is Rietveld 408576698