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

Issue 2165653004: Don't wait for AppCache for link rel preloads (Closed)

Created:
4 years, 5 months ago by Charlie Harrison
Modified:
4 years, 5 months ago
CC:
chromium-reviews, blink-reviews, dglazkov+blink, blink-reviews-html_chromium.org, kinuko+watch
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Don't wait for AppCache for link rel preloads The preload scanner currently waits for the Application Cache to be initialized before sending out any preloads. This is less important for link rel preloads, which are directives to send a fetch as soon as possible. This patch bypasses the fetch queuing for these preloads. For link preloads in headers, we can issue these as early as the commit point (for those which don't have a media attribute). BUG=629420 Committed: https://crrev.com/7eacc60e1556444061f9f84bac4d82c34419a2ae Cr-Commit-Position: refs/heads/master@{#407227}

Patch Set 1 #

Patch Set 2 : Initiate Link header preloads at commit, if possible #

Patch Set 3 : Don't wait for appcache for link rel preloads #

Total comments: 4

Patch Set 4 : Dont parse / do more initialization than necessary for media link preload headers #

Total comments: 2

Patch Set 5 : Remove empty check #

Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -16 lines) Patch
A third_party/WebKit/LayoutTests/http/tests/preload/link_header_preload_on_commit.php View 1 2 3 1 chunk +40 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp View 1 2 3 2 chunks +18 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/PreloadRequest.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentLoader.h View 1 2 3 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentLoader.cpp View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/LinkLoader.h View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/LinkLoader.cpp View 1 2 2 chunks +6 lines, -1 line 0 comments Download

Messages

Total messages: 36 (23 generated)
Charlie Harrison
kouhei@, yoav@. PTAL? I did a bit of refactoring of prefetching link headers into DocumentLoader, ...
4 years, 5 months ago (2016-07-22 04:19:48 UTC) #13
kouhei (in TOK)
lgtm please wait for yoav@
4 years, 5 months ago (2016-07-22 04:29:55 UTC) #14
Yoav Weiss
Overall looks good. I don't understand the AppCache waiting and why can't we just nuke ...
4 years, 5 months ago (2016-07-22 08:43:28 UTC) #17
Charlie Harrison
https://codereview.chromium.org/2165653004/diff/40001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp File third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp (right): https://codereview.chromium.org/2165653004/diff/40001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp#newcode307 third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp:307: for (auto& request : chunk->preloads) { On 2016/07/22 08:43:28, ...
4 years, 5 months ago (2016-07-22 14:03:22 UTC) #18
Yoav Weiss
On 2016/07/22 14:03:22, csharrison wrote: > https://codereview.chromium.org/2165653004/diff/40001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp > File third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp (right): > > https://codereview.chromium.org/2165653004/diff/40001/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp#newcode307 > ...
4 years, 5 months ago (2016-07-22 14:09:48 UTC) #19
Charlie Harrison
Updated the PS so link headers with media attrs are preloaded on the main thread ...
4 years, 5 months ago (2016-07-22 14:59:13 UTC) #22
Yoav Weiss
https://codereview.chromium.org/2165653004/diff/60001/third_party/WebKit/Source/core/loader/DocumentLoader.cpp File third_party/WebKit/Source/core/loader/DocumentLoader.cpp (right): https://codereview.chromium.org/2165653004/diff/60001/third_party/WebKit/Source/core/loader/DocumentLoader.cpp#newcode214 third_party/WebKit/Source/core/loader/DocumentLoader.cpp:214: if (!linkHeader.isEmpty()) { Why is this wrapper needed? There's ...
4 years, 5 months ago (2016-07-22 16:03:46 UTC) #23
Yoav Weiss
On 2016/07/22 16:03:46, Yoav Weiss wrote: > https://codereview.chromium.org/2165653004/diff/60001/third_party/WebKit/Source/core/loader/DocumentLoader.cpp > File third_party/WebKit/Source/core/loader/DocumentLoader.cpp (right): > > https://codereview.chromium.org/2165653004/diff/60001/third_party/WebKit/Source/core/loader/DocumentLoader.cpp#newcode214 ...
4 years, 5 months ago (2016-07-22 16:17:20 UTC) #24
Charlie Harrison
Your proposal SGTM. https://codereview.chromium.org/2165653004/diff/60001/third_party/WebKit/Source/core/loader/DocumentLoader.cpp File third_party/WebKit/Source/core/loader/DocumentLoader.cpp (right): https://codereview.chromium.org/2165653004/diff/60001/third_party/WebKit/Source/core/loader/DocumentLoader.cpp#newcode214 third_party/WebKit/Source/core/loader/DocumentLoader.cpp:214: if (!linkHeader.isEmpty()) { On 2016/07/22 16:03:46, ...
4 years, 5 months ago (2016-07-22 16:54:24 UTC) #27
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/2165653004/80001
4 years, 5 months ago (2016-07-22 17:40:39 UTC) #31
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 5 months ago (2016-07-22 19:16:17 UTC) #33
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/7eacc60e1556444061f9f84bac4d82c34419a2ae Cr-Commit-Position: refs/heads/master@{#407227}
4 years, 5 months ago (2016-07-22 19:17:58 UTC) #35
kouhei (in TOK)
4 years, 5 months ago (2016-07-25 01:13:04 UTC) #36
Message was sent while issue was closed.
Great work, csharrison!

On 2016/07/22 14:03:22, csharrison wrote:
>
https://codereview.chromium.org/2165653004/diff/40001/third_party/WebKit/Sour...
> File third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
(right):
> 
>
https://codereview.chromium.org/2165653004/diff/40001/third_party/WebKit/Sour...
> third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp:307: for
> (auto& request : chunk->preloads) {
> On 2016/07/22 08:43:28, Yoav Weiss wrote:
> > I don't understand why this waiting is necessary for *any* resource. The
> > preloadScanner bails out from preloading if AppCache is present. So AFAIUI
if
> we
> > have preloads here, there's no AppCache.
> 
> My understanding is that the preload scanner just looks for the manifest
> attribute on the html element, but I think you can have appcache enabled even
> without that check. Looking over the code right now
> (WebApplicationCacheHostImpl::selectCacheWithoutManifest) it looks like this
> might only happen if the document you loaded was loaded via appcache? Kouhei,
do
> you have more context for this?
Your understanding is correct. :)

>
https://codereview.chromium.org/2165653004/diff/40001/third_party/WebKit/Sour...
> File third_party/WebKit/Source/core/loader/LinkLoader.h (right):
> 
>
https://codereview.chromium.org/2165653004/diff/40001/third_party/WebKit/Sour...
> third_party/WebKit/Source/core/loader/LinkLoader.h:78: // Media links cannot
be
> preloaded until the first chunk is parsed. The rest
> On 2016/07/22 08:43:28, Yoav Weiss wrote:
> > "well, actually" warning: their preloading is waiting until the first chunk
is
> > tokenized, not necessarily parsed. But at the same time, we seem to be using
> > "parsed" all over the place (e.g. notifyPendingParsedChunks is called from
> > sendTokensToMainThread, where m_parsedChunkQueue is used to store tokenized
> > chunks...)
> 
> You're right. It's better to be clear here, and using "parsed" for tokenized
> confuses me as well :) If that's the case, then why do we only load links from
> headers *after* constructTreeFromCompactHTMLToken (parsing) is called?
> 
> We could move that call into notifyPendingParsedChunks if all it needs is the
> chunk viewport.

Let's rename those.

Powered by Google App Engine
This is Rietveld 408576698