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

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

Issue 2510883003: Loading: remove dependencies from ResourceFetcher to ImageResource (Closed)
Patch Set: rebase ResourceFetcher.cpp Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 85003f3c0830ee7e5dfe485e7f1a291eb65c371b..06ff9042141d58228c3432b57e725d6085dfb4f6 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -30,7 +30,6 @@
#include "bindings/core/v8/V8DOMActivityLogger.h"
#include "core/fetch/FetchContext.h"
#include "core/fetch/FetchInitiatorTypeNames.h"
-#include "core/fetch/ImageResource.h"
#include "core/fetch/MemoryCache.h"
#include "core/fetch/ResourceLoader.h"
#include "core/fetch/ResourceLoadingLog.h"
@@ -1116,10 +1115,7 @@ ResourceTimingInfo* ResourceFetcher::getNavigationTimingInfo() {
void ResourceFetcher::handleLoadCompletion(Resource* resource) {
context().didLoadResource(resource);
- if (resource->isImage() &&
- toImageResource(resource)->shouldReloadBrokenPlaceholder()) {
- toImageResource(resource)->reloadIfLoFiOrPlaceholder(this);
- }
+ resource->reloadIfLoFiOrPlaceholderImage(this, Resource::kReloadIfNeeded);
}
void ResourceFetcher::handleLoaderFinish(Resource* resource,
@@ -1312,10 +1308,8 @@ void ResourceFetcher::updateAllImageResourcePriorities() {
void ResourceFetcher::reloadLoFiImages() {
for (const auto& documentResource : m_documentResources) {
Resource* resource = documentResource.value.get();
- if (resource && resource->isImage()) {
- ImageResource* imageResource = toImageResource(resource);
- imageResource->reloadIfLoFiOrPlaceholder(this);
- }
+ if (resource)
+ resource->reloadIfLoFiOrPlaceholderImage(this, Resource::kReloadAlways);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698