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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 m_userGestureRequiredForPlay = true; | 296 m_userGestureRequiredForPlay = true; |
297 | 297 |
298 setHasCustomStyleCallbacks(); | 298 setHasCustomStyleCallbacks(); |
299 addElementToDocumentMap(this, &document); | 299 addElementToDocumentMap(this, &document); |
300 } | 300 } |
301 | 301 |
302 HTMLMediaElement::~HTMLMediaElement() | 302 HTMLMediaElement::~HTMLMediaElement() |
303 { | 303 { |
304 WTF_LOG(Media, "HTMLMediaElement::~HTMLMediaElement"); | 304 WTF_LOG(Media, "HTMLMediaElement::~HTMLMediaElement"); |
305 | 305 |
306 m_asyncEventQueue->close(); | |
307 | |
308 #if ENABLE(OILPAN) | 306 #if ENABLE(OILPAN) |
309 // If the HTMLMediaElement dies with the document we are not | 307 // If the HTMLMediaElement dies with the document we are not |
310 // allowed to touch the document to adjust delay load event counts | 308 // allowed to touch the document to adjust delay load event counts |
311 // because the document could have been already | 309 // because the document could have been already |
312 // destructed. However, if the HTMLMediaElement dies with the | 310 // destructed. However, if the HTMLMediaElement dies with the |
313 // document there is no need to change the delayed load counts | 311 // document there is no need to change the delayed load counts |
314 // because no load event will fire anyway. If the document is | 312 // because no load event will fire anyway. If the document is |
315 // still alive we do have to decrement the load delay counts. We | 313 // still alive we do have to decrement the load delay counts. We |
316 // determine if the document is alive via the ActiveDOMObject | 314 // determine if the document is alive via the ActiveDOMObject |
317 // which is a context lifecycle observer. If the Document has been | 315 // which is a context lifecycle observer. If the Document has been |
318 // destructed ActiveDOMObject::executionContext() returns 0. | 316 // destructed ActiveDOMObject::executionContext() returns 0. |
319 if (ActiveDOMObject::executionContext()) | 317 if (ActiveDOMObject::executionContext()) |
320 setShouldDelayLoadEvent(false); | 318 setShouldDelayLoadEvent(false); |
321 #else | 319 #else |
| 320 // HTMLMediaElement and m_asyncEventQueue always become unreachable |
| 321 // together. So HTMLMediaElemenet and m_asyncEventQueue are destructed in |
| 322 // the same GC. We don't need to close it explicitly in Oilpan. |
| 323 m_asyncEventQueue->close(); |
| 324 |
322 setShouldDelayLoadEvent(false); | 325 setShouldDelayLoadEvent(false); |
323 #endif | |
324 | 326 |
325 #if !ENABLE(OILPAN) | |
326 if (m_textTracks) | 327 if (m_textTracks) |
327 m_textTracks->clearOwner(); | 328 m_textTracks->clearOwner(); |
328 | 329 |
329 if (m_mediaController) { | 330 if (m_mediaController) { |
330 m_mediaController->removeMediaElement(this); | 331 m_mediaController->removeMediaElement(this); |
331 m_mediaController = nullptr; | 332 m_mediaController = nullptr; |
332 } | 333 } |
333 #endif | 334 #endif |
334 | 335 |
335 closeMediaSource(); | 336 closeMediaSource(); |
(...skipping 3308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3644 { | 3645 { |
3645 if (event->type() == EventTypeNames::focusin) { | 3646 if (event->type() == EventTypeNames::focusin) { |
3646 if (hasMediaControls()) | 3647 if (hasMediaControls()) |
3647 mediaControls()->mediaElementFocused(); | 3648 mediaControls()->mediaElementFocused(); |
3648 } | 3649 } |
3649 HTMLElement::defaultEventHandler(event); | 3650 HTMLElement::defaultEventHandler(event); |
3650 } | 3651 } |
3651 | 3652 |
3652 void HTMLMediaElement::trace(Visitor* visitor) | 3653 void HTMLMediaElement::trace(Visitor* visitor) |
3653 { | 3654 { |
| 3655 visitor->trace(m_asyncEventQueue); |
3654 visitor->trace(m_error); | 3656 visitor->trace(m_error); |
3655 visitor->trace(m_currentSourceNode); | 3657 visitor->trace(m_currentSourceNode); |
3656 visitor->trace(m_nextChildNodeToConsider); | 3658 visitor->trace(m_nextChildNodeToConsider); |
3657 visitor->trace(m_textTracks); | 3659 visitor->trace(m_textTracks); |
3658 visitor->trace(m_textTracksWhenResourceSelectionBegan); | 3660 visitor->trace(m_textTracksWhenResourceSelectionBegan); |
3659 visitor->trace(m_mediaController); | 3661 visitor->trace(m_mediaController); |
3660 WillBeHeapSupplementable<HTMLMediaElement>::trace(visitor); | 3662 WillBeHeapSupplementable<HTMLMediaElement>::trace(visitor); |
3661 HTMLElement::trace(visitor); | 3663 HTMLElement::trace(visitor); |
3662 } | 3664 } |
3663 | 3665 |
3664 } | 3666 } |
OLD | NEW |