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

Side by Side Diff: third_party/WebKit/Source/core/loader/LinkLoader.cpp

Issue 2797423003: Remove ResourceFetcher::preloads (Closed)
Patch Set: fix Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 } else if (as == "font") { 202 } else if (as == "font") {
203 return Resource::Font; 203 return Resource::Font;
204 } else if (as == "track") { 204 } else if (as == "track") {
205 return Resource::TextTrack; 205 return Resource::TextTrack;
206 } else if (as.isEmpty()) { 206 } else if (as.isEmpty()) {
207 return Resource::Raw; 207 return Resource::Raw;
208 } 208 }
209 return WTF::nullopt; 209 return WTF::nullopt;
210 } 210 }
211 211
212 Resource* LinkLoader::linkPreloadedResourceForTesting() {
213 return m_linkPreloadResourceClient ? m_linkPreloadResourceClient->resource()
214 : nullptr;
215 }
216
212 void LinkLoader::createLinkPreloadResourceClient(Resource* resource) { 217 void LinkLoader::createLinkPreloadResourceClient(Resource* resource) {
213 if (!resource) 218 if (!resource)
214 return; 219 return;
215 switch (resource->getType()) { 220 switch (resource->getType()) {
216 case Resource::Image: 221 case Resource::Image:
217 m_linkPreloadResourceClient = LinkPreloadImageResourceClient::create( 222 m_linkPreloadResourceClient = LinkPreloadImageResourceClient::create(
218 this, toImageResource(resource)); 223 this, toImageResource(resource));
219 break; 224 break;
220 case Resource::Script: 225 case Resource::Script:
221 m_linkPreloadResourceClient = LinkPreloadScriptResourceClient::create( 226 m_linkPreloadResourceClient = LinkPreloadScriptResourceClient::create(
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 496
492 DEFINE_TRACE(LinkLoader) { 497 DEFINE_TRACE(LinkLoader) {
493 visitor->trace(m_client); 498 visitor->trace(m_client);
494 visitor->trace(m_prerender); 499 visitor->trace(m_prerender);
495 visitor->trace(m_linkPreloadResourceClient); 500 visitor->trace(m_linkPreloadResourceClient);
496 ResourceOwner<Resource, ResourceClient>::trace(visitor); 501 ResourceOwner<Resource, ResourceClient>::trace(visitor);
497 PrerenderClient::trace(visitor); 502 PrerenderClient::trace(visitor);
498 } 503 }
499 504
500 } // namespace blink 505 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/LinkLoader.h ('k') | third_party/WebKit/Source/core/loader/LinkLoaderTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698