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

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

Issue 1569273004: Move ResourceOwner on to the oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win_chromium_compile_dbg_ng is the worst Created 4 years, 11 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/ResourceOwner.h
diff --git a/third_party/WebKit/Source/core/fetch/ResourceOwner.h b/third_party/WebKit/Source/core/fetch/ResourceOwner.h
index 20a464cfb347ff4b3a6d84617f3cd8bc2de6263c..69822c1f9ea8033943bdf13b8b561af88155d8e4 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceOwner.h
+++ b/third_party/WebKit/Source/core/fetch/ResourceOwner.h
@@ -37,22 +37,20 @@ namespace blink {
template<class R, class C = typename R::ClientType>
-class ResourceOwner : public C {
+class ResourceOwner : public WillBeGarbageCollectedMixin, public C {
public:
using ResourceType = R;
virtual ~ResourceOwner();
ResourceType* resource() const { return m_resource.get(); }
+ DEFINE_INLINE_VIRTUAL_TRACE() {}
+
protected:
ResourceOwner();
- ResourceOwner(const ResourceOwner& other) { setResource(other.resource()); }
- explicit ResourceOwner(const ResourcePtr<ResourceType>&);
void setResource(const ResourcePtr<ResourceType>&);
- void clearResource();
-
- ResourceOwner& operator=(const ResourceOwner& other);
+ void clearResource() { setResource(nullptr); }
private:
ResourcePtr<ResourceType> m_resource;
@@ -70,14 +68,6 @@ inline ResourceOwner<R, C>::~ResourceOwner()
}
template<class R, class C>
-inline ResourceOwner<R, C>::ResourceOwner(const ResourcePtr<R>& resource)
- : m_resource(resource)
-{
- if (m_resource)
- m_resource->addClient(this);
-}
-
-template<class R, class C>
inline void ResourceOwner<R, C>::setResource(const ResourcePtr<R>& newResource)
{
if (newResource == m_resource)
@@ -96,21 +86,6 @@ inline void ResourceOwner<R, C>::setResource(const ResourcePtr<R>& newResource)
}
}
-template<class R, class C>
-inline void ResourceOwner<R, C>::clearResource()
-{
- setResource(0);
-}
-
-template<class R, class C>
-inline ResourceOwner<R, C>& ResourceOwner<R, C>::operator=(const ResourceOwner<R, C>& other)
-{
- if (this == &other)
- return *this;
- setResource(other.resource());
- return *this;
-}
-
} // namespace blink
#endif
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.cpp ('k') | third_party/WebKit/Source/core/html/HTMLLinkElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698