| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 void HTMLMediaElement::recordAutoplayMetric(AutoplayMetrics metric) | 256 void HTMLMediaElement::recordAutoplayMetric(AutoplayMetrics metric) |
| 257 { | 257 { |
| 258 DEFINE_STATIC_LOCAL(EnumerationHistogram, autoplayHistogram, ("Blink.MediaEl
ement.Autoplay", NumberOfAutoplayMetrics)); | 258 DEFINE_STATIC_LOCAL(EnumerationHistogram, autoplayHistogram, ("Blink.MediaEl
ement.Autoplay", NumberOfAutoplayMetrics)); |
| 259 autoplayHistogram.count(metric); | 259 autoplayHistogram.count(metric); |
| 260 } | 260 } |
| 261 | 261 |
| 262 WebMimeRegistry::SupportsType HTMLMediaElement::supportsType(const ContentType&
contentType) | 262 WebMimeRegistry::SupportsType HTMLMediaElement::supportsType(const ContentType&
contentType) |
| 263 { | 263 { |
| 264 DEFINE_STATIC_LOCAL(const String, codecs, ("codecs")); | 264 DEFINE_STATIC_LOCAL(const String, codecs, ("codecs")); |
| 265 | 265 |
| 266 if (!RuntimeEnabledFeatures::mediaEnabled()) | |
| 267 return WebMimeRegistry::IsNotSupported; | |
| 268 | |
| 269 String type = contentType.type().lower(); | 266 String type = contentType.type().lower(); |
| 270 // The codecs string is not lower-cased because MP4 values are case sensitiv
e | 267 // The codecs string is not lower-cased because MP4 values are case sensitiv
e |
| 271 // per http://tools.ietf.org/html/rfc4281#page-7. | 268 // per http://tools.ietf.org/html/rfc4281#page-7. |
| 272 String typeCodecs = contentType.parameter(codecs); | 269 String typeCodecs = contentType.parameter(codecs); |
| 273 | 270 |
| 274 if (type.isEmpty()) | 271 if (type.isEmpty()) |
| 275 return WebMimeRegistry::IsNotSupported; | 272 return WebMimeRegistry::IsNotSupported; |
| 276 | 273 |
| 277 // 4.8.10.3 MIME types - The canPlayType(type) method must return the empty
string if type is a type that the | 274 // 4.8.10.3 MIME types - The canPlayType(type) method must return the empty
string if type is a type that the |
| 278 // user agent knows it cannot render or is the type "application/octet-strea
m" | 275 // user agent knows it cannot render or is the type "application/octet-strea
m" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 , m_videoTracks(VideoTrackList::create(*this)) | 345 , m_videoTracks(VideoTrackList::create(*this)) |
| 349 , m_textTracks(nullptr) | 346 , m_textTracks(nullptr) |
| 350 , m_playPromiseResolveTask(CancellableTaskFactory::create(this, &HTMLMediaEl
ement::resolvePlayPromises)) | 347 , m_playPromiseResolveTask(CancellableTaskFactory::create(this, &HTMLMediaEl
ement::resolvePlayPromises)) |
| 351 , m_playPromiseRejectTask(CancellableTaskFactory::create(this, &HTMLMediaEle
ment::rejectPlayPromises)) | 348 , m_playPromiseRejectTask(CancellableTaskFactory::create(this, &HTMLMediaEle
ment::rejectPlayPromises)) |
| 352 , m_audioSourceNode(nullptr) | 349 , m_audioSourceNode(nullptr) |
| 353 , m_autoplayHelper(*this) | 350 , m_autoplayHelper(*this) |
| 354 { | 351 { |
| 355 #if ENABLE(OILPAN) | 352 #if ENABLE(OILPAN) |
| 356 ThreadState::current()->registerPreFinalizer(this); | 353 ThreadState::current()->registerPreFinalizer(this); |
| 357 #endif | 354 #endif |
| 358 ASSERT(RuntimeEnabledFeatures::mediaEnabled()); | |
| 359 | 355 |
| 360 WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement(%p)", this); | 356 WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement(%p)", this); |
| 361 | 357 |
| 362 if (document.settings() && document.settings()->mediaPlaybackRequiresUserGes
ture()) | 358 if (document.settings() && document.settings()->mediaPlaybackRequiresUserGes
ture()) |
| 363 m_userGestureRequiredForPlay = true; | 359 m_userGestureRequiredForPlay = true; |
| 364 | 360 |
| 365 setHasCustomStyleCallbacks(); | 361 setHasCustomStyleCallbacks(); |
| 366 addElementToDocumentMap(this, &document); | 362 addElementToDocumentMap(this, &document); |
| 367 | 363 |
| 368 UseCounter::count(document, UseCounter::HTMLMediaElement); | 364 UseCounter::count(document, UseCounter::HTMLMediaElement); |
| (...skipping 3406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3775 { | 3771 { |
| 3776 visitor->trace(m_client); | 3772 visitor->trace(m_client); |
| 3777 } | 3773 } |
| 3778 | 3774 |
| 3779 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) | 3775 DEFINE_TRACE(HTMLMediaElement::AudioSourceProviderImpl) |
| 3780 { | 3776 { |
| 3781 visitor->trace(m_client); | 3777 visitor->trace(m_client); |
| 3782 } | 3778 } |
| 3783 | 3779 |
| 3784 } // namespace blink | 3780 } // namespace blink |
| OLD | NEW |