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

Unified Diff: third_party/WebKit/Source/core/fetch/Resource.cpp

Issue 1807323002: [WeakMemoryCache 1a] Make Reference from Inspector to Resource weak, remove removedFromMemoryCache() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove some comments Created 4 years, 7 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/Resource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp
index ff49288d3c89a16b80c715ef6e3e207f82c5b55a..177534ef53b9bedfdd91132a0c3cb3b9b63f33ac 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
@@ -226,6 +226,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);
@@ -239,9 +241,10 @@ Resource::~Resource()
InstanceCounters::decrementCounter(InstanceCounters::ResourceCounter);
}
-void Resource::removedFromMemoryCache()
+void Resource::willDestroyResource()
{
- InspectorInstrumentation::removedResourceFromMemoryCache(this);
+ InspectorInstrumentation::willDestroyResource(this);
+ willDestroyResourceInternal();
}
DEFINE_TRACE(Resource)
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698