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

Unified Diff: Source/core/loader/DocumentLoader.cpp

Issue 976263002: HTML Imports: Teach preloader about HTML Imports. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 6 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
« no previous file with comments | « Source/core/html/parser/PreloadRequest.cpp ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/DocumentLoader.cpp
diff --git a/Source/core/loader/DocumentLoader.cpp b/Source/core/loader/DocumentLoader.cpp
index ce0213cc2f7d55ced5e0293d4d37064e8cc5a621..538b97b3a3e1acad8c52c4e5fd7acd7bffa47683 100644
--- a/Source/core/loader/DocumentLoader.cpp
+++ b/Source/core/loader/DocumentLoader.cpp
@@ -145,14 +145,22 @@ const KURL& DocumentLoader::url() const
void DocumentLoader::startPreload(Resource::Type type, FetchRequest& request)
{
- ASSERT(type == Resource::Script || type == Resource::CSSStyleSheet || type == Resource::Image);
+ ASSERT(type == Resource::Script || type == Resource::CSSStyleSheet || type == Resource::Image || type == Resource::ImportResource);
ResourcePtr<Resource> resource;
- if (type == Resource::Image)
+ switch (type) {
+ case Resource::Image:
resource = ImageResource::fetch(request, fetcher());
- else if (type == Resource::Script)
+ break;
+ case Resource::Script:
resource = ScriptResource::fetch(request, fetcher());
- else
+ break;
+ case Resource::CSSStyleSheet:
resource = CSSStyleSheetResource::fetch(request, fetcher());
+ break;
+ default: // Resource::ImportResource
+ resource = RawResource::fetchImport(request, fetcher());
+ break;
+ }
if (resource)
fetcher()->preloadStarted(resource.get());
« no previous file with comments | « Source/core/html/parser/PreloadRequest.cpp ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698