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

Unified Diff: third_party/WebKit/Source/core/svg/SVGUseElement.cpp

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/svg/SVGUseElement.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
index 4e5725217cd392a5b434ffe46548b1ece4d47e3d..f4e3376fb73901fbc8d7347a7fc442eda8e32099 100644
--- a/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
@@ -46,7 +46,7 @@ namespace blink {
static SVGUseEventSender& svgUseLoadEventSender()
{
- DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<SVGUseEventSender>, sharedLoadEventSender, (SVGUseEventSender::create(EventTypeNames::load)));
+ DEFINE_STATIC_LOCAL(Persistent<SVGUseEventSender>, sharedLoadEventSender, (SVGUseEventSender::create(EventTypeNames::load)));
return *sharedLoadEventSender;
}
@@ -72,10 +72,10 @@ inline SVGUseElement::SVGUseElement(Document& document)
#endif
}
-PassRefPtrWillBeRawPtr<SVGUseElement> SVGUseElement::create(Document& document)
+RawPtr<SVGUseElement> SVGUseElement::create(Document& document)
{
// Always build a user agent #shadow-root for SVGUseElement.
- RefPtrWillBeRawPtr<SVGUseElement> use = adoptRefWillBeNoop(new SVGUseElement(document));
+ RawPtr<SVGUseElement> use = (new SVGUseElement(document));
use->ensureUserAgentShadowRoot();
return use.release();
}
@@ -371,9 +371,9 @@ void SVGUseElement::buildPendingResource()
ASSERT(!m_needsShadowTreeRecreation);
}
-static PassRefPtrWillBeRawPtr<Node> cloneNodeAndAssociate(Node& toClone)
+static RawPtr<Node> cloneNodeAndAssociate(Node& toClone)
{
- RefPtrWillBeRawPtr<Node> clone = toClone.cloneNode(false);
+ RawPtr<Node> clone = toClone.cloneNode(false);
if (!clone->isSVGElement())
return clone.release();
@@ -383,7 +383,7 @@ static PassRefPtrWillBeRawPtr<Node> cloneNodeAndAssociate(Node& toClone)
if (EventTargetData* data = toClone.eventTargetData())
data->eventListenerMap.copyEventListenersNotCreatedFromMarkupToTarget(clone.get());
TrackExceptionState exceptionState;
- for (RefPtrWillBeRawPtr<Node> node = toClone.firstChild(); node && !exceptionState.hadException(); node = node->nextSibling())
+ for (RawPtr<Node> node = toClone.firstChild(); node && !exceptionState.hadException(); node = node->nextSibling())
clone->appendChild(cloneNodeAndAssociate(*node), exceptionState);
return clone.release();
}
@@ -405,7 +405,7 @@ void SVGUseElement::buildShadowAndInstanceTree(SVGElement* target)
return;
// Set up root SVG element in shadow tree.
- RefPtrWillBeRawPtr<Element> newChild = target->cloneElementWithoutChildren();
+ RawPtr<Element> newChild = target->cloneElementWithoutChildren();
m_targetElementInstance = toSVGElement(newChild.get());
ShadowRoot* shadowTreeRootElement = userAgentShadowRoot();
shadowTreeRootElement->appendChild(newChild.release());
@@ -527,12 +527,12 @@ bool SVGUseElement::buildShadowTree(SVGElement* target, SVGElement* targetInstan
if (EventTargetData* data = target->eventTargetData())
data->eventListenerMap.copyEventListenersNotCreatedFromMarkupToTarget(targetInstance);
- for (RefPtrWillBeRawPtr<Node> child = target->firstChild(); child; child = child->nextSibling()) {
+ for (RawPtr<Node> child = target->firstChild(); child; child = child->nextSibling()) {
// Skip any disallowed element.
if (isDisallowedElement(child.get()))
continue;
- RefPtrWillBeRawPtr<Node> newChild = child->cloneNode(false);
+ RawPtr<Node> newChild = child->cloneNode(false);
targetInstance->appendChild(newChild.get());
if (newChild->isSVGElement()) {
// Enter recursion, appending new instance tree nodes to the "instance" object.
@@ -608,12 +608,12 @@ bool SVGUseElement::expandUseElementsInShadowTree(SVGElement* element)
return false;
// Don't ASSERT(target) here, it may be "pending", too.
// Setup sub-shadow tree root node
- RefPtrWillBeRawPtr<SVGGElement> cloneParent = SVGGElement::create(referencedScope()->document());
+ RawPtr<SVGGElement> cloneParent = SVGGElement::create(referencedScope()->document());
cloneParent->setCorrespondingElement(use->correspondingElement());
// Move already cloned elements to the new <g> element
- for (RefPtrWillBeRawPtr<Node> child = use->firstChild(); child; ) {
- RefPtrWillBeRawPtr<Node> nextChild = child->nextSibling();
+ for (RawPtr<Node> child = use->firstChild(); child; ) {
+ RawPtr<Node> nextChild = child->nextSibling();
cloneParent->appendChild(child);
child = nextChild.release();
}
@@ -623,7 +623,7 @@ bool SVGUseElement::expandUseElementsInShadowTree(SVGElement* element)
transferUseAttributesToReplacedElement(use, cloneParent.get());
if (target) {
- RefPtrWillBeRawPtr<Node> newChild = cloneNodeAndAssociate(*target);
+ RawPtr<Node> newChild = cloneNodeAndAssociate(*target);
ASSERT(newChild->isSVGElement());
transferUseWidthAndHeightIfNeeded(*use, toSVGElement(newChild.get()), *target);
cloneParent->appendChild(newChild.release());
@@ -637,7 +637,7 @@ bool SVGUseElement::expandUseElementsInShadowTree(SVGElement* element)
if (subtreeContainsDisallowedElement(cloneParent.get()))
removeDisallowedElementsFromSubtree(*cloneParent);
- RefPtrWillBeRawPtr<SVGElement> replacingElement(cloneParent.get());
+ RawPtr<SVGElement> replacingElement(cloneParent.get());
// Replace <use> with referenced content.
ASSERT(use->parentNode());
@@ -646,13 +646,13 @@ bool SVGUseElement::expandUseElementsInShadowTree(SVGElement* element)
// Expand the siblings because the *element* is replaced and we will
// lose the sibling chain when we are back from recursion.
element = replacingElement.get();
- for (RefPtrWillBeRawPtr<SVGElement> sibling = Traversal<SVGElement>::nextSibling(*element); sibling; sibling = Traversal<SVGElement>::nextSibling(*sibling)) {
+ for (RawPtr<SVGElement> sibling = Traversal<SVGElement>::nextSibling(*element); sibling; sibling = Traversal<SVGElement>::nextSibling(*sibling)) {
if (!expandUseElementsInShadowTree(sibling.get()))
return false;
}
}
- for (RefPtrWillBeRawPtr<SVGElement> child = Traversal<SVGElement>::firstChild(*element); child; child = Traversal<SVGElement>::nextSibling(*child)) {
+ for (RawPtr<SVGElement> child = Traversal<SVGElement>::firstChild(*element); child; child = Traversal<SVGElement>::nextSibling(*child)) {
if (!expandUseElementsInShadowTree(child.get()))
return false;
}
@@ -670,14 +670,14 @@ void SVGUseElement::expandSymbolElementsInShadowTree(SVGElement* element)
// the generated 'svg'. If attributes width and/or height are not specified, the generated
// 'svg' element will use values of 100% for these attributes.
ASSERT(referencedScope());
- RefPtrWillBeRawPtr<SVGSVGElement> svgElement = SVGSVGElement::create(referencedScope()->document());
+ RawPtr<SVGSVGElement> svgElement = SVGSVGElement::create(referencedScope()->document());
// Transfer all data (attributes, etc.) from <symbol> to the new <svg> element.
svgElement->cloneDataFromElement(*element);
svgElement->setCorrespondingElement(element->correspondingElement());
// Move already cloned elements to the new <svg> element
- for (RefPtrWillBeRawPtr<Node> child = element->firstChild(); child; ) {
- RefPtrWillBeRawPtr<Node> nextChild = child->nextSibling();
+ for (RawPtr<Node> child = element->firstChild(); child; ) {
+ RawPtr<Node> nextChild = child->nextSibling();
svgElement->appendChild(child);
child = nextChild.release();
}
@@ -690,7 +690,7 @@ void SVGUseElement::expandSymbolElementsInShadowTree(SVGElement* element)
if (subtreeContainsDisallowedElement(svgElement.get()))
removeDisallowedElementsFromSubtree(*svgElement);
- RefPtrWillBeRawPtr<SVGElement> replacingElement(svgElement.get());
+ RawPtr<SVGElement> replacingElement(svgElement.get());
// Replace <symbol> with <svg>.
ASSERT(element->parentNode());
@@ -701,7 +701,7 @@ void SVGUseElement::expandSymbolElementsInShadowTree(SVGElement* element)
element = replacingElement.get();
}
- for (RefPtrWillBeRawPtr<SVGElement> child = Traversal<SVGElement>::firstChild(*element); child; child = Traversal<SVGElement>::nextSibling(*child))
+ for (RawPtr<SVGElement> child = Traversal<SVGElement>::firstChild(*element); child; child = Traversal<SVGElement>::nextSibling(*child))
expandSymbolElementsInShadowTree(child.get());
}
@@ -717,11 +717,11 @@ void SVGUseElement::invalidateShadowTree()
void SVGUseElement::invalidateDependentShadowTrees()
{
// Recursively invalidate dependent <use> shadow trees
- const WillBeHeapHashSet<RawPtrWillBeWeakMember<SVGElement>>& rawInstances = instancesForElement();
- WillBeHeapVector<RefPtrWillBeMember<SVGElement>> instances;
+ const HeapHashSet<WeakMember<SVGElement>>& rawInstances = instancesForElement();
+ HeapVector<Member<SVGElement>> instances;
instances.appendRange(rawInstances.begin(), rawInstances.end());
for (auto& instance : instances) {
- if (RefPtrWillBeRawPtr<SVGUseElement> element = instance->correspondingUseElement()) {
+ if (RawPtr<SVGUseElement> element = instance->correspondingUseElement()) {
ASSERT(element->inDocument());
element->invalidateShadowTree();
}
@@ -819,7 +819,7 @@ bool SVGUseElement::instanceTreeIsLoading(const SVGElement* targetInstance)
return false;
}
-void SVGUseElement::setDocumentResource(PassRefPtrWillBeRawPtr<DocumentResource> resource)
+void SVGUseElement::setDocumentResource(RawPtr<DocumentResource> resource)
{
if (m_resource == resource)
return;

Powered by Google App Engine
This is Rietveld 408576698