OLD | NEW |
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 Loading... |
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.append("<null>"); | 597 result.appendLiteral("<null>"); |
598 } else { | 598 } else { |
599 char s[1024]; | 599 char s[1024]; |
600 result.append("offset "); | 600 result.appendLiteral("offset "); |
601 result.appendNumber(m_offset); | 601 result.appendNumber(m_offset); |
602 result.append(" of "); | 602 result.appendLiteral(" 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 Loading... |
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 |
OLD | NEW |