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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
187 | 187 |
188 WTF::Optional<Resource::Type> LinkLoader::getResourceTypeFromAsAttribute( | 188 WTF::Optional<Resource::Type> LinkLoader::getResourceTypeFromAsAttribute( |
189 const String& as) { | 189 const String& as) { |
190 DCHECK_EQ(as.lower(), as); | 190 DCHECK_EQ(as.lower(), as); |
191 if (as == "image") { | 191 if (as == "image") { |
192 return Resource::Image; | 192 return Resource::Image; |
193 } else if (as == "script") { | 193 } else if (as == "script") { |
194 return Resource::Script; | 194 return Resource::Script; |
195 } else if (as == "style") { | 195 } else if (as == "style") { |
196 return Resource::CSSStyleSheet; | 196 return Resource::CSSStyleSheet; |
197 } else if (as == "media") { | 197 } else if (as == "video") { |
198 return Resource::Media; | 198 return Resource::Media; |
199 } else if (as == "audio") { | |
200 return Resource::Media; | |
201 } else if (as == "track") { | |
droger
2017/03/23 12:47:26
drive-by: this code is duplicated on line 205 belo
Yoav Weiss
2017/03/23 13:57:54
oops!
| |
202 return Resource::TextTrack; | |
199 } else if (as == "font") { | 203 } else if (as == "font") { |
200 return Resource::Font; | 204 return Resource::Font; |
201 } else if (as == "track") { | 205 } else if (as == "track") { |
202 return Resource::TextTrack; | 206 return Resource::TextTrack; |
203 } else if (as.isEmpty()) { | 207 } else if (as.isEmpty()) { |
204 return Resource::Raw; | 208 return Resource::Raw; |
205 } | 209 } |
206 return WTF::nullopt; | 210 return WTF::nullopt; |
207 } | 211 } |
208 | 212 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
488 | 492 |
489 DEFINE_TRACE(LinkLoader) { | 493 DEFINE_TRACE(LinkLoader) { |
490 visitor->trace(m_client); | 494 visitor->trace(m_client); |
491 visitor->trace(m_prerender); | 495 visitor->trace(m_prerender); |
492 visitor->trace(m_linkPreloadResourceClient); | 496 visitor->trace(m_linkPreloadResourceClient); |
493 ResourceOwner<Resource, ResourceClient>::trace(visitor); | 497 ResourceOwner<Resource, ResourceClient>::trace(visitor); |
494 PrerenderClient::trace(visitor); | 498 PrerenderClient::trace(visitor); |
495 } | 499 } |
496 | 500 |
497 } // namespace blink | 501 } // namespace blink |
OLD | NEW |