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

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

Issue 1706083002: Split ImageResourceClient into ResourceClient and ImageResourceObserver [1/2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit refine. Created 4 years, 10 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/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
index 78209dbb46d61d801b73d75040e6194dbcb6ba14..276a36960db47d874a52b4aedcbe7908d8277856 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -421,7 +421,7 @@ PassRefPtrWillBeRawPtr<Resource> ResourceFetcher::requestResource(FetchRequest&
// would be dead if MemoryCache holds weak references to Resource).
// Currently we check references to Resource from ResourceClient and
// |m_preloads| only, because they are major sources of references.
- if (resource && !resource->hasClients() && (!m_preloads || !m_preloads->contains(resource)) && !isStaticData) {
+ if (resource && !resource->hasClientsOrObservers() && (!m_preloads || !m_preloads->contains(resource)) && !isStaticData) {
DEFINE_RESOURCE_HISTOGRAM("Dead.");
}
@@ -447,7 +447,7 @@ PassRefPtrWillBeRawPtr<Resource> ResourceFetcher::requestResource(FetchRequest&
return nullptr;
}
- if (!resource->hasClients())
+ if (!resource->hasClientsOrObservers())
m_deadStatsRecorder.update(policy);
if (policy != Use)
@@ -1085,7 +1085,7 @@ void ResourceFetcher::updateAllImageResourcePriorities()
if (!resource->isImage())
continue;
- ResourcePriority resourcePriority = resource->priorityFromClients();
+ ResourcePriority resourcePriority = resource->priorityFromObservers();
ResourceLoadPriority resourceLoadPriority = loadPriority(Resource::Image, FetchRequest(resource->resourceRequest(), FetchInitiatorInfo()), resourcePriority.visibility);
if (resourceLoadPriority == resource->resourceRequest().priority())
continue;

Powered by Google App Engine
This is Rietveld 408576698