| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 // TODO(yoav): Convert all uses of the CrossOriginAttribute to CrossOriginAt
tributeValue. crbug.com/486689 | 213 // TODO(yoav): Convert all uses of the CrossOriginAttribute to CrossOriginAt
tributeValue. crbug.com/486689 |
| 214 // FIXME(crbug.com/463266): We're ignoring type here. Maybe we shouldn't. | 214 // FIXME(crbug.com/463266): We're ignoring type here. Maybe we shouldn't. |
| 215 dnsPrefetchIfNeeded(relAttribute, href, document); | 215 dnsPrefetchIfNeeded(relAttribute, href, document); |
| 216 | 216 |
| 217 preconnectIfNeeded(relAttribute, href, document, crossOriginAttributeValue(c
rossOriginMode)); | 217 preconnectIfNeeded(relAttribute, href, document, crossOriginAttributeValue(c
rossOriginMode)); |
| 218 | 218 |
| 219 if (m_client->shouldLoadLink()) | 219 if (m_client->shouldLoadLink()) |
| 220 preloadIfNeeded(relAttribute, href, document, as); | 220 preloadIfNeeded(relAttribute, href, document, as); |
| 221 | 221 |
| 222 // FIXME(crbug.com/323096): Should take care of import. | 222 // FIXME(crbug.com/323096): Should take care of import. |
| 223 if ((relAttribute.isLinkPrefetch() || relAttribute.isLinkSubresource() || re
lAttribute.isTransitionExitingStylesheet()) && href.isValid() && document.frame(
)) { | 223 if ((relAttribute.isLinkPrefetch() || relAttribute.isLinkSubresource()) && h
ref.isValid() && document.frame()) { |
| 224 if (!m_client->shouldLoadLink()) | 224 if (!m_client->shouldLoadLink()) |
| 225 return false; | 225 return false; |
| 226 Resource::Type type = relAttribute.isLinkSubresource() ? Resource::Link
Subresource : Resource::LinkPrefetch; | 226 Resource::Type type = relAttribute.isLinkSubresource() ? Resource::Link
Subresource : Resource::LinkPrefetch; |
| 227 FetchRequest linkRequest(ResourceRequest(document.completeURL(href)), Fe
tchInitiatorTypeNames::link); | 227 FetchRequest linkRequest(ResourceRequest(document.completeURL(href)), Fe
tchInitiatorTypeNames::link); |
| 228 if (!crossOriginMode.isNull()) | 228 if (!crossOriginMode.isNull()) |
| 229 linkRequest.setCrossOriginAccessControl(document.securityOrigin(), c
rossOriginMode); | 229 linkRequest.setCrossOriginAccessControl(document.securityOrigin(), c
rossOriginMode); |
| 230 setResource(document.fetcher()->fetchLinkResource(type, linkRequest)); | 230 setResource(document.fetcher()->fetchLinkResource(type, linkRequest)); |
| 231 } | 231 } |
| 232 | 232 |
| 233 if (const unsigned prerenderRelTypes = prerenderRelTypesFromRelAttribute(rel
Attribute)) { | 233 if (const unsigned prerenderRelTypes = prerenderRelTypesFromRelAttribute(rel
Attribute)) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 254 m_prerender.clear(); | 254 m_prerender.clear(); |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 | 257 |
| 258 DEFINE_TRACE(LinkLoader) | 258 DEFINE_TRACE(LinkLoader) |
| 259 { | 259 { |
| 260 visitor->trace(m_prerender); | 260 visitor->trace(m_prerender); |
| 261 } | 261 } |
| 262 | 262 |
| 263 } | 263 } |
| OLD | NEW |