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

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

Issue 1667843003: Make Resource RefCountedWillBeGarbageCollectedFinalized, attempt #2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + address review comments 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/ImageResource.h
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.h b/third_party/WebKit/Source/core/fetch/ImageResource.h
index 3079282176c3f4ce007068facc755fbed30447c8..666029f59981204235bf659c2323e91c0e867fab 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.h
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.h
@@ -24,7 +24,7 @@
#define ImageResource_h
#include "core/CoreExport.h"
-#include "core/fetch/ResourcePtr.h"
+#include "core/fetch/Resource.h"
#include "platform/geometry/IntRect.h"
#include "platform/geometry/IntSizeHash.h"
#include "platform/geometry/LayoutSize.h"
@@ -48,11 +48,20 @@ class CORE_EXPORT ImageResource final : public Resource, public ImageObserver {
public:
using ClientType = ImageResourceClient;
- static ResourcePtr<ImageResource> fetch(FetchRequest&, ResourceFetcher*);
+ static PassRefPtrWillBeRawPtr<ImageResource> fetch(FetchRequest&, ResourceFetcher*);
+
+ static PassRefPtrWillBeRawPtr<ImageResource> create(blink::Image* image)
+ {
+ return adoptRefWillBeNoop(new ImageResource(image));
+ }
- ImageResource(blink::Image*);
// Exposed for testing
- ImageResource(const ResourceRequest&, blink::Image*);
+ static PassRefPtrWillBeRawPtr<ImageResource> create(const ResourceRequest& request, blink::Image* image)
+ {
+ return adoptRefWillBeNoop(new ImageResource(request, image));
+ }
+
+
~ImageResource() override;
void load(ResourceFetcher*, const ResourceLoaderOptions&) override;
@@ -118,14 +127,17 @@ protected:
void destroyDecodedDataForFailedRevalidation() override;
private:
+ explicit ImageResource(blink::Image*);
+ ImageResource(const ResourceRequest&, blink::Image*);
+
class ImageResourceFactory : public ResourceFactory {
public:
ImageResourceFactory()
: ResourceFactory(Resource::Image) { }
- Resource* create(const ResourceRequest& request, const String&) const override
+ PassRefPtrWillBeRawPtr<Resource> create(const ResourceRequest& request, const String&) const override
{
- return new ImageResource(request);
+ return adoptRefWillBeNoop(new ImageResource(request));
}
};
ImageResource(const ResourceRequest&);
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FontResource.cpp ('k') | third_party/WebKit/Source/core/fetch/ImageResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698