| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 { | 187 { |
| 188 DEFINE_STATIC_LOCAL(const String, codecs, (ASCIILiteral("codecs"))); | 188 DEFINE_STATIC_LOCAL(const String, codecs, (ASCIILiteral("codecs"))); |
| 189 | 189 |
| 190 String contentMIMEType = contentType.type().lower(); | 190 String contentMIMEType = contentType.type().lower(); |
| 191 String contentTypeCodecs = contentType.parameter(codecs); | 191 String contentTypeCodecs = contentType.parameter(codecs); |
| 192 | 192 |
| 193 // If the MIME type is missing or is not meaningful, try to figure it out fr
om the URL. | 193 // If the MIME type is missing or is not meaningful, try to figure it out fr
om the URL. |
| 194 if (contentMIMEType.isEmpty() || contentMIMEType == "application/octet-strea
m" || contentMIMEType == "text/plain") { | 194 if (contentMIMEType.isEmpty() || contentMIMEType == "application/octet-strea
m" || contentMIMEType == "text/plain") { |
| 195 if (url.protocolIsData()) | 195 if (url.protocolIsData()) |
| 196 contentMIMEType = mimeTypeFromDataURL(url.string()); | 196 contentMIMEType = mimeTypeFromDataURL(url.string()); |
| 197 else { | |
| 198 String lastPathComponent = url.lastPathComponent(); | |
| 199 size_t pos = lastPathComponent.reverseFind('.'); | |
| 200 if (pos != notFound) { | |
| 201 String extension = lastPathComponent.substring(pos + 1); | |
| 202 String mediaType = MIMETypeRegistry::getMediaMIMETypeForExtensio
n(extension); | |
| 203 if (!mediaType.isEmpty()) | |
| 204 return true; | |
| 205 } | |
| 206 } | |
| 207 } | 197 } |
| 208 | 198 |
| 209 // If no MIME type is specified, always attempt to load. | 199 // If no MIME type is specified, always attempt to load. |
| 210 if (contentMIMEType.isEmpty()) | 200 if (contentMIMEType.isEmpty()) |
| 211 return true; | 201 return true; |
| 212 | 202 |
| 213 // 4.8.10.3 MIME types - In the absence of a specification to the contrary,
the MIME type "application/octet-stream" | 203 // 4.8.10.3 MIME types - In the absence of a specification to the contrary,
the MIME type "application/octet-stream" |
| 214 // when used with parameters, e.g. "application/octet-stream;codecs=theora",
is a type that the user agent knows | 204 // when used with parameters, e.g. "application/octet-stream;codecs=theora",
is a type that the user agent knows |
| 215 // it cannot render. | 205 // it cannot render. |
| 216 if (contentMIMEType != "application/octet-stream" || contentTypeCodecs.isEmp
ty()) { | 206 if (contentMIMEType != "application/octet-stream" || contentTypeCodecs.isEmp
ty()) { |
| (...skipping 3740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3957 { | 3947 { |
| 3958 m_restrictions = NoRestrictions; | 3948 m_restrictions = NoRestrictions; |
| 3959 } | 3949 } |
| 3960 | 3950 |
| 3961 void HTMLMediaElement::mediaPlayerScheduleLayerUpdate() | 3951 void HTMLMediaElement::mediaPlayerScheduleLayerUpdate() |
| 3962 { | 3952 { |
| 3963 scheduleLayerUpdate(); | 3953 scheduleLayerUpdate(); |
| 3964 } | 3954 } |
| 3965 | 3955 |
| 3966 } | 3956 } |
| OLD | NEW |