| OLD | NEW |
| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 ResourceFetcher::determineRequestContext(resourceRequest, resourceType, fals
e); | 290 ResourceFetcher::determineRequestContext(resourceRequest, resourceType, fals
e); |
| 291 FetchRequest linkRequest(resourceRequest, FetchInitiatorTypeNames::link, doc
ument.encodingName()); | 291 FetchRequest linkRequest(resourceRequest, FetchInitiatorTypeNames::link, doc
ument.encodingName()); |
| 292 | 292 |
| 293 if (crossOrigin != CrossOriginAttributeNotSet) | 293 if (crossOrigin != CrossOriginAttributeNotSet) |
| 294 linkRequest.setCrossOriginAccessControl(document.getSecurityOrigin(), cr
ossOrigin); | 294 linkRequest.setCrossOriginAccessControl(document.getSecurityOrigin(), cr
ossOrigin); |
| 295 Settings* settings = document.settings(); | 295 Settings* settings = document.settings(); |
| 296 if (settings && settings->logPreload()) | 296 if (settings && settings->logPreload()) |
| 297 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource, De
bugMessageLevel, String("Preload triggered for " + href.host() + href.path()))); | 297 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource, De
bugMessageLevel, String("Preload triggered for " + href.host() + href.path()))); |
| 298 linkRequest.setForPreload(true, monotonicallyIncreasingTime()); | 298 linkRequest.setForPreload(true, monotonicallyIncreasingTime()); |
| 299 linkRequest.setLinkPreload(true); | 299 linkRequest.setLinkPreload(true); |
| 300 linkRequest.setPriority(document.fetcher()->loadPriority(resourceType, linkR
equest)); | 300 if (resourceType == Resource::LinkPreload) |
| 301 linkRequest.setDefer(FetchRequest::LazyLoad); |
| 301 return document.loader()->startPreload(resourceType, linkRequest); | 302 return document.loader()->startPreload(resourceType, linkRequest); |
| 302 } | 303 } |
| 303 | 304 |
| 304 void LinkLoader::loadLinksFromHeader(const String& headerValue, const KURL& base
URL, Document* document, const NetworkHintsInterface& networkHintsInterface, | 305 void LinkLoader::loadLinksFromHeader(const String& headerValue, const KURL& base
URL, Document* document, const NetworkHintsInterface& networkHintsInterface, |
| 305 CanLoadResources canLoadResources, ViewportDescriptionWrapper* viewportDescr
iptionWrapper) | 306 CanLoadResources canLoadResources, ViewportDescriptionWrapper* viewportDescr
iptionWrapper) |
| 306 { | 307 { |
| 307 if (!document || headerValue.isEmpty()) | 308 if (!document || headerValue.isEmpty()) |
| 308 return; | 309 return; |
| 309 LinkHeaderSet headerSet(headerValue); | 310 LinkHeaderSet headerSet(headerValue); |
| 310 for (auto& header : headerSet) { | 311 for (auto& header : headerSet) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 DEFINE_TRACE(LinkLoader) | 397 DEFINE_TRACE(LinkLoader) |
| 397 { | 398 { |
| 398 visitor->trace(m_client); | 399 visitor->trace(m_client); |
| 399 visitor->trace(m_prerender); | 400 visitor->trace(m_prerender); |
| 400 visitor->trace(m_linkPreloadResourceClient); | 401 visitor->trace(m_linkPreloadResourceClient); |
| 401 ResourceOwner<Resource, ResourceClient>::trace(visitor); | 402 ResourceOwner<Resource, ResourceClient>::trace(visitor); |
| 402 PrerenderClient::trace(visitor); | 403 PrerenderClient::trace(visitor); |
| 403 } | 404 } |
| 404 | 405 |
| 405 } // namespace blink | 406 } // namespace blink |
| OLD | NEW |