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

Side by Side Diff: third_party/WebKit/Source/core/editing/Position.cpp

Issue 2017053003: Remove StringBuilder::appendLiteral. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. 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 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 } 587 }
588 588
589 #ifndef NDEBUG 589 #ifndef NDEBUG
590 590
591 template <typename Strategy> 591 template <typename Strategy>
592 void PositionTemplate<Strategy>::formatForDebugger(char* buffer, unsigned length ) const 592 void PositionTemplate<Strategy>::formatForDebugger(char* buffer, unsigned length ) const
593 { 593 {
594 StringBuilder result; 594 StringBuilder result;
595 595
596 if (isNull()) { 596 if (isNull()) {
597 result.appendLiteral("<null>"); 597 result.append("<null>");
598 } else { 598 } else {
599 char s[1024]; 599 char s[1024];
600 result.appendLiteral("offset "); 600 result.append("offset ");
601 result.appendNumber(m_offset); 601 result.appendNumber(m_offset);
602 result.appendLiteral(" of "); 602 result.append(" of ");
603 anchorNode()->formatForDebugger(s, sizeof(s)); 603 anchorNode()->formatForDebugger(s, sizeof(s));
604 result.append(s); 604 result.append(s);
605 } 605 }
606 606
607 strncpy(buffer, result.toString().utf8().data(), length - 1); 607 strncpy(buffer, result.toString().utf8().data(), length - 1);
608 } 608 }
609 609
610 template <typename Strategy> 610 template <typename Strategy>
611 void PositionTemplate<Strategy>::showAnchorTypeAndOffset() const 611 void PositionTemplate<Strategy>::showAnchorTypeAndOffset() const
612 { 612 {
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 703
704 void showTree(const blink::Position* pos) 704 void showTree(const blink::Position* pos)
705 { 705 {
706 if (pos) 706 if (pos)
707 pos->showTreeForThis(); 707 pos->showTreeForThis();
708 else 708 else
709 fprintf(stderr, "Cannot showTree for (nil)\n"); 709 fprintf(stderr, "Cannot showTree for (nil)\n");
710 } 710 }
711 711
712 #endif 712 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Text.cpp ('k') | third_party/WebKit/Source/core/editing/VisibleSelection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698