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

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: Rebase. Created 4 years, 9 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 75%
rename from third_party/WebKit/Source/core/fetch/ImageResourceClient.h
rename to third_party/WebKit/Source/core/fetch/ImageResourceObserver.h
index cc69a3dc60abbfe4617f1c9da33f3b104b76bb5b..9a002c477c12100c035465e2c87e7df94b32d336 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResourceClient.h
+++ b/third_party/WebKit/Source/core/fetch/ImageResourceObserver.h
@@ -20,23 +20,22 @@
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"
+#include "wtf/Forward.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->getResourceClientType() == ImageType; }
- ResourceClientType getResourceClientType() 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 +45,17 @@ 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(); }
+
+ // Name for debugging, e.g. shown in memory-infra.
+ virtual String debugName() const = 0;
+
+ static bool isExpectedType(ImageResourceObserver*) { return true; }
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResourceClient.h ('k') | third_party/WebKit/Source/core/fetch/ImageResourceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698