Chromium Code Reviews

Unified Diff: trunk/Source/core/fetch/ResourceOwner.h

Issue 283333002: Revert 174019 "Make ScriptLoader into a ResourceOwner" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « trunk/Source/core/dom/ScriptLoader.cpp ('k') | trunk/Source/core/html/parser/HTMLScriptRunner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/core/fetch/ResourceOwner.h
===================================================================
--- trunk/Source/core/fetch/ResourceOwner.h (revision 174070)
+++ trunk/Source/core/fetch/ResourceOwner.h (working copy)
@@ -46,22 +46,20 @@
protected:
ResourceOwner();
- ResourceOwner(const ResourceOwner& other) { setResource(other.resource(), other.m_subscribing); }
+ ResourceOwner(const ResourceOwner& other) { setResource(other.resource()); }
explicit ResourceOwner(const ResourcePtr<ResourceType>&);
- void setResource(const ResourcePtr<ResourceType>&, bool subscribing = true);
+ void setResource(const ResourcePtr<ResourceType>&);
void clearResource();
ResourceOwner& operator=(const ResourceOwner& other);
private:
ResourcePtr<ResourceType> m_resource;
- bool m_subscribing;
};
template<class R, class C>
inline ResourceOwner<R, C>::ResourceOwner()
- : m_subscribing(false)
{
}
@@ -80,7 +78,7 @@
}
template<class R, class C>
-inline void ResourceOwner<R, C>::setResource(const ResourcePtr<R>& newResource, bool subscribe)
+inline void ResourceOwner<R, C>::setResource(const ResourcePtr<R>& newResource)
{
if (newResource == m_resource)
return;
@@ -89,15 +87,12 @@
// we need to prevent double removal.
if (ResourcePtr<ResourceType> oldResource = m_resource) {
m_resource.clear();
- if (m_subscribing)
- oldResource->removeClient(this);
+ oldResource->removeClient(this);
}
if (newResource) {
- m_subscribing = subscribe;
m_resource = newResource;
- if (m_subscribing)
- m_resource->addClient(this);
+ m_resource->addClient(this);
}
}
@@ -112,7 +107,7 @@
{
if (this == &other)
return *this;
- setResource(other.resource(), other.m_subscribing);
+ setResource(other.resource());
return *this;
}
« no previous file with comments | « trunk/Source/core/dom/ScriptLoader.cpp ('k') | trunk/Source/core/html/parser/HTMLScriptRunner.h » ('j') | no next file with comments »

Powered by Google App Engine