| 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 return nullptr; | 318 return nullptr; |
| 319 } | 319 } |
| 320 | 320 |
| 321 if (!IsSupportedType(resource_type.value(), mime_type)) { | 321 if (!IsSupportedType(resource_type.value(), mime_type)) { |
| 322 document.AddConsoleMessage(ConsoleMessage::Create( | 322 document.AddConsoleMessage(ConsoleMessage::Create( |
| 323 kOtherMessageSource, kWarningMessageLevel, | 323 kOtherMessageSource, kWarningMessageLevel, |
| 324 String("<link rel=preload> has an unsupported `type` value"))); | 324 String("<link rel=preload> has an unsupported `type` value"))); |
| 325 return nullptr; | 325 return nullptr; |
| 326 } | 326 } |
| 327 ResourceRequest resource_request(document.CompleteURL(href)); | 327 ResourceRequest resource_request(document.CompleteURL(href)); |
| 328 resource_request.SetRequestContext( | 328 resource_request.SetRequestContext(ResourceFetcher::DetermineRequestContext( |
| 329 ResourceFetcher::DetermineRequestContext(resource_type.value(), false)); | 329 resource_type.value(), ResourceFetcher::kImageNotImageSet, false)); |
| 330 | 330 |
| 331 if (referrer_policy != kReferrerPolicyDefault) { | 331 if (referrer_policy != kReferrerPolicyDefault) { |
| 332 resource_request.SetHTTPReferrer(SecurityPolicy::GenerateReferrer( | 332 resource_request.SetHTTPReferrer(SecurityPolicy::GenerateReferrer( |
| 333 referrer_policy, href, document.OutgoingReferrer())); | 333 referrer_policy, href, document.OutgoingReferrer())); |
| 334 } | 334 } |
| 335 | 335 |
| 336 FetchParameters link_fetch_params( | 336 FetchParameters link_fetch_params( |
| 337 resource_request, FetchInitiatorTypeNames::link, document.EncodingName()); | 337 resource_request, FetchInitiatorTypeNames::link, document.EncodingName()); |
| 338 | 338 |
| 339 if (cross_origin != kCrossOriginAttributeNotSet) { | 339 if (cross_origin != kCrossOriginAttributeNotSet) { |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 | 498 |
| 499 DEFINE_TRACE(LinkLoader) { | 499 DEFINE_TRACE(LinkLoader) { |
| 500 visitor->Trace(client_); | 500 visitor->Trace(client_); |
| 501 visitor->Trace(prerender_); | 501 visitor->Trace(prerender_); |
| 502 visitor->Trace(link_preload_resource_client_); | 502 visitor->Trace(link_preload_resource_client_); |
| 503 ResourceOwner<Resource, ResourceClient>::Trace(visitor); | 503 ResourceOwner<Resource, ResourceClient>::Trace(visitor); |
| 504 PrerenderClient::Trace(visitor); | 504 PrerenderClient::Trace(visitor); |
| 505 } | 505 } |
| 506 | 506 |
| 507 } // namespace blink | 507 } // namespace blink |
| OLD | NEW |