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

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

Issue 482753002: Use StringBuilder::appendLiteral() / StringBuilder::append(char) when possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/DatasetDOMStringMap.cpp ('k') | Source/core/fileapi/FileReaderLoader.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 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after
1634 static void appendAttributeDesc(const Node* node, StringBuilder& stringBuilder, const QualifiedName& name, const char* attrDesc) 1634 static void appendAttributeDesc(const Node* node, StringBuilder& stringBuilder, const QualifiedName& name, const char* attrDesc)
1635 { 1635 {
1636 if (!node->isElementNode()) 1636 if (!node->isElementNode())
1637 return; 1637 return;
1638 1638
1639 String attr = toElement(node)->getAttribute(name); 1639 String attr = toElement(node)->getAttribute(name);
1640 if (attr.isEmpty()) 1640 if (attr.isEmpty())
1641 return; 1641 return;
1642 1642
1643 stringBuilder.append(attrDesc); 1643 stringBuilder.append(attrDesc);
1644 stringBuilder.append("=\""); 1644 stringBuilder.appendLiteral("=\"");
1645 stringBuilder.append(attr); 1645 stringBuilder.append(attr);
1646 stringBuilder.append("\""); 1646 stringBuilder.appendLiteral("\"");
1647 } 1647 }
1648 1648
1649 void Node::showNode(const char* prefix) const 1649 void Node::showNode(const char* prefix) const
1650 { 1650 {
1651 if (!prefix) 1651 if (!prefix)
1652 prefix = ""; 1652 prefix = "";
1653 if (isTextNode()) { 1653 if (isTextNode()) {
1654 String value = nodeValue(); 1654 String value = nodeValue();
1655 value.replaceWithLiteral('\\', "\\\\"); 1655 value.replaceWithLiteral('\\', "\\\\");
1656 value.replaceWithLiteral('\n', "\\n"); 1656 value.replaceWithLiteral('\n', "\\n");
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 node->showTreeForThis(); 2476 node->showTreeForThis();
2477 } 2477 }
2478 2478
2479 void showNodePath(const blink::Node* node) 2479 void showNodePath(const blink::Node* node)
2480 { 2480 {
2481 if (node) 2481 if (node)
2482 node->showNodePathForThis(); 2482 node->showNodePathForThis();
2483 } 2483 }
2484 2484
2485 #endif 2485 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/DatasetDOMStringMap.cpp ('k') | Source/core/fileapi/FileReaderLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698