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

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

Issue 424633002: Oilpan: Prepare to move Resource to Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: unregister -> register Created 6 years, 5 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
« no previous file with comments | « Source/core/fetch/MemoryCache.cpp ('k') | Source/core/fetch/Resource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « Source/core/fetch/MemoryCache.cpp ('k') | Source/core/fetch/Resource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698