| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 return Resource::TextTrack; | 184 return Resource::TextTrack; |
| 185 if (document && !as.isEmpty()) | 185 if (document && !as.isEmpty()) |
| 186 document->addConsoleMessage(ConsoleMessage::create(OtherMessageSource, W
arningMessageLevel, String("<link rel=preload> must have a valid `as` value"))); | 186 document->addConsoleMessage(ConsoleMessage::create(OtherMessageSource, W
arningMessageLevel, String("<link rel=preload> must have a valid `as` value"))); |
| 187 return Resource::LinkPreload; | 187 return Resource::LinkPreload; |
| 188 } | 188 } |
| 189 | 189 |
| 190 void LinkLoader::createLinkPreloadResourceClient(Resource* resource) | 190 void LinkLoader::createLinkPreloadResourceClient(Resource* resource) |
| 191 { | 191 { |
| 192 if (!resource) | 192 if (!resource) |
| 193 return; | 193 return; |
| 194 switch (resource->type()) { | 194 switch (resource->getType()) { |
| 195 case Resource::Image: | 195 case Resource::Image: |
| 196 m_linkPreloadResourceClient = LinkPreloadImageResourceClient::create(thi
s, toImageResource(resource)); | 196 m_linkPreloadResourceClient = LinkPreloadImageResourceClient::create(thi
s, toImageResource(resource)); |
| 197 break; | 197 break; |
| 198 case Resource::Script: | 198 case Resource::Script: |
| 199 m_linkPreloadResourceClient = LinkPreloadScriptResourceClient::create(th
is, toScriptResource(resource)); | 199 m_linkPreloadResourceClient = LinkPreloadScriptResourceClient::create(th
is, toScriptResource(resource)); |
| 200 break; | 200 break; |
| 201 case Resource::CSSStyleSheet: | 201 case Resource::CSSStyleSheet: |
| 202 m_linkPreloadResourceClient = LinkPreloadStyleResourceClient::create(thi
s, toCSSStyleSheetResource(resource)); | 202 m_linkPreloadResourceClient = LinkPreloadStyleResourceClient::create(thi
s, toCSSStyleSheetResource(resource)); |
| 203 break; | 203 break; |
| 204 case Resource::Font: | 204 case Resource::Font: |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 328 |
| 329 DEFINE_TRACE(LinkLoader) | 329 DEFINE_TRACE(LinkLoader) |
| 330 { | 330 { |
| 331 visitor->trace(m_client); | 331 visitor->trace(m_client); |
| 332 visitor->trace(m_prerender); | 332 visitor->trace(m_prerender); |
| 333 visitor->trace(m_linkPreloadResourceClient); | 333 visitor->trace(m_linkPreloadResourceClient); |
| 334 ResourceOwner<Resource, ResourceClient>::trace(visitor); | 334 ResourceOwner<Resource, ResourceClient>::trace(visitor); |
| 335 } | 335 } |
| 336 | 336 |
| 337 } // namespace blink | 337 } // namespace blink |
| OLD | NEW |