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

Side by Side Diff: Source/core/dom/Attr.cpp

Issue 49613005: Have TreeScrope::adoptIfNeeded() take a reference instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 | « no previous file | Source/core/dom/ContainerNode.cpp » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2012 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2012 Apple Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 void Attr::createTextChild() 79 void Attr::createTextChild()
80 { 80 {
81 ASSERT(refCount()); 81 ASSERT(refCount());
82 if (!value().isEmpty()) { 82 if (!value().isEmpty()) {
83 RefPtr<Text> textNode = document().createTextNode(value().string()); 83 RefPtr<Text> textNode = document().createTextNode(value().string());
84 84
85 // This does everything appendChild() would do in this situation (assumi ng m_ignoreChildrenChanged was set), 85 // This does everything appendChild() would do in this situation (assumi ng m_ignoreChildrenChanged was set),
86 // but much more efficiently. 86 // but much more efficiently.
87 textNode->setParentOrShadowHostNode(this); 87 textNode->setParentOrShadowHostNode(this);
88 treeScope().adoptIfNeeded(textNode.get()); 88 treeScope().adoptIfNeeded(*textNode);
89 setFirstChild(textNode.get()); 89 setFirstChild(textNode.get());
90 setLastChild(textNode.get()); 90 setLastChild(textNode.get());
91 } 91 }
92 } 92 }
93 93
94 void Attr::setPrefix(const AtomicString& prefix, ExceptionState& es) 94 void Attr::setPrefix(const AtomicString& prefix, ExceptionState& es)
95 { 95 {
96 UseCounter::count(document(), UseCounter::AttributeSetPrefix); 96 UseCounter::count(document(), UseCounter::AttributeSetPrefix);
97 97
98 checkSetPrefix(prefix, es); 98 checkSetPrefix(prefix, es);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 215
216 void Attr::attachToElement(Element* element) 216 void Attr::attachToElement(Element* element)
217 { 217 {
218 ASSERT(!m_element); 218 ASSERT(!m_element);
219 m_element = element; 219 m_element = element;
220 m_standaloneValue = nullAtom; 220 m_standaloneValue = nullAtom;
221 } 221 }
222 222
223 } 223 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/ContainerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698