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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorResourceAgent.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: Created 4 years, 8 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/inspector/InspectorResourceAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp
index 5e2c53b04c0afcd7d7321210e9efe23985536b10..29f46bebaf01990e2124d4a9f617c82d650a814b 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp
@@ -569,7 +569,7 @@ void InspectorResourceAgent::didReceiveResourceResponse(LocalFrame* frame, unsig
// and removed in removedResourceFromMemoryCache(), so if the Resource isn't
Nate Chapin 2016/04/26 17:32:20 Looks like this comment needs to be updated or rem
hiroshige 2016/04/28 08:06:33 Done.
// in the cache here, NetworkResourceData's strong reference to the
// Resource will keep it alive indefinitely.
- if (cachedResource && memoryCache()->contains(cachedResource))
+ if (cachedResource)
m_resourcesData->addResource(requestId, cachedResource);
String frameId = IdentifiersFactory::frameId(frame);
String loaderId = loader ? IdentifiersFactory::loaderId(loader) : "";
@@ -753,7 +753,7 @@ void InspectorResourceAgent::didFinishEventSourceRequest(ThreadableLoaderClient*
m_pendingRequest = nullptr;
}
-void InspectorResourceAgent::removedResourceFromMemoryCache(Resource* cachedResource)
+void InspectorResourceAgent::willDestroyResource(Resource* cachedResource)
{
// Mark loaded resources or resources without the buffer as loaded.
if (cachedResource->isLoaded() || !cachedResource->resourceBuffer()) {

Powered by Google App Engine
This is Rietveld 408576698