Chromium Code Reviews| Index: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp |
| diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp |
| index 5ff0d0d3861a31c60532f733a76016d704734229..97affdc890cde47ef8a99006e61753eed7484276 100644 |
| --- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp |
| +++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp |
| @@ -906,6 +906,17 @@ void ResourceFetcher::clearPreloads(ClearPreloadsPolicy policy) |
| m_preloads.clear(); |
| } |
| +void ResourceFetcher::warnUnusedPreloads() |
| +{ |
| + if (!m_preloads) |
| + return; |
| + for (auto resource : *m_preloads) { |
|
Charlie Harrison
2016/09/14 12:34:58
const auto& ?
Yoav Weiss
2016/09/14 13:28:31
Yeah. I'll also modify all the other iterations of
|
| + if (resource && resource->isLinkPreload() && resource->getPreloadResult() == Resource::PreloadNotReferenced) { |
| + context().addConsoleMessage("The resource " + resource->url().getString() + " was preloaded but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing.", WarningMessageLevel); |
|
Charlie Harrison
2016/09/14 12:34:58
Do you think you should include the fact that it w
Yoav Weiss
2016/09/14 13:28:31
nothing is obvious :) I'll add it to the comment
|
| + } |
| + } |
| +} |
| + |
| ArchiveResource* ResourceFetcher::createArchive(Resource* resource) |
| { |
| // Only the top-frame can load MHTML. |