Changeset 65758 in webkit
- Timestamp:
- Aug 20, 2010 3:19:39 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r65757 r65758 1 2010-08-20 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Media element canPlayType("application/octet-stream") not handled correctly 6 https://bugs.webkit.org/show_bug.cgi?id=44343 7 8 * media/media-can-play-octet-stream-expected.txt: Added. 9 * media/media-can-play-octet-stream.html: Added. 10 1 11 2010-08-20 Ryosuke Niwa <rniwa@webkit.org> 2 12 -
trunk/WebCore/ChangeLog
r65756 r65758 1 2010-08-20 Eric Carlson <eric.carlson@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Media element canPlayType("application/octet-stream") not handled correctly 6 https://bugs.webkit.org/show_bug.cgi?id=44343 7 8 Test: media/media-can-play-octet-stream.html 9 10 * platform/graphics/MediaPlayer.cpp: 11 (WebCore::applicationOctetStream): New, accessor for static string used more than once. 12 (WebCore::textPlain): Ditto. 13 (WebCore::codecs): Ditto. 14 (WebCore::chooseBestEngineForTypeAndCodecs): Special case "application/octet-stream". 15 (WebCore::MediaPlayer::load): Use static static string methods. 16 (WebCore::MediaPlayer::supportsType): Special case "application/octet-stream". 17 1 18 2010-08-20 Adrienne Walker <enne@google.com> 2 19 -
trunk/WebCore/platform/graphics/MediaPlayer.cpp
r65468 r65758 193 193 } 194 194 195 static const AtomicString& applicationOctetStream() 196 { 197 DEFINE_STATIC_LOCAL(const AtomicString, applicationOctetStream, ("application/octet-stream")); 198 return applicationOctetStream; 199 } 200 201 static const AtomicString& textPlain() 202 { 203 DEFINE_STATIC_LOCAL(const AtomicString, textPlain, ("text/plain")); 204 return textPlain; 205 } 206 207 static const AtomicString& codecs() 208 { 209 DEFINE_STATIC_LOCAL(const AtomicString, codecs, ("codecs")); 210 return codecs; 211 } 212 195 213 static MediaPlayerFactory* chooseBestEngineForTypeAndCodecs(const String& type, const String& codecs) 196 214 { … … 200 218 return 0; 201 219 220 // 4.8.10.3 MIME types - In the absence of a specification to the contrary, the MIME type "application/octet-stream" 221 // when used with parameters, e.g. "application/octet-stream;codecs=theora", is a type that the user agent knows 222 // it cannot render. 223 if (type == applicationOctetStream()) { 224 if (!codecs.isEmpty()) 225 return 0; 226 } 227 202 228 MediaPlayerFactory* engine = 0; 203 229 MediaPlayer::SupportsType supported = MediaPlayer::IsNotSupported; … … 249 275 { 250 276 String type = contentType.type(); 251 String codecs = contentType.parameter("codecs");252 253 // if we don't know the MIME type, see if the extension can help254 if (type.isEmpty() || type == "application/octet-stream" || type == "text/plain") {277 String typeCodecs = contentType.parameter(codecs()); 278 279 // If the MIME type is unhelpful, see if the type registry has a match for the file extension. 280 if (type.isEmpty() || type == applicationOctetStream() || type == textPlain()) { 255 281 size_t pos = url.reverseFind('.'); 256 282 if (pos != notFound) { … … 264 290 MediaPlayerFactory* engine = 0; 265 291 if (!type.isEmpty()) 266 engine = chooseBestEngineForTypeAndCodecs(type, codecs);292 engine = chooseBestEngineForTypeAndCodecs(type, typeCodecs); 267 293 268 294 // if we didn't find an engine that claims the MIME type, just use the first engine … … 529 555 { 530 556 String type = contentType.type(); 531 String codecs = contentType.parameter("codecs"); 532 MediaPlayerFactory* engine = chooseBestEngineForTypeAndCodecs(type, codecs); 557 String typeCodecs = contentType.parameter(codecs()); 558 559 // 4.8.10.3 MIME types - In the absence of a specification to the contrary, the MIME type "application/octet-stream" 560 // when used with parameters, e.g. "application/octet-stream;codecs=theora", is a type that the user agent knows 561 // it cannot render. 562 if (type == applicationOctetStream()) { 563 if (!typeCodecs.isEmpty()) 564 return IsNotSupported; 565 566 // The MIME type "application/octet-stream" with no parameters is never a type that the user agent knows it 567 // cannot render. 568 return MayBeSupported; 569 } 570 571 MediaPlayerFactory* engine = chooseBestEngineForTypeAndCodecs(type, typeCodecs); 533 572 534 573 if (!engine) 535 574 return IsNotSupported; 536 575 537 return engine->supportsTypeAndCodecs(type, codecs);576 return engine->supportsTypeAndCodecs(type, typeCodecs); 538 577 } 539 578
Note: See TracChangeset
for help on using the changeset viewer.