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

Unified Diff: third_party/WebKit/Source/platform/text/DecodeEscapeSequences.h

Issue 2385283002: reflow comments in platform/{testing,text} (Closed)
Patch Set: idunnolol Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/text/DecodeEscapeSequences.h
diff --git a/third_party/WebKit/Source/platform/text/DecodeEscapeSequences.h b/third_party/WebKit/Source/platform/text/DecodeEscapeSequences.h
index 4dfadcf45c929a23494f6ea69c44042cb5e7e559..b0db6fc35962fd7845299d6315aa2373c4a59eee 100644
--- a/third_party/WebKit/Source/platform/text/DecodeEscapeSequences.h
+++ b/third_party/WebKit/Source/platform/text/DecodeEscapeSequences.h
@@ -38,7 +38,8 @@
namespace blink {
-// See <http://en.wikipedia.org/wiki/Percent-encoding#Non-standard_implementations>.
+// See
+// <http://en.wikipedia.org/wiki/Percent-encoding#Non-standard_implementations>.
struct Unicode16BitEscapeSequence {
STATIC_ONLY(Unicode16BitEscapeSequence);
enum { sequenceSize = 6 }; // e.g. %u26C4
@@ -63,10 +64,11 @@ struct Unicode16BitEscapeSequence {
static String decodeRun(const CharType* run,
size_t runLength,
const WTF::TextEncoding&) {
- // Each %u-escape sequence represents a UTF-16 code unit.
- // See <http://www.w3.org/International/iri-edit/draft-duerst-iri.html#anchor29>.
- // For 16-bit escape sequences, we know that findEndOfRun() has given us a contiguous run of sequences
- // without any intervening characters, so decode the run without additional checks.
+ // Each %u-escape sequence represents a UTF-16 code unit. See
+ // <http://www.w3.org/International/iri-edit/draft-duerst-iri.html#anchor29>.
+ // For 16-bit escape sequences, we know that findEndOfRun() has given us a
+ // contiguous run of sequences without any intervening characters, so decode
+ // the run without additional checks.
size_t numberOfSequences = runLength / sequenceSize;
StringBuilder builder;
builder.reserveCapacity(numberOfSequences);
@@ -89,11 +91,12 @@ struct URLEscapeSequence {
static size_t findEndOfRun(const String& string,
size_t startPosition,
size_t endPosition) {
- // Make the simplifying assumption that supported encodings may have up to two unescaped characters
- // in the range 0x40 - 0x7F as the trailing bytes of their sequences which need to be passed into the
- // decoder as part of the run. In other words, we end the run at the first value outside of the
- // 0x40 - 0x7F range, after two values in this range, or at a %-sign that does not introduce a valid
- // escape sequence.
+ // Make the simplifying assumption that supported encodings may have up to
+ // two unescaped characters in the range 0x40 - 0x7F as the trailing bytes
+ // of their sequences which need to be passed into the decoder as part of
+ // the run. In other words, we end the run at the first value outside of the
+ // 0x40 - 0x7F range, after two values in this range, or at a %-sign that
+ // does not introduce a valid escape sequence.
size_t runEnd = startPosition;
int numberOfTrailingCharacters = 0;
while (runEnd < endPosition) {
@@ -119,8 +122,9 @@ struct URLEscapeSequence {
static String decodeRun(const CharType* run,
size_t runLength,
const WTF::TextEncoding& encoding) {
- // For URL escape sequences, we know that findEndOfRun() has given us a run where every %-sign introduces
- // a valid escape sequence, but there may be characters between the sequences.
+ // For URL escape sequences, we know that findEndOfRun() has given us a run
+ // where every %-sign introduces a valid escape sequence, but there may be
+ // characters between the sequences.
Vector<char, 512> buffer;
buffer.resize(
runLength); // Unescaping hex sequences only makes the length smaller.
« no previous file with comments | « third_party/WebKit/Source/platform/text/CharacterEmoji.cpp ('k') | third_party/WebKit/Source/platform/text/Hyphenation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698