Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All |
| 7 * rights reserved. | 7 * rights reserved. |
| 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. |
| 9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
| 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. | 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. |
| (...skipping 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1306 static inline String canonicalizedTitle(Document* document, | 1306 static inline String canonicalizedTitle(Document* document, |
| 1307 const String& title) { | 1307 const String& title) { |
| 1308 unsigned length = title.length(); | 1308 unsigned length = title.length(); |
| 1309 unsigned builderIndex = 0; | 1309 unsigned builderIndex = 0; |
| 1310 const CharacterType* characters = title.getCharacters<CharacterType>(); | 1310 const CharacterType* characters = title.getCharacters<CharacterType>(); |
| 1311 | 1311 |
| 1312 StringBuffer<CharacterType> buffer(length); | 1312 StringBuffer<CharacterType> buffer(length); |
| 1313 | 1313 |
| 1314 // Replace control characters with spaces and collapse whitespace. | 1314 // Replace control characters with spaces and collapse whitespace. |
| 1315 bool pendingWhitespace = false; | 1315 bool pendingWhitespace = false; |
| 1316 const UChar lineTabulationCharacter = 0x0b; | |
|
tkent
2016/11/08 03:57:15
Please use symbols defined in wtf/text/CharacterNa
| |
| 1317 const UChar spaceCharacter = 0x20; | |
| 1318 const UChar deleteCharacter = 0x7f; | |
| 1316 for (unsigned i = 0; i < length; ++i) { | 1319 for (unsigned i = 0; i < length; ++i) { |
| 1317 UChar32 c = characters[i]; | 1320 UChar32 c = characters[i]; |
| 1318 if (c <= 0x20 || c == 0x7F || | 1321 if ((c <= spaceCharacter && c != lineTabulationCharacter) || |
| 1319 (WTF::Unicode::category(c) & | 1322 c == deleteCharacter) { |
| 1320 (WTF::Unicode::Separator_Line | WTF::Unicode::Separator_Paragraph))) { | |
| 1321 if (builderIndex != 0) | 1323 if (builderIndex != 0) |
| 1322 pendingWhitespace = true; | 1324 pendingWhitespace = true; |
| 1323 } else { | 1325 } else { |
| 1324 if (pendingWhitespace) { | 1326 if (pendingWhitespace) { |
| 1325 buffer[builderIndex++] = ' '; | 1327 buffer[builderIndex++] = ' '; |
| 1326 pendingWhitespace = false; | 1328 pendingWhitespace = false; |
| 1327 } | 1329 } |
| 1328 buffer[builderIndex++] = c; | 1330 buffer[builderIndex++] = c; |
| 1329 } | 1331 } |
| 1330 } | 1332 } |
| (...skipping 5147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6478 } | 6480 } |
| 6479 | 6481 |
| 6480 void showLiveDocumentInstances() { | 6482 void showLiveDocumentInstances() { |
| 6481 WeakDocumentSet& set = liveDocumentSet(); | 6483 WeakDocumentSet& set = liveDocumentSet(); |
| 6482 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 6484 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
| 6483 for (Document* document : set) | 6485 for (Document* document : set) |
| 6484 fprintf(stderr, "- Document %p URL: %s\n", document, | 6486 fprintf(stderr, "- Document %p URL: %s\n", document, |
| 6485 document->url().getString().utf8().data()); | 6487 document->url().getString().utf8().data()); |
| 6486 } | 6488 } |
| 6487 #endif | 6489 #endif |
| OLD | NEW |