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

Side by Side Diff: third_party/WebKit/Source/core/dom/Range.cpp

Issue 2017303002: Revert of Remove StringBuilder::appendLiteral. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * (C) 1999 Lars Knoll (knoll@kde.org) 2 * (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no) 3 * (C) 2000 Gunnstein Lye (gunnstein@netcom.no)
4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no) 4 * (C) 2000 Frederik Holljen (frederik.holljen@hig.no)
5 * (C) 2001 Peter Kelly (pmk@post.com) 5 * (C) 2001 Peter Kelly (pmk@post.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
7 * Copyright (C) 2011 Motorola Mobility. All rights reserved. 7 * Copyright (C) 2011 Motorola Mobility. All rights reserved.
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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 } 1306 }
1307 } 1307 }
1308 1308
1309 #ifndef NDEBUG 1309 #ifndef NDEBUG
1310 void Range::formatForDebugger(char* buffer, unsigned length) const 1310 void Range::formatForDebugger(char* buffer, unsigned length) const
1311 { 1311 {
1312 StringBuilder result; 1312 StringBuilder result;
1313 1313
1314 const int FormatBufferSize = 1024; 1314 const int FormatBufferSize = 1024;
1315 char s[FormatBufferSize]; 1315 char s[FormatBufferSize];
1316 result.append("from offset "); 1316 result.appendLiteral("from offset ");
1317 result.appendNumber(m_start.offset()); 1317 result.appendNumber(m_start.offset());
1318 result.append(" of "); 1318 result.appendLiteral(" of ");
1319 m_start.container()->formatForDebugger(s, FormatBufferSize); 1319 m_start.container()->formatForDebugger(s, FormatBufferSize);
1320 result.append(s); 1320 result.append(s);
1321 result.append(" to offset "); 1321 result.appendLiteral(" to offset ");
1322 result.appendNumber(m_end.offset()); 1322 result.appendNumber(m_end.offset());
1323 result.append(" of "); 1323 result.appendLiteral(" of ");
1324 m_end.container()->formatForDebugger(s, FormatBufferSize); 1324 m_end.container()->formatForDebugger(s, FormatBufferSize);
1325 result.append(s); 1325 result.append(s);
1326 1326
1327 strncpy(buffer, result.toString().utf8().data(), length - 1); 1327 strncpy(buffer, result.toString().utf8().data(), length - 1);
1328 } 1328 }
1329 #endif 1329 #endif
1330 1330
1331 bool areRangesEqual(const Range* a, const Range* b) 1331 bool areRangesEqual(const Range* a, const Range* b)
1332 { 1332 {
1333 if (a == b) 1333 if (a == b)
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1607 { 1607 {
1608 if (range && range->boundaryPointsValid()) { 1608 if (range && range->boundaryPointsValid()) {
1609 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E"); 1609 range->startContainer()->showTreeAndMark(range->startContainer(), "S", r ange->endContainer(), "E");
1610 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset()); 1610 fprintf(stderr, "start offset: %d, end offset: %d\n", range->startOffset (), range->endOffset());
1611 } else { 1611 } else {
1612 fprintf(stderr, "Cannot show tree if range is null, or if boundary point s are invalid.\n"); 1612 fprintf(stderr, "Cannot show tree if range is null, or if boundary point s are invalid.\n");
1613 } 1613 }
1614 } 1614 }
1615 1615
1616 #endif 1616 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.cpp ('k') | third_party/WebKit/Source/core/dom/SandboxFlags.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698