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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 ResourceRequest resourceRequest(document.completeURL(href)); | 289 ResourceRequest resourceRequest(document.completeURL(href)); |
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 linkRequest.setPriority(document.fetcher()->loadPriority(resourceType, linkR
equest)); | 293 linkRequest.setPriority(document.fetcher()->loadPriority(resourceType, linkR
equest)); |
294 if (crossOrigin != CrossOriginAttributeNotSet) | 294 if (crossOrigin != CrossOriginAttributeNotSet) |
295 linkRequest.setCrossOriginAccessControl(document.getSecurityOrigin(), cr
ossOrigin); | 295 linkRequest.setCrossOriginAccessControl(document.getSecurityOrigin(), cr
ossOrigin); |
296 Settings* settings = document.settings(); | 296 Settings* settings = document.settings(); |
297 if (settings && settings->logPreload()) | 297 if (settings && settings->logPreload()) |
298 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource, De
bugMessageLevel, String("Preload triggered for " + href.host() + href.path()))); | 298 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource, De
bugMessageLevel, String("Preload triggered for " + href.host() + href.path()))); |
299 linkRequest.setForPreload(true); | 299 linkRequest.setForPreload(true, monotonicallyIncreasingTime()); |
300 linkRequest.setLinkPreload(true); | 300 linkRequest.setLinkPreload(true); |
301 return document.loader()->startPreload(resourceType, linkRequest); | 301 return document.loader()->startPreload(resourceType, linkRequest); |
302 } | 302 } |
303 | 303 |
304 void LinkLoader::loadLinksFromHeader(const String& headerValue, const KURL& base
URL, Document* document, const NetworkHintsInterface& networkHintsInterface, | 304 void LinkLoader::loadLinksFromHeader(const String& headerValue, const KURL& base
URL, Document* document, const NetworkHintsInterface& networkHintsInterface, |
305 CanLoadResources canLoadResources, ViewportDescriptionWrapper* viewportDescr
iptionWrapper) | 305 CanLoadResources canLoadResources, ViewportDescriptionWrapper* viewportDescr
iptionWrapper) |
306 { | 306 { |
307 if (!document || headerValue.isEmpty()) | 307 if (!document || headerValue.isEmpty()) |
308 return; | 308 return; |
309 LinkHeaderSet headerSet(headerValue); | 309 LinkHeaderSet headerSet(headerValue); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 DEFINE_TRACE(LinkLoader) | 393 DEFINE_TRACE(LinkLoader) |
394 { | 394 { |
395 visitor->trace(m_client); | 395 visitor->trace(m_client); |
396 visitor->trace(m_prerender); | 396 visitor->trace(m_prerender); |
397 visitor->trace(m_linkPreloadResourceClient); | 397 visitor->trace(m_linkPreloadResourceClient); |
398 ResourceOwner<Resource, ResourceClient>::trace(visitor); | 398 ResourceOwner<Resource, ResourceClient>::trace(visitor); |
399 PrerenderClient::trace(visitor); | 399 PrerenderClient::trace(visitor); |
400 } | 400 } |
401 | 401 |
402 } // namespace blink | 402 } // namespace blink |
OLD | NEW |