Index: Source/core/fetch/Resource.h |
diff --git a/Source/core/fetch/Resource.h b/Source/core/fetch/Resource.h |
index 7bf7326e0742cee313914c41eb43d97965f7cf59..635bcc5ab67d6f57ccb5a75114184cd8d3a9a0ab 100644 |
--- a/Source/core/fetch/Resource.h |
+++ b/Source/core/fetch/Resource.h |
@@ -53,8 +53,8 @@ class SharedBuffer; |
// A resource that is held in the cache. Classes who want to use this object should derive |
// from ResourceClient, to get the function calls in case the requested data has arrived. |
// This class also does the actual communication with the loader to obtain the resource from the network. |
-class Resource { |
- WTF_MAKE_NONCOPYABLE(Resource); WTF_MAKE_FAST_ALLOCATED; |
+class Resource : public NoBaseWillBeGarbageCollectedFinalized<Resource> { |
+ WTF_MAKE_NONCOPYABLE(Resource); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
friend class InspectorResource; |
public: |
@@ -83,8 +83,16 @@ public: |
}; |
Resource(const ResourceRequest&, Type); |
+#if ENABLE(OILPAN) |
virtual ~Resource(); |
+#else |
+protected: |
+ // Only deleteIfPossible should delete this. |
+ virtual ~Resource(); |
+public: |
+#endif |
virtual void dispose(); |
+ virtual void trace(Visitor*); |
virtual void load(ResourceFetcher*, const ResourceLoaderOptions&); |
@@ -378,10 +386,10 @@ private: |
// using HTTP If-Modified-Since/If-None-Match headers. If the response is 304 all clients of this resource are moved |
// to to be clients of m_resourceToRevalidate and the resource is deleted. If not, the field is zeroed and this |
// resources becomes normal resource load. |
- Resource* m_resourceToRevalidate; |
+ RawPtrWillBeMember<Resource> m_resourceToRevalidate; |
// If this field is non-null, the resource has a proxy for checking whether it is still up to date (see m_resourceToRevalidate). |
- Resource* m_proxyResource; |
+ RawPtrWillBeMember<Resource> m_proxyResource; |
// These handles will need to be updated to point to the m_resourceToRevalidate in case we get 304 response. |
HashSet<ResourcePtrBase*> m_handlesToRevalidate; |