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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp

Issue 1802123002: Unify Resource loading status tracking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/InspectorPageAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
index a2b8831a2f464b468b31e1c486bbd11d7e58e986..fd16eb7c58f25656ceb64059235e155473cce76d 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
@@ -439,26 +439,12 @@ static void cachedResourcesForDocument(Document* document, WillBeHeapVector<RawP
if (!cachedResource)
continue;
- switch (cachedResource->getType()) {
- case Resource::Image:
- // Skip images that were not auto loaded (images disabled in the user agent).
- if (toImageResource(cachedResource)->stillNeedsLoad())
- continue;
- break;
- case Resource::Font:
- // Skip fonts that were referenced in CSS but never used/downloaded.
- if (toFontResource(cachedResource)->stillNeedsLoad())
- continue;
- break;
- case Resource::Raw:
- if (skipXHRs)
- continue;
- break;
- default:
- // All other Resource types download immediately.
- break;
- }
-
+ // Skip images that were not auto loaded (images disabled in the user agent),
+ // fonts that were referenced in CSS but never used/downloaded, etc.
+ if (cachedResource->stillNeedsLoad())
+ continue;
+ if (cachedResource->getType() == Resource::Raw && skipXHRs)
+ continue;
result.append(cachedResource);
}
}

Powered by Google App Engine
This is Rietveld 408576698