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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 m_textTracks->clearOwner(); | 311 m_textTracks->clearOwner(); |
| 312 #endif | 312 #endif |
| 313 | 313 |
| 314 if (m_mediaController) { | 314 if (m_mediaController) { |
| 315 m_mediaController->removeMediaElement(this); | 315 m_mediaController->removeMediaElement(this); |
| 316 m_mediaController = nullptr; | 316 m_mediaController = nullptr; |
| 317 } | 317 } |
| 318 | 318 |
| 319 closeMediaSource(); | 319 closeMediaSource(); |
| 320 | 320 |
| 321 removeElementFromDocumentMap(this, &document()); | 321 removeElementFromDocumentMap(this, &document()); |
|
haraken
2014/04/24 04:18:43
Shouldn't this be also put in #if !ENABLE(OILPAN)
Mads Ager (chromium)
2014/04/24 10:57:36
Yes, thank you! I misread the code and thought tha
| |
| 322 | 322 |
| 323 // Destroying the player may cause a resource load to be canceled, | 323 // Destroying the player may cause a resource load to be canceled, |
| 324 // which could result in userCancelledLoad() being called back. | 324 // which could result in userCancelledLoad() being called back. |
| 325 // Setting m_completelyLoaded ensures that such a call will not cause | 325 // Setting m_completelyLoaded ensures that such a call will not cause |
| 326 // us to dispatch an abort event, which would result in a crash. | 326 // us to dispatch an abort event, which would result in a crash. |
| 327 // See http://crbug.com/233654 for more details. | 327 // See http://crbug.com/233654 for more details. |
| 328 m_completelyLoaded = true; | 328 m_completelyLoaded = true; |
| 329 | 329 |
| 330 // With Oilpan load events on the Document are always delayed during | |
| 331 // sweeping so we don't need to explicitly increment and decrement | |
| 332 // load event delay counts. | |
|
haraken
2014/04/24 04:18:43
I don't quite understand this. Do you need to comm
Mads Ager (chromium)
2014/04/24 10:57:36
Yes, have a look at the bug report that is referen
| |
| 333 #if !ENABLE(OILPAN) | |
| 330 // Destroying the player may cause a resource load to be canceled, | 334 // Destroying the player may cause a resource load to be canceled, |
| 331 // which could result in Document::dispatchWindowLoadEvent() being | 335 // which could result in Document::dispatchWindowLoadEvent() being |
| 332 // called via ResourceFetch::didLoadResource() then | 336 // called via ResourceFetch::didLoadResource() then |
| 333 // FrameLoader::loadDone(). To prevent load event dispatching during | 337 // FrameLoader::loadDone(). To prevent load event dispatching during |
| 334 // object destruction, we use Document::incrementLoadEventDelayCount(). | 338 // object destruction, we use Document::incrementLoadEventDelayCount(). |
| 335 // See http://crbug.com/275223 for more details. | 339 // See http://crbug.com/275223 for more details. |
| 336 document().incrementLoadEventDelayCount(); | 340 document().incrementLoadEventDelayCount(); |
| 341 #endif | |
| 337 | 342 |
| 338 clearMediaPlayerAndAudioSourceProviderClient(); | 343 clearMediaPlayerAndAudioSourceProviderClient(); |
| 339 | 344 |
| 345 #if !ENABLE(OILPAN) | |
| 340 document().decrementLoadEventDelayCount(); | 346 document().decrementLoadEventDelayCount(); |
| 347 #endif | |
| 341 } | 348 } |
| 342 | 349 |
| 343 void HTMLMediaElement::didMoveToNewDocument(Document& oldDocument) | 350 void HTMLMediaElement::didMoveToNewDocument(Document& oldDocument) |
| 344 { | 351 { |
| 345 WTF_LOG(Media, "HTMLMediaElement::didMoveToNewDocument"); | 352 WTF_LOG(Media, "HTMLMediaElement::didMoveToNewDocument"); |
| 346 | 353 |
| 347 if (m_shouldDelayLoadEvent) { | 354 if (m_shouldDelayLoadEvent) { |
| 348 document().incrementLoadEventDelayCount(); | 355 document().incrementLoadEventDelayCount(); |
| 349 // Note: Keeping the load event delay count increment on oldDocument tha t was added | 356 // Note: Keeping the load event delay count increment on oldDocument tha t was added |
| 350 // when m_shouldDelayLoadEvent was set so that destruction of m_player c an not | 357 // when m_shouldDelayLoadEvent was set so that destruction of m_player c an not |
| (...skipping 3298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3649 | 3656 |
| 3650 void HTMLMediaElement::trace(Visitor* visitor) | 3657 void HTMLMediaElement::trace(Visitor* visitor) |
| 3651 { | 3658 { |
| 3652 visitor->trace(m_textTracks); | 3659 visitor->trace(m_textTracks); |
| 3653 visitor->trace(m_textTracksWhenResourceSelectionBegan); | 3660 visitor->trace(m_textTracksWhenResourceSelectionBegan); |
| 3654 Supplementable<HTMLMediaElement>::trace(visitor); | 3661 Supplementable<HTMLMediaElement>::trace(visitor); |
| 3655 HTMLElement::trace(visitor); | 3662 HTMLElement::trace(visitor); |
| 3656 } | 3663 } |
| 3657 | 3664 |
| 3658 } | 3665 } |
| OLD | NEW |