| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 errorOccurred = true; | 281 errorOccurred = true; |
| 282 return nullptr; | 282 return nullptr; |
| 283 } | 283 } |
| 284 | 284 |
| 285 if (!isSupportedType(resourceType, mimeType)) { | 285 if (!isSupportedType(resourceType, mimeType)) { |
| 286 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource, Wa
rningMessageLevel, String("<link rel=preload> has an unsupported `type` value"))
); | 286 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource, Wa
rningMessageLevel, String("<link rel=preload> has an unsupported `type` value"))
); |
| 287 return nullptr; | 287 return nullptr; |
| 288 } | 288 } |
| 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); | 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); |
| 300 linkRequest.setLinkPreload(true); | 300 linkRequest.setLinkPreload(true); |
| 301 return document.loader()->startPreload(resourceType, linkRequest); | 301 return document.loader()->startPreload(resourceType, linkRequest); |
| (...skipping 91 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 |