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

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

Issue 1976463003: Preload scan external CSS for @import (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + minor style tweaks Created 4 years, 4 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/Resource.h
diff --git a/third_party/WebKit/Source/core/fetch/Resource.h b/third_party/WebKit/Source/core/fetch/Resource.h
index 6e6887e0ec428ecc9050444895f085767a74369f..ecb936c44e5669fdafb3a5fcaa83c663ec335f6d 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.h
+++ b/third_party/WebKit/Source/core/fetch/Resource.h
@@ -87,6 +87,13 @@ public:
DecodeError
};
+ // Whether a resource client for a preload should mark the preload as
+ // referenced.
+ enum PreloadReferencePolicy {
+ MarkAsReferenced,
+ DontMarkAsReferenced,
+ };
+
// Exposed for testing.
static Resource* create(const ResourceRequest& request, Type type, const ResourceLoaderOptions& options = ResourceLoaderOptions())
{
@@ -132,7 +139,10 @@ public:
void didChangePriority(ResourceLoadPriority, int intraPriorityValue);
virtual ResourcePriority priorityFromObservers() { return ResourcePriority(); }
- void addClient(ResourceClient*);
+ // The reference policy indicates that the client should not affect whether
+ // a preload is considered referenced or not. This allows for "passive"
+ // resource clients that simply observe the resource.
+ void addClient(ResourceClient*, PreloadReferencePolicy = MarkAsReferenced);
void removeClient(ResourceClient*);
virtual bool hasClientsOrObservers() const { return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty() || !m_finishedClients.isEmpty(); }
@@ -263,7 +273,7 @@ protected:
void finishPendingClients();
virtual void didAddClient(ResourceClient*);
- void willAddClientOrObserver();
+ void willAddClientOrObserver(PreloadReferencePolicy);
// |this| object may be dead after didRemoveClientOrObserver().
void didRemoveClientOrObserver();
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.cpp ('k') | third_party/WebKit/Source/core/fetch/Resource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698