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

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

Issue 112843002: Make calls to AtomicString(const String&) explicit in dom/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added comments Created 6 years, 11 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 | « no previous file | Source/core/dom/ClassNodeList.h » ('j') | Source/core/dom/NamedFlowCollection.cpp » ('J')
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 m_element->willModifyAttribute(qualifiedName(), this->value(), value); 136 m_element->willModifyAttribute(qualifiedName(), this->value(), value);
137 137
138 setValue(value); 138 setValue(value);
139 139
140 if (m_element) 140 if (m_element)
141 m_element->didModifyAttribute(qualifiedName(), value); 141 m_element->didModifyAttribute(qualifiedName(), value);
142 } 142 }
143 143
144 void Attr::setNodeValue(const String& v) 144 void Attr::setNodeValue(const String& v)
145 { 145 {
146 setValue(v, IGNORE_EXCEPTION); 146 // Attr uses AtomicString type for its value to save memory as there
147 // is duplication among Elements' attributes values.
148 setValue(AtomicString(v), IGNORE_EXCEPTION);
147 } 149 }
148 150
149 PassRefPtr<Node> Attr::cloneNode(bool /*deep*/) 151 PassRefPtr<Node> Attr::cloneNode(bool /*deep*/)
150 { 152 {
151 RefPtr<Attr> clone = adoptRef(new Attr(document(), qualifiedName(), value()) ); 153 RefPtr<Attr> clone = adoptRef(new Attr(document(), qualifiedName(), value()) );
152 cloneChildNodes(clone.get()); 154 cloneChildNodes(clone.get());
153 return clone.release(); 155 return clone.release();
154 } 156 }
155 157
156 // DOM Section 1.1.1 158 // DOM Section 1.1.1
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 215 }
214 216
215 void Attr::attachToElement(Element* element) 217 void Attr::attachToElement(Element* element)
216 { 218 {
217 ASSERT(!m_element); 219 ASSERT(!m_element);
218 m_element = element; 220 m_element = element;
219 m_standaloneValue = nullAtom; 221 m_standaloneValue = nullAtom;
220 } 222 }
221 223
222 } 224 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/ClassNodeList.h » ('j') | Source/core/dom/NamedFlowCollection.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698