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

Unified Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.h

Issue 2343623002: Add a warning whenever link preloads are not used (Closed)
Patch Set: more comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/fetch/ResourceFetcher.h
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.h b/third_party/WebKit/Source/core/fetch/ResourceFetcher.h
index 847ce9e077d904310327c9ab0cf57a979bcff074..e1bcb9bb3a32a17f8f538bccb1c8e038d77d34d0 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.h
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.h
@@ -96,9 +96,11 @@ public:
bool isPreloaded(const KURL&) const;
int countPreloads() const { return m_preloads ? m_preloads->size() : 0; }
+ bool hasUnusedLinkPreloads() { return m_unusedLinkPreloadCounter > 0; }
void clearPreloads(ClearPreloadsPolicy = ClearAllPreloads);
void preloadStarted(Resource*);
void logPreloadStats();
+ void warnUnusedPreloads();
MHTMLArchive* archive() const { return m_archive.get(); }
ArchiveResource* createArchive(Resource*);
@@ -180,6 +182,7 @@ private:
mutable DocumentResourceMap m_documentResources;
Member<HeapListHashSet<Member<Resource>>> m_preloads;
+ unsigned m_unusedLinkPreloadCounter;
Member<MHTMLArchive> m_archive;
Timer<ResourceFetcher> m_resourceTimingReportTimer;

Powered by Google App Engine
This is Rietveld 408576698