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

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

Issue 2527353002: Phase II Step 3: Reload LoFi/placeholder images via new ImageResource
Patch Set: reloadLoFiImages test Created 4 years 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 22156e870a5b175f8344bbc590c731bc1962495c..8dec08cf8da49989e254802c776107251b7e46b3 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.h
+++ b/third_party/WebKit/Source/core/fetch/Resource.h
@@ -116,7 +116,9 @@ class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
virtual void setEncoding(const String&) {}
virtual String encoding() const { return String(); }
virtual void appendData(const char*, size_t);
- virtual void error(const ResourceError&);
+ // LoFi images can be reloaded using |fetcherForReload| (if non-null).
+ virtual void error(const ResourceError&,
+ ResourceFetcher* fetcherForReload = nullptr);
virtual void setCORSFailed() {}
void setNeedsSynchronousCacheHit(bool needsSynchronousCacheHit) {
@@ -211,7 +213,9 @@ class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
// Computes the status of an object after loading. Updates the expire date on
// the cache entry file
- virtual void finish(double finishTime);
+ // LoFi images can be reloaded using |fetcherForReload| (if non-null).
+ virtual void finish(double finishTime,
+ ResourceFetcher* fetcherForReload = nullptr);
void finish() { finish(0.0); }
// FIXME: Remove the stringless variant once all the callsites' error messages
@@ -344,8 +348,14 @@ class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
// If this Resource is ImageResource and has the Lo-Fi response headers or is
// a placeholder, reload the full original image with the Lo-Fi state set to
// off and optionally bypassing the cache.
- virtual void reloadIfLoFiOrPlaceholderImage(ResourceFetcher*,
- ReloadLoFiOrPlaceholderPolicy) {}
+ // If reloading is started, this method returns a new Resource that is used
+ // for reloading, and |this| should be no longer used.
+ // Otherwise, this method returns nullptr.
+ virtual Resource* reloadIfLoFiOrPlaceholderImage(
Nate Chapin 2016/12/28 00:14:57 Can we delete this from Resource entirely? It seem
hiroshige 2016/12/28 01:04:21 This virtual method would remain after this CL for
+ ResourceFetcher*,
+ ReloadLoFiOrPlaceholderPolicy) {
+ return nullptr;
+ }
static const char* resourceTypeToString(Type, const FetchInitiatorInfo&);
@@ -401,10 +411,6 @@ class CORE_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
return m_clients;
}
- void setCachePolicyBypassingCache();
- void setLoFiStateOff();
- void clearRangeRequestHeader();
-
SharedBuffer* data() const { return m_data.get(); }
void clearData();

Powered by Google App Engine
This is Rietveld 408576698