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

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

Issue 2454983002: Cache-aware Resource loading (Closed)
Patch Set: check synchronous policy Created 4 years, 1 month 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 d531ba9238a701cf07b63fb27007c78c9902ddf8..dbd67115c3bebef87107b1f2f1fc0a001d5d8367 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.h
+++ b/third_party/WebKit/Source/core/fetch/Resource.h
@@ -310,6 +310,17 @@ class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
virtual bool canReuse(const ResourceRequest&) const { return true; }
+ // If cache-aware loading is activated, this callback is called when the first
+ // disk-cache-only request failed due to cache miss.
+ virtual void willReloadAfterDiskCacheMiss() {}
kinuko 2016/11/08 06:10:18 nit/optional: This method naming feels a little w
Shao-Chuan Lee 2016/11/08 06:28:01 SGTM, but I wonder if it's better to mention "disk
kinuko 2016/11/08 06:42:15 Oh that's true, so maybe the current name is just
Shao-Chuan Lee 2016/11/08 07:19:06 Done, PTAL
+
+ // TODO(shaochuan): This is for saving back the actual ResourceRequest sent
+ // in ResourceFetcher::startLoad() for retry in cache-aware loading, remove
+ // once ResourceRequest is not modified in startLoad(). crbug.com/632580
+ void setResourceRequest(const ResourceRequest& resourceRequest) {
+ m_resourceRequest = resourceRequest;
+ }
+
// Used by the MemoryCache to reduce the memory consumption of the entry.
void prune();
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FetchRequest.h ('k') | third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698