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

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

Issue 2390583002: [WIP] WebFonts cache-aware timeout adaption (Closed)
Patch Set: remove flag in finish() instead of responseReceived() Created 4 years, 2 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 08f24c01b62c5fa797af8745a5788313364e4668..d804ce47471877b0e09cff3d83f274a94fd6afff 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.h
+++ b/third_party/WebKit/Source/core/fetch/Resource.h
@@ -35,6 +35,7 @@
#include "platform/network/ResourceResponse.h"
#include "platform/scheduler/CancellableTaskFactory.h"
#include "platform/web_process_memory_dump.h"
+#include "public/platform/WebCachePolicy.h"
#include "public/platform/WebDataConsumerHandle.h"
#include "wtf/Allocator.h"
#include "wtf/HashCountedSet.h"
@@ -286,6 +287,17 @@ class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
virtual bool canReuse(const ResourceRequest&) const { return true; }
+ // If cache-aware loading is activated, this is called when the first
+ // disk-cache-only request failed due to cache miss. Calls to addClient() and
+ // removeClient() is forbidden in ResourceClient callbacks to prevent
+ // potential race issues.
+ virtual void willReloadAfterDiskCacheMiss();
+
+ // TODO(632580): Workaround to persist cache-aware state, remove after fixed.
+ void setResourceRequest(const ResourceRequest& resourceRequest) {
+ m_resourceRequest = resourceRequest;
+ }
+
// Used by the MemoryCache to reduce the memory consumption of the entry.
void prune();
@@ -409,6 +421,8 @@ class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
bool m_isRevalidating : 1;
bool m_isAlive : 1;
+ bool m_isAddRemoveClientProhibited : 1;
+
// Ordered list of all redirects followed while fetching this resource.
Vector<RedirectPair> m_redirectChain;

Powered by Google App Engine
This is Rietveld 408576698