Chromium Code Reviews| 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 480 // doesn't get dispatched during the object destruction. | 480 // doesn't get dispatched during the object destruction. |
| 481 // See Document::isDelayingLoadEvent(). | 481 // See Document::isDelayingLoadEvent(). |
| 482 // Also see http://crbug.com/275223 for more details. | 482 // Also see http://crbug.com/275223 for more details. |
| 483 clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); | 483 clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); |
| 484 } | 484 } |
| 485 | 485 |
| 486 void HTMLMediaElement::didMoveToNewDocument(Document& oldDocument) | 486 void HTMLMediaElement::didMoveToNewDocument(Document& oldDocument) |
| 487 { | 487 { |
| 488 DVLOG(MEDIA_LOG_LEVEL) << "didMoveToNewDocument(" << (void*)this << ")"; | 488 DVLOG(MEDIA_LOG_LEVEL) << "didMoveToNewDocument(" << (void*)this << ")"; |
| 489 | 489 |
| 490 // If any experiment is enabled, then we want to enable a user gesture by | |
| 491 // default, otherwise the experiment does nothing. | |
| 492 if ((document().settings() && document().settings()->mediaPlaybackRequiresUs erGesture()) | |
| 493 || m_autoplayHelper->isExperimentEnabled()) { | |
|
mlamouri (slow - plz ping)
2016/06/07 15:40:28
I think you should do something like:
```
bool old
Zhiqiang Zhang (Slow)
2016/06/07 17:02:40
Done.
| |
| 494 m_lockedPendingUserGesture = true; | |
| 495 } | |
| 496 | |
| 490 if (m_shouldDelayLoadEvent) { | 497 if (m_shouldDelayLoadEvent) { |
| 491 document().incrementLoadEventDelayCount(); | 498 document().incrementLoadEventDelayCount(); |
| 492 // Note: Keeping the load event delay count increment on oldDocument tha t was added | 499 // Note: Keeping the load event delay count increment on oldDocument tha t was added |
| 493 // when m_shouldDelayLoadEvent was set so that destruction of m_webMedia Player can not | 500 // when m_shouldDelayLoadEvent was set so that destruction of m_webMedia Player can not |
| 494 // cause load event dispatching in oldDocument. | 501 // cause load event dispatching in oldDocument. |
| 495 } else { | 502 } else { |
| 496 // Incrementing the load event delay count so that destruction of m_webM ediaPlayer can not | 503 // Incrementing the load event delay count so that destruction of m_webM ediaPlayer can not |
| 497 // cause load event dispatching in oldDocument. | 504 // cause load event dispatching in oldDocument. |
| 498 oldDocument.incrementLoadEventDelayCount(); | 505 oldDocument.incrementLoadEventDelayCount(); |
| 499 } | 506 } |
| (...skipping 3381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3881 | 3888 |
| 3882 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co nst | 3889 IntRect HTMLMediaElement::AutoplayHelperClientImpl::absoluteBoundingBoxRect() co nst |
| 3883 { | 3890 { |
| 3884 IntRect result; | 3891 IntRect result; |
| 3885 if (LayoutObject* object = m_element->layoutObject()) | 3892 if (LayoutObject* object = m_element->layoutObject()) |
| 3886 result = object->absoluteBoundingBoxRect(); | 3893 result = object->absoluteBoundingBoxRect(); |
| 3887 return result; | 3894 return result; |
| 3888 } | 3895 } |
| 3889 | 3896 |
| 3890 } // namespace blink | 3897 } // namespace blink |
| OLD | NEW |