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

Side by Side Diff: Source/core/html/track/vtt/VTTCue.cpp

Issue 289273002: Oilpan: make DocumentFragment a heap allocated object. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + add WillBeGarbageCollected FIXME. Created 6 years, 7 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/track/vtt/VTTCue.h ('k') | Source/core/html/track/vtt/VTTParser.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) 2013, Opera Software ASA. All rights reserved. 2 * Copyright (c) 2013, Opera Software ASA. 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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 if (node->isVTTElement()) 428 if (node->isVTTElement())
429 clonedNode = toVTTElement(node)->createEquivalentHTMLElement(documen t()); 429 clonedNode = toVTTElement(node)->createEquivalentHTMLElement(documen t());
430 else 430 else
431 clonedNode = node->cloneNode(false); 431 clonedNode = node->cloneNode(false);
432 parent->appendChild(clonedNode); 432 parent->appendChild(clonedNode);
433 if (node->isContainerNode()) 433 if (node->isContainerNode())
434 copyVTTNodeToDOMTree(toContainerNode(node), toContainerNode(clonedNo de)); 434 copyVTTNodeToDOMTree(toContainerNode(node), toContainerNode(clonedNo de));
435 } 435 }
436 } 436 }
437 437
438 PassRefPtr<DocumentFragment> VTTCue::getCueAsHTML() 438 PassRefPtrWillBeRawPtr<DocumentFragment> VTTCue::getCueAsHTML()
439 { 439 {
440 createVTTNodeTree(); 440 createVTTNodeTree();
441 RefPtr<DocumentFragment> clonedFragment = DocumentFragment::create(document( )); 441 RefPtrWillBeRawPtr<DocumentFragment> clonedFragment = DocumentFragment::crea te(document());
442 copyVTTNodeToDOMTree(m_vttNodeTree.get(), clonedFragment.get()); 442 copyVTTNodeToDOMTree(m_vttNodeTree.get(), clonedFragment.get());
443 return clonedFragment.release(); 443 return clonedFragment.release();
444 } 444 }
445 445
446 PassRefPtr<DocumentFragment> VTTCue::createCueRenderingTree() 446 PassRefPtrWillBeRawPtr<DocumentFragment> VTTCue::createCueRenderingTree()
447 { 447 {
448 RefPtr<DocumentFragment> clonedFragment;
449 createVTTNodeTree(); 448 createVTTNodeTree();
450 clonedFragment = DocumentFragment::create(document()); 449 RefPtrWillBeRawPtr<DocumentFragment> clonedFragment = DocumentFragment::crea te(document());
451 m_vttNodeTree->cloneChildNodes(clonedFragment.get()); 450 m_vttNodeTree->cloneChildNodes(clonedFragment.get());
452 return clonedFragment.release(); 451 return clonedFragment.release();
453 } 452 }
454 453
455 void VTTCue::setRegionId(const String& regionId) 454 void VTTCue::setRegionId(const String& regionId)
456 { 455 {
457 if (m_regionId == regionId) 456 if (m_regionId == regionId)
458 return; 457 return;
459 458
460 cueWillChange(); 459 cueWillChange();
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 // The display tree may contain WebVTT timestamp objects representing 704 // The display tree may contain WebVTT timestamp objects representing
706 // timestamps (processing instructions), along with displayable nodes. 705 // timestamps (processing instructions), along with displayable nodes.
707 706
708 if (!track()->isRendered()) 707 if (!track()->isRendered())
709 return; 708 return;
710 709
711 // Clear the contents of the set. 710 // Clear the contents of the set.
712 m_cueBackgroundBox->removeChildren(); 711 m_cueBackgroundBox->removeChildren();
713 712
714 // Update the two sets containing past and future WebVTT objects. 713 // Update the two sets containing past and future WebVTT objects.
715 RefPtr<DocumentFragment> referenceTree = createCueRenderingTree(); 714 RefPtrWillBeRawPtr<DocumentFragment> referenceTree = createCueRenderingTree( );
716 markFutureAndPastNodes(referenceTree.get(), startTime(), movieTime); 715 markFutureAndPastNodes(referenceTree.get(), startTime(), movieTime);
717 m_cueBackgroundBox->appendChild(referenceTree, ASSERT_NO_EXCEPTION); 716 m_cueBackgroundBox->appendChild(referenceTree, ASSERT_NO_EXCEPTION);
718 } 717 }
719 718
720 PassRefPtrWillBeRawPtr<VTTCueBox> VTTCue::getDisplayTree(const IntSize& videoSiz e) 719 PassRefPtrWillBeRawPtr<VTTCueBox> VTTCue::getDisplayTree(const IntSize& videoSiz e)
721 { 720 {
722 RefPtrWillBeRawPtr<VTTCueBox> displayTree(ensureDisplayTree()); 721 RefPtrWillBeRawPtr<VTTCueBox> displayTree(ensureDisplayTree());
723 if (!m_displayTreeShouldChange || !track()->isRendered()) 722 if (!m_displayTreeShouldChange || !track()->isRendered())
724 return displayTree.release(); 723 return displayTree.release();
725 724
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 1098
1100 void VTTCue::trace(Visitor* visitor) 1099 void VTTCue::trace(Visitor* visitor)
1101 { 1100 {
1102 visitor->trace(m_vttNodeTree); 1101 visitor->trace(m_vttNodeTree);
1103 visitor->trace(m_cueBackgroundBox); 1102 visitor->trace(m_cueBackgroundBox);
1104 visitor->trace(m_displayTree); 1103 visitor->trace(m_displayTree);
1105 TextTrackCue::trace(visitor); 1104 TextTrackCue::trace(visitor);
1106 } 1105 }
1107 1106
1108 } // namespace WebCore 1107 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/track/vtt/VTTCue.h ('k') | Source/core/html/track/vtt/VTTParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698