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

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

Issue 1706083002: Split ImageResourceClient into ResourceClient and ImageResourceObserver [1/2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More consistent Client/Observer Created 4 years, 10 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/ImageResourceObserver.h
diff --git a/third_party/WebKit/Source/core/fetch/ImageResourceClient.h b/third_party/WebKit/Source/core/fetch/ImageResourceObserver.h
similarity index 77%
rename from third_party/WebKit/Source/core/fetch/ImageResourceClient.h
rename to third_party/WebKit/Source/core/fetch/ImageResourceObserver.h
index 32fac1ff9935ebe84ad0ecf0c57e5e25b19869f1..c21a8c564dd915a22d09a5f45b2cde7e97af2869 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResourceClient.h
+++ b/third_party/WebKit/Source/core/fetch/ImageResourceObserver.h
@@ -20,23 +20,21 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef ImageResourceClient_h
-#define ImageResourceClient_h
+#ifndef ImageResourceObserver_h
+#define ImageResourceObserver_h
#include "core/CoreExport.h"
-#include "core/fetch/ResourceClient.h"
#include "platform/graphics/ImageAnimationPolicy.h"
+#include "platform/network/ResourceLoadPriority.h"
namespace blink {
class ImageResource;
class IntRect;
-class CORE_EXPORT ImageResourceClient : public ResourceClient {
+class CORE_EXPORT ImageResourceObserver {
public:
- ~ImageResourceClient() override {}
- static bool isExpectedType(ResourceClient* client) { return client->resourceClientType() == ImageType; }
- ResourceClientType resourceClientType() const final { return ImageType; }
+ virtual ~ImageResourceObserver() {}
// Called whenever a frame of an image changes, either because we got more data from the network or
// because we are animating. If not null, the IntRect is the changed rect of the image.
@@ -46,10 +44,14 @@ public:
// can halt animation. Content nodes that hold image refs for example would not render the image,
// but LayoutImages would (assuming they have visibility: visible and their layout tree isn't hidden
// e.g., in the b/f cache or in a background tab).
- virtual bool willRenderImage(ImageResource*) { return false; }
+ virtual bool willRenderImage() { return false; }
// Called to get imageAnimation policy from settings
- virtual bool getImageAnimationPolicy(ImageResource*, ImageAnimationPolicy&) { return false; }
+ virtual bool getImageAnimationPolicy(ImageAnimationPolicy&) { return false; }
+
+ virtual ResourcePriority computeResourcePriority() const { return ResourcePriority(); }
+
+ static bool isExpectedType(ImageResourceObserver*) { return true; }
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698