Chromium Code Reviews| Index: third_party/WebKit/Source/core/fetch/Resource.cpp |
| diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp |
| index 50c6fed7a8020ca05270af05b5652ff6fdb0f03d..ca56cb2227ed855325baf89f93546d8046fcef78 100644 |
| --- a/third_party/WebKit/Source/core/fetch/Resource.cpp |
| +++ b/third_party/WebKit/Source/core/fetch/Resource.cpp |
| @@ -227,6 +227,8 @@ Resource::Resource(const ResourceRequest& request, Type type, const ResourceLoad |
| , m_needsSynchronousCacheHit(false) |
| , m_linkPreload(false) |
| { |
| + ThreadState::current()->registerPreFinalizer(this); |
| + |
| ASSERT(m_type == unsigned(type)); // m_type is a bitfield, so this tests careless updates of the enum. |
| InstanceCounters::incrementCounter(InstanceCounters::ResourceCounter); |
| @@ -240,9 +242,10 @@ Resource::~Resource() |
| InstanceCounters::decrementCounter(InstanceCounters::ResourceCounter); |
| } |
| -void Resource::removedFromMemoryCache() |
| +void Resource::willDestroyResource() |
| { |
| - InspectorInstrumentation::removedResourceFromMemoryCache(this); |
| + InspectorInstrumentation::willDestroyResource(this); |
|
dgozman
2016/04/26 23:58:50
Can we have a weak callback in WeakMember instead?
hiroshige
2016/04/28 08:06:33
using global collection in InspectorInstrumentatio
dgozman
2016/04/28 15:17:26
Nevermind. Go ahead with this patch, I will post a
|
| + willDestroyResourceInternal(); |
| } |
| DEFINE_TRACE(Resource) |