Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: Source/core/html/HTMLMediaElement.cpp

Issue 314113008: Oilpan: have MediaController weakly refer to its media elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add FIXME (crbug.com/383072) Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/MediaController.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 // destructed ActiveDOMObject::executionContext() returns 0. 318 // destructed ActiveDOMObject::executionContext() returns 0.
319 if (ActiveDOMObject::executionContext()) 319 if (ActiveDOMObject::executionContext())
320 setShouldDelayLoadEvent(false); 320 setShouldDelayLoadEvent(false);
321 #else 321 #else
322 setShouldDelayLoadEvent(false); 322 setShouldDelayLoadEvent(false);
323 #endif 323 #endif
324 324
325 #if !ENABLE(OILPAN) 325 #if !ENABLE(OILPAN)
326 if (m_textTracks) 326 if (m_textTracks)
327 m_textTracks->clearOwner(); 327 m_textTracks->clearOwner();
328 #endif
329 328
330 if (m_mediaController) { 329 if (m_mediaController) {
331 m_mediaController->removeMediaElement(this); 330 m_mediaController->removeMediaElement(this);
332 m_mediaController = nullptr; 331 m_mediaController = nullptr;
333 } 332 }
333 #endif
334 334
335 closeMediaSource(); 335 closeMediaSource();
336 336
337 #if !ENABLE(OILPAN) 337 #if !ENABLE(OILPAN)
338 removeElementFromDocumentMap(this, &document()); 338 removeElementFromDocumentMap(this, &document());
339 #endif 339 #endif
340 340
341 // Destroying the player may cause a resource load to be canceled, 341 // Destroying the player may cause a resource load to be canceled,
342 // which could result in userCancelledLoad() being called back. 342 // which could result in userCancelledLoad() being called back.
343 // Setting m_completelyLoaded ensures that such a call will not cause 343 // Setting m_completelyLoaded ensures that such a call will not cause
(...skipping 3161 matching lines...) Expand 10 before | Expand all | Expand 10 after
3505 3505
3506 // Otherwise, let controller be a newly created MediaController. 3506 // Otherwise, let controller be a newly created MediaController.
3507 setControllerInternal(MediaController::create(Node::executionContext())); 3507 setControllerInternal(MediaController::create(Node::executionContext()));
3508 } 3508 }
3509 3509
3510 MediaController* HTMLMediaElement::controller() const 3510 MediaController* HTMLMediaElement::controller() const
3511 { 3511 {
3512 return m_mediaController.get(); 3512 return m_mediaController.get();
3513 } 3513 }
3514 3514
3515 void HTMLMediaElement::setController(PassRefPtr<MediaController> controller) 3515 void HTMLMediaElement::setController(PassRefPtrWillBeRawPtr<MediaController> con troller)
3516 { 3516 {
3517 // 4.8.10.11.2 Media controllers: controller attribute. 3517 // 4.8.10.11.2 Media controllers: controller attribute.
3518 // On setting, it must first remove the element's mediagroup attribute, if a ny, 3518 // On setting, it must first remove the element's mediagroup attribute, if a ny,
3519 removeAttribute(mediagroupAttr); 3519 removeAttribute(mediagroupAttr);
3520 // and then set the current media controller to the given value. 3520 // and then set the current media controller to the given value.
3521 setControllerInternal(controller); 3521 setControllerInternal(controller);
3522 } 3522 }
3523 3523
3524 void HTMLMediaElement::setControllerInternal(PassRefPtr<MediaController> control ler) 3524 void HTMLMediaElement::setControllerInternal(PassRefPtrWillBeRawPtr<MediaControl ler> controller)
3525 { 3525 {
3526 if (m_mediaController) 3526 if (m_mediaController)
3527 m_mediaController->removeMediaElement(this); 3527 m_mediaController->removeMediaElement(this);
3528 3528
3529 m_mediaController = controller; 3529 m_mediaController = controller;
3530 3530
3531 if (m_mediaController) 3531 if (m_mediaController)
3532 m_mediaController->addMediaElement(this); 3532 m_mediaController->addMediaElement(this);
3533 } 3533 }
3534 3534
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
3649 HTMLElement::defaultEventHandler(event); 3649 HTMLElement::defaultEventHandler(event);
3650 } 3650 }
3651 3651
3652 void HTMLMediaElement::trace(Visitor* visitor) 3652 void HTMLMediaElement::trace(Visitor* visitor)
3653 { 3653 {
3654 visitor->trace(m_error); 3654 visitor->trace(m_error);
3655 visitor->trace(m_currentSourceNode); 3655 visitor->trace(m_currentSourceNode);
3656 visitor->trace(m_nextChildNodeToConsider); 3656 visitor->trace(m_nextChildNodeToConsider);
3657 visitor->trace(m_textTracks); 3657 visitor->trace(m_textTracks);
3658 visitor->trace(m_textTracksWhenResourceSelectionBegan); 3658 visitor->trace(m_textTracksWhenResourceSelectionBegan);
3659 visitor->trace(m_mediaController);
3659 WillBeHeapSupplementable<HTMLMediaElement>::trace(visitor); 3660 WillBeHeapSupplementable<HTMLMediaElement>::trace(visitor);
3660 HTMLElement::trace(visitor); 3661 HTMLElement::trace(visitor);
3661 } 3662 }
3662 3663
3663 } 3664 }
OLDNEW
« no previous file with comments | « Source/core/html/HTMLMediaElement.h ('k') | Source/core/html/MediaController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698