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

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

Issue 2319483002: Turn off isLinkPreload() when used (Closed)
Patch Set: Fixed tests 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 70428fc06439fa2947416d13f9a3cb08b2b4ef80..903d178c6c628478dcb57b9c6ab9576dbc8d5fe8 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.h
+++ b/third_party/WebKit/Source/core/fetch/Resource.h
@@ -214,6 +214,9 @@ public:
DataBufferingPolicy getDataBufferingPolicy() const { return m_options.dataBufferingPolicy; }
void setDataBufferingPolicy(DataBufferingPolicy);
+ // The isPreloaded() flag is using a counter in order to make sure that even when
+ // multiple ResourceFetchers are preloading the resource, it will remain marked as
+ // preloaded until *all* of them have used it.
bool isUnusedPreload() const { return isPreloaded() && getPreloadResult() == PreloadNotReferenced; }
bool isPreloaded() const { return m_preloadCount; }
void increasePreloadCount() { ++m_preloadCount; }
@@ -253,6 +256,8 @@ public:
static const char* resourceTypeToString(Type, const FetchInitiatorInfo&);
+ void testOnlyWillAddClientOrObserver(PreloadReferencePolicy policy) { willAddClientOrObserver(policy); }
Yoav Weiss 2016/09/13 09:33:18 Adding this test only method, since adding an actu
Nate Chapin 2016/09/13 22:34:17 ...this is all single threaded, isn't it? This exp
Charlie Harrison 2016/09/16 12:18:47 I think a "ForTesting" suffix is more common and I
Charlie Harrison 2016/09/16 12:31:38 Apologies this was a very out of date draft commen
+
protected:
Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698