| 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 , m_playPromiseRejectTask(CancellableTaskFactory::create(this, &HTMLMediaEle
ment::rejectPlayPromises)) | 434 , m_playPromiseRejectTask(CancellableTaskFactory::create(this, &HTMLMediaEle
ment::rejectPlayPromises)) |
| 435 , m_audioSourceNode(nullptr) | 435 , m_audioSourceNode(nullptr) |
| 436 , m_autoplayHelperClient(AutoplayHelperClientImpl::create(this)) | 436 , m_autoplayHelperClient(AutoplayHelperClientImpl::create(this)) |
| 437 , m_autoplayHelper(AutoplayExperimentHelper::create(m_autoplayHelperClient.g
et())) | 437 , m_autoplayHelper(AutoplayExperimentHelper::create(m_autoplayHelperClient.g
et())) |
| 438 , m_remotePlaybackClient(nullptr) | 438 , m_remotePlaybackClient(nullptr) |
| 439 { | 439 { |
| 440 ThreadState::current()->registerPreFinalizer(this); | 440 ThreadState::current()->registerPreFinalizer(this); |
| 441 | 441 |
| 442 WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement(%p)", this); | 442 WTF_LOG(Media, "HTMLMediaElement::HTMLMediaElement(%p)", this); |
| 443 | 443 |
| 444 if (document.settings() && document.settings()->mediaPlaybackRequiresUserGes
ture()) | 444 // If any experiment is enabled, then we want to enable a user gesture by |
| 445 // default, otherwise the experiment does nothing. |
| 446 if ((document.settings() && document.settings()->mediaPlaybackRequiresUserGe
sture()) |
| 447 || m_autoplayHelper->isExperimentEnabled()) { |
| 445 m_userGestureRequiredForPlay = true; | 448 m_userGestureRequiredForPlay = true; |
| 449 } |
| 446 | 450 |
| 447 setHasCustomStyleCallbacks(); | 451 setHasCustomStyleCallbacks(); |
| 448 addElementToDocumentMap(this, &document); | 452 addElementToDocumentMap(this, &document); |
| 449 | 453 |
| 450 UseCounter::count(document, UseCounter::HTMLMediaElement); | 454 UseCounter::count(document, UseCounter::HTMLMediaElement); |
| 451 } | 455 } |
| 452 | 456 |
| 453 HTMLMediaElement::~HTMLMediaElement() | 457 HTMLMediaElement::~HTMLMediaElement() |
| 454 { | 458 { |
| 455 WTF_LOG(Media, "HTMLMediaElement::~HTMLMediaElement(%p)", this); | 459 WTF_LOG(Media, "HTMLMediaElement::~HTMLMediaElement(%p)", this); |
| (...skipping 3394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3850 | 3854 |
| 3851 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co
nst | 3855 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co
nst |
| 3852 { | 3856 { |
| 3853 IntRect result; | 3857 IntRect result; |
| 3854 if (LayoutObject* object = m_element->layoutObject()) | 3858 if (LayoutObject* object = m_element->layoutObject()) |
| 3855 result = object->absoluteBoundingBoxRect(); | 3859 result = object->absoluteBoundingBoxRect(); |
| 3856 return result; | 3860 return result; |
| 3857 } | 3861 } |
| 3858 | 3862 |
| 3859 } // namespace blink | 3863 } // namespace blink |
| OLD | NEW |