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

Issue 2343623002: Add a warning whenever link preloads are not used (Closed)

Created:
4 years, 3 months ago by Yoav Weiss
Modified:
4 years ago
CC:
chromium-reviews, tyoshino+watch_chromium.org, loading-reviews_chromium.org, gavinp+loader_chromium.org, blink-reviews, loading-reviews+fetch_chromium.org, Nate Chapin
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a warning whenever link preloads are not used This CL adds a console warning if 3 seconds after the page's onload, there are still preloaded resources that were not used. BUG=646797 Committed: https://crrev.com/4fcc2d6bfddd9592403148e752620a987d1c15ae Cr-Commit-Position: refs/heads/master@{#420015}

Patch Set 1 #

Total comments: 14

Patch Set 2 : Review comments #

Total comments: 3

Patch Set 3 : more comments #

Total comments: 6

Patch Set 4 : moar review comments #

Patch Set 5 : Fix crash #

Patch Set 6 : rebase #

Patch Set 7 : rebase2 #

Patch Set 8 : removed dcheck to test it on the bots #

Patch Set 9 : trying assert instead #

Patch Set 10 : replaced ASSERT with a cowardly if #

Patch Set 11 : Added failing unit tests #

Total comments: 2

Patch Set 12 : Removed the counter, since it was not accurate #

Total comments: 2

Patch Set 13 : Added comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -12 lines) Patch
A third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-preload-unused.html View 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-preload-unused-expected.txt View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/FetchContext.h View 1 2 3 4 5 2 chunks +6 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/FetchContext.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +13 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +21 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalDOMWindow.h View 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +21 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.cpp View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/loader/LinkPreloadResourceClients.h View 1 2 3 4 5 5 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 87 (59 generated)
Yoav Weiss
Hey! While looking into the twitter memory issues, I figured there's no current way for ...
4 years, 3 months ago (2016-09-14 11:53:35 UTC) #4
Charlie Harrison
Great patch! This is not only useful to web devs but to us :P A ...
4 years, 3 months ago (2016-09-14 12:34:58 UTC) #8
Yoav Weiss
https://codereview.chromium.org/2343623002/diff/1/third_party/WebKit/Source/core/fetch/FetchContext.h File third_party/WebKit/Source/core/fetch/FetchContext.h (right): https://codereview.chromium.org/2343623002/diff/1/third_party/WebKit/Source/core/fetch/FetchContext.h#newcode39 third_party/WebKit/Source/core/fetch/FetchContext.h:39: #include "core/inspector/ConsoleTypes.h" On 2016/09/14 12:34:58, Charlie Harrison wrote: > ...
4 years, 3 months ago (2016-09-14 13:28:31 UTC) #9
Charlie Harrison
https://codereview.chromium.org/2343623002/diff/1/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp File third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp (right): https://codereview.chromium.org/2343623002/diff/1/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp#newcode1361 third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp:1361: m_unusedPreloadsTimer.startOneShot(unusedPreloadTimeout, BLINK_FROM_HERE); On 2016/09/14 13:28:31, Yoav Weiss wrote: > ...
4 years, 3 months ago (2016-09-14 13:33:00 UTC) #10
Yoav Weiss
On 2016/09/14 13:33:00, Charlie Harrison wrote: > https://codereview.chromium.org/2343623002/diff/1/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp > File third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp (right): > > https://codereview.chromium.org/2343623002/diff/1/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp#newcode1361 ...
4 years, 3 months ago (2016-09-14 20:57:32 UTC) #13
Charlie Harrison
Quick comments https://codereview.chromium.org/2343623002/diff/20001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/2343623002/diff/20001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp#newcode922 third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp:922: context().addConsoleMessage("The resource " + resource->url().getString() + " ...
4 years, 3 months ago (2016-09-14 21:07:59 UTC) #14
Yoav Weiss
On 2016/09/14 21:07:59, Charlie Harrison wrote: > Quick comments > > https://codereview.chromium.org/2343623002/diff/20001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp > File third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ...
4 years, 3 months ago (2016-09-14 21:24:09 UTC) #16
Charlie Harrison
non owner lgtm. This patch is great!
4 years, 3 months ago (2016-09-14 21:32:29 UTC) #18
Nate Chapin
LGTM with a few nitpicks. https://codereview.chromium.org/2343623002/diff/40001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/2343623002/diff/40001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp#newcode480 third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp:480: DCHECK_GT(static_cast<int>(m_unusedLinkPreloadCounter), 0); Why static_cast ...
4 years, 3 months ago (2016-09-14 22:14:32 UTC) #19
Yoav Weiss
Thanks both for reviewing! :) https://codereview.chromium.org/2343623002/diff/40001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/2343623002/diff/40001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp#newcode480 third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp:480: DCHECK_GT(static_cast<int>(m_unusedLinkPreloadCounter), 0); On 2016/09/14 ...
4 years, 3 months ago (2016-09-15 06:11:29 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/2343623002/80001
4 years, 3 months ago (2016-09-15 09:49:18 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/142065)
4 years, 3 months ago (2016-09-15 10:31:53 UTC) #39
Yoav Weiss
On 2016/09/15 10:31:53, commit-bot: I haz the power wrote: > Try jobs failed on following ...
4 years, 3 months ago (2016-09-15 16:23:19 UTC) #50
Yoav Weiss
On 2016/09/15 16:23:19, Yoav Weiss wrote: > On 2016/09/15 10:31:53, commit-bot: I haz the power ...
4 years, 3 months ago (2016-09-15 22:14:08 UTC) #53
Charlie Harrison
On 2016/09/15 22:14:08, Yoav Weiss wrote: > On 2016/09/15 16:23:19, Yoav Weiss wrote: > > ...
4 years, 3 months ago (2016-09-16 12:20:04 UTC) #62
Yoav Weiss
https://codereview.chromium.org/2343623002/diff/200001/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp (right): https://codereview.chromium.org/2343623002/diff/200001/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp#newcode662 third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp:662: EXPECT_FALSE(fetcher2->hasUnusedLinkPreloads()); This fails because the resource->isLinkPreload() is no longer ...
4 years, 3 months ago (2016-09-19 10:57:41 UTC) #65
Charlie Harrison
https://codereview.chromium.org/2343623002/diff/200001/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp (right): https://codereview.chromium.org/2343623002/diff/200001/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp#newcode662 third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp:662: EXPECT_FALSE(fetcher2->hasUnusedLinkPreloads()); On 2016/09/19 10:57:41, Yoav Weiss wrote: > This ...
4 years, 3 months ago (2016-09-19 14:06:45 UTC) #68
Yoav Weiss
On 2016/09/19 14:06:45, Charlie Harrison wrote: > https://codereview.chromium.org/2343623002/diff/200001/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp > File third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp (right): > > https://codereview.chromium.org/2343623002/diff/200001/third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp#newcode662 ...
4 years, 3 months ago (2016-09-19 15:22:24 UTC) #69
Charlie Harrison
On 2016/09/19 15:22:24, Yoav Weiss wrote: > On 2016/09/19 14:06:45, Charlie Harrison wrote: > > ...
4 years, 3 months ago (2016-09-19 15:27:15 UTC) #70
Yoav Weiss
On 2016/09/19 15:27:15, Charlie Harrison wrote: > On 2016/09/19 15:22:24, Yoav Weiss wrote: > > ...
4 years, 3 months ago (2016-09-20 08:24:02 UTC) #71
Yoav Weiss
On 2016/09/20 08:24:02, Yoav Weiss wrote: > On 2016/09/19 15:27:15, Charlie Harrison wrote: > > ...
4 years, 3 months ago (2016-09-20 08:38:45 UTC) #74
Charlie Harrison
Yeah the fact that we clear m_preloads on DCL helps here. I would maybe say ...
4 years, 3 months ago (2016-09-20 12:15:19 UTC) #77
Yoav Weiss
https://codereview.chromium.org/2343623002/diff/220001/third_party/WebKit/Source/core/loader/LinkPreloadResourceClients.h File third_party/WebKit/Source/core/loader/LinkPreloadResourceClients.h (right): https://codereview.chromium.org/2343623002/diff/220001/third_party/WebKit/Source/core/loader/LinkPreloadResourceClients.h#newcode72 third_party/WebKit/Source/core/loader/LinkPreloadResourceClients.h:72: setResource(resource, Resource::DontMarkAsReferenced); On 2016/09/20 12:15:19, Charlie Harrison wrote: > ...
4 years, 3 months ago (2016-09-21 07:45:41 UTC) #78
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/2343623002/240001
4 years, 3 months ago (2016-09-21 07:47:15 UTC) #81
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 3 months ago (2016-09-21 09:14:56 UTC) #83
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/4fcc2d6bfddd9592403148e752620a987d1c15ae Cr-Commit-Position: refs/heads/master@{#420015}
4 years, 3 months ago (2016-09-21 09:17:32 UTC) #85
dgozman
FYI: this happened to flake a layout test in debug mode - I guess the ...
4 years ago (2016-12-05 16:30:49 UTC) #86
Yoav Weiss
4 years ago (2016-12-13 09:11:49 UTC) #87
Message was sent while issue was closed.
On 2016/12/05 16:30:49, dgozman wrote:
> FYI: this happened to flake a layout test in debug mode - I guess the test is
> slow and took more than 3 seconds to use preload. Not sure we should do
> anything.
>
https://build.chromium.org/p/tryserver.blink/builders/linux_trusty_blink_dbg/...

What I did elsewhere was to move tests that may trigger this (so tests that use
link preload without actually using the resource) to testharness (which is a
good thing in general)

Powered by Google App Engine
This is Rietveld 408576698