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

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: preload @import Created 4 years, 5 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 c24152b112d4d4a7d46fc4813869e50f68556857..d67dd4596d28ddef69fa9392b8daee81c93e1a01 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.h
+++ b/third_party/WebKit/Source/core/fetch/Resource.h
@@ -86,6 +86,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())
{
@@ -131,7 +138,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(); }
@@ -258,7 +268,7 @@ protected:
void finishPendingClients();
virtual void didAddClient(ResourceClient*);
- void willAddClientOrObserver();
+ void willAddClientOrObserver(PreloadReferencePolicy);
// |this| object may be dead after didRemoveClientOrObserver().
void didRemoveClientOrObserver();

Powered by Google App Engine
This is Rietveld 408576698