Changeset 127525 in webkit
- Timestamp:
- Sep 4, 2012 4:58:01 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 19 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r127501 r127525 1989 1989 platform/text/RegularExpression.cpp 1990 1990 platform/text/SegmentedString.cpp 1991 platform/text/String.cpp1992 1991 platform/text/TextBoundaries.cpp 1992 platform/text/TextBreakIterator.cpp 1993 1993 platform/text/TextCodec.cpp 1994 1994 platform/text/TextCodecLatin1.cpp -
trunk/Source/WebCore/ChangeLog
r127520 r127525 1 2012-09-03 Sam Weinig <sam@webkit.org> 2 3 Part 1 of removing PlatformString.h, move remaining functions to new homes 4 https://bugs.webkit.org/show_bug.cgi?id=95702 5 6 Reviewed by Beth Dakin. 7 8 Move utf8Buffer() to SharedBuffer.h/cpp 9 Move numGraphemeClusters() and numCharactersInGraphemeClusters() to TextBreakIterator.h/cpp 10 11 * CMakeLists.txt: 12 * GNUmakefile.list.am: 13 * Target.pri: 14 * WebCore.gypi: 15 * WebCore.vcproj/WebCore.vcproj: 16 * WebCore.xcodeproj/project.pbxproj: 17 Update projects. 18 19 * platform/text/TextAllInOne.cpp: 20 Add TextBreakIterator.cpp. 21 22 * editing/Editor.h: 23 Forward declare SharedBuffer, now that PlatformString.h doesn't. 24 25 * html/InputType.cpp: 26 #include TextBreakIterator.h. 27 28 * loader/appcache/ApplicationCacheStorage.h: 29 Replace inclusion of PlatformString.h with WTFString.h and forward declare SharedBuffer. 30 31 * platform/LocalizedStrings.cpp: 32 Replace inclusion of PlatformString.h with TextBreakIterator.h 33 34 * platform/SharedBuffer.cpp: 35 * platform/SharedBuffer.h: 36 Move utf8Buffer() here. 37 38 * platform/text/PlatformString.h: 39 Remove everything except the #include of WTFString.h. 40 41 * platform/text/TextBreakIterator.cpp: Renamed from Source/WebCore/platform/text/String.cpp. 42 (WebCore::numGraphemeClusters): 43 (WebCore::numCharactersInGraphemeClusters): 44 * platform/text/TextBreakIterator.h: 45 Move numGraphemeClusters() and numCharactersInGraphemeClusters() here. 46 1 47 2012-09-04 Julien Chaffraix <jchaffraix@webkit.org> 2 48 -
trunk/Source/WebCore/GNUmakefile.list.am
r127501 r127525 4765 4765 Source/WebCore/platform/text/SegmentedString.cpp \ 4766 4766 Source/WebCore/platform/text/SegmentedString.h \ 4767 Source/WebCore/platform/text/String.cpp \4768 4767 Source/WebCore/platform/text/StringWithDirection.h \ 4769 4768 Source/WebCore/platform/text/SuffixTree.h \ 4770 4769 Source/WebCore/platform/text/TextBoundaries.cpp \ 4771 4770 Source/WebCore/platform/text/TextBoundaries.h \ 4771 Source/WebCore/platform/text/TextBreakIterator.cpp \ 4772 4772 Source/WebCore/platform/text/TextBreakIterator.h \ 4773 4773 Source/WebCore/platform/text/TextCheckerClient.h \ -
trunk/Source/WebCore/Target.pri
r127217 r127525 1063 1063 platform/sql/SQLValue.cpp \ 1064 1064 platform/text/SegmentedString.cpp \ 1065 platform/text/String.cpp \1066 1065 platform/text/TextBoundaries.cpp \ 1066 platform/text/TextBreakIterator.cpp \ 1067 1067 platform/text/TextCodec.cpp \ 1068 1068 platform/text/TextCodecLatin1.cpp \ -
trunk/Source/WebCore/WebCore.gypi
r127501 r127525 4480 4480 'platform/text/RegularExpression.cpp', 4481 4481 'platform/text/SegmentedString.cpp', 4482 'platform/text/String.cpp',4483 4482 'platform/text/StringWithDirection.h', 4484 4483 'platform/text/SuffixTree.h', 4485 4484 'platform/text/TextBoundaries.cpp', 4485 'platform/text/TextBreakIterator.cpp', 4486 4486 'platform/text/TextBreakIteratorICU.cpp', 4487 4487 'platform/text/TextCodec.cpp', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r127454 r127525 33723 33723 </File> 33724 33724 <File 33725 RelativePath="..\platform\text\String.cpp"33726 >33727 </File>33728 <File33729 33725 RelativePath="..\platform\text\StringHash.h" 33730 33726 > … … 33829 33825 RelativePath="..\platform\text\TextBreakIterator.h" 33830 33826 > 33827 </File> 33828 <File 33829 RelativePath="..\platform\text\TextBreakIterator.cpp" 33830 > 33831 <FileConfiguration 33832 Name="Release|Win32" 33833 ExcludedFromBuild="true" 33834 > 33835 <Tool 33836 Name="VCCLCompilerTool" 33837 /> 33838 </FileConfiguration> 33839 <FileConfiguration 33840 Name="Production|Win32" 33841 ExcludedFromBuild="true" 33842 > 33843 <Tool 33844 Name="VCCLCompilerTool" 33845 /> 33846 </FileConfiguration> 33831 33847 </File> 33832 33848 <File -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r127217 r127525 4921 4921 B2C3DA2E0D006C1D00EF6F26 /* SegmentedString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3D9FE0D006C1D00EF6F26 /* SegmentedString.cpp */; }; 4922 4922 B2C3DA2F0D006C1D00EF6F26 /* SegmentedString.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3D9FF0D006C1D00EF6F26 /* SegmentedString.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4923 B2C3DA300D006C1D00EF6F26 /* String.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2C3DA000D006C1D00EF6F26 /* String.cpp */; };4924 4923 B2C3DA340D006C1D00EF6F26 /* TextBoundaries.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA040D006C1D00EF6F26 /* TextBoundaries.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4925 4924 B2C3DA360D006C1D00EF6F26 /* TextBreakIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = B2C3DA060D006C1D00EF6F26 /* TextBreakIterator.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5632 5631 BCD41ABB0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */; }; 5633 5632 BCD533640ED6848900887468 /* CachedScriptSourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */; }; 5633 BCD8A5F015F56F2C0098D071 /* TextBreakIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD8A5EF15F56F2C0098D071 /* TextBreakIterator.cpp */; }; 5634 5634 BCD9C2620C17AA67005C90A2 /* JSDOMWindowCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */; }; 5635 5635 BCD9C2630C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD9C25F0C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp */; }; … … 12193 12193 B2C3D9FE0D006C1D00EF6F26 /* SegmentedString.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SegmentedString.cpp; sourceTree = "<group>"; }; 12194 12194 B2C3D9FF0D006C1D00EF6F26 /* SegmentedString.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SegmentedString.h; sourceTree = "<group>"; }; 12195 B2C3DA000D006C1D00EF6F26 /* String.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = String.cpp; sourceTree = "<group>"; };12196 12195 B2C3DA040D006C1D00EF6F26 /* TextBoundaries.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextBoundaries.h; sourceTree = "<group>"; }; 12197 12196 B2C3DA060D006C1D00EF6F26 /* TextBreakIterator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TextBreakIterator.h; sourceTree = "<group>"; }; … … 12932 12931 BCD41ABA0C060DE800C0E446 /* JSHTMLFrameSetElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFrameSetElementCustom.cpp; sourceTree = "<group>"; }; 12933 12932 BCD533630ED6848900887468 /* CachedScriptSourceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedScriptSourceProvider.h; sourceTree = "<group>"; }; 12933 BCD8A5EF15F56F2C0098D071 /* TextBreakIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextBreakIterator.cpp; sourceTree = "<group>"; }; 12934 12934 BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMWindowCustom.cpp; sourceTree = "<group>"; }; 12935 12935 BCD9C25F0C17AA67005C90A2 /* JSNamedNodeMapCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNamedNodeMapCustom.cpp; sourceTree = "<group>"; }; … … 19991 19991 B2C3D9FE0D006C1D00EF6F26 /* SegmentedString.cpp */, 19992 19992 B2C3D9FF0D006C1D00EF6F26 /* SegmentedString.h */, 19993 B2C3DA000D006C1D00EF6F26 /* String.cpp */,19994 19993 9B6C41521344949000085B62 /* StringWithDirection.h */, 19995 19994 97C0784F1165D5BE003A32EF /* SuffixTree.h */, 19996 19995 372C00C3129611F1005C9575 /* TextBoundaries.cpp */, 19997 19996 B2C3DA040D006C1D00EF6F26 /* TextBoundaries.h */, 19997 BCD8A5EF15F56F2C0098D071 /* TextBreakIterator.cpp */, 19998 19998 B2C3DA060D006C1D00EF6F26 /* TextBreakIterator.h */, 19999 19999 B2C3DA070D006C1D00EF6F26 /* TextBreakIteratorICU.cpp */, … … 28131 28131 511F23190DC160DA004F0032 /* StorageThread.cpp in Sources */, 28132 28132 3AB02D2B12D4F91600FBB694 /* StorageTracker.cpp in Sources */, 28133 B2C3DA300D006C1D00EF6F26 /* String.cpp in Sources */,28134 28133 8102C5881325BB1100DDE67A /* StringCallback.cpp in Sources */, 28135 28134 B2B2645C0D00A77E000ACC1D /* StringCF.cpp in Sources */, … … 28588 28587 4FB390AD15EF61F3007AD51F /* GeneratedImage.cpp in Sources */, 28589 28588 377A3A9015EFCE9B0059F5C7 /* BitmapImageCG.cpp in Sources */, 28589 BCD8A5F015F56F2C0098D071 /* TextBreakIterator.cpp in Sources */, 28590 28590 ); 28591 28591 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebCore/editing/Editor.h
r123429 r127525 65 65 class SpellCheckRequest; 66 66 class AlternativeTextController; 67 class SharedBuffer; 67 68 class StylePropertySet; 68 69 class Text; -
trunk/Source/WebCore/html/InputType.cpp
r126966 r127525 69 69 #include "SubmitInputType.h" 70 70 #include "TelephoneInputType.h" 71 #include "TextBreakIterator.h" 71 72 #include "TextInputType.h" 72 73 #include "TimeInputType.h" -
trunk/Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp
r127400 r127525 32 32 #include "RenderStyle.h" 33 33 #include "StyleResolver.h" 34 #include "TextBreakIterator.h" 34 35 #include "TextRun.h" 35 36 #include <wtf/text/StringBuilder.h> -
trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.h
r95919 r127525 27 27 #define ApplicationCacheStorage_h 28 28 29 #include "PlatformString.h"30 29 #include "SecurityOriginHash.h" 31 30 #include "SQLiteDatabase.h" … … 33 32 #include <wtf/HashSet.h> 34 33 #include <wtf/text/StringHash.h> 34 #include <wtf/text/WTFString.h> 35 35 36 36 namespace WebCore { … … 41 41 class ApplicationCacheResource; 42 42 class KURL; 43 template <class T>44 class StorageIDJournal;45 43 class SecurityOrigin; 44 class SharedBuffer; 45 template <class T> class StorageIDJournal; 46 46 47 47 class ApplicationCacheStorage { -
trunk/Source/WebCore/platform/LocalizedStrings.cpp
r124636 r127525 30 30 #include "IntSize.h" 31 31 #include "NotImplemented.h" 32 #include " PlatformString.h"32 #include "TextBreakIterator.h" 33 33 #include <wtf/MathExtras.h> 34 #include <wtf/UnusedParam.h> 35 #include <wtf/unicode/CharacterNames.h> 36 34 37 #if USE(CF) 35 38 #include <wtf/RetainPtr.h> 36 39 #endif 37 #include <wtf/UnusedParam.h>38 #include <wtf/unicode/CharacterNames.h>39 40 40 41 #if PLATFORM(MAC) -
trunk/Source/WebCore/platform/SharedBuffer.cpp
r124884 r127525 31 31 #include "PurgeableBuffer.h" 32 32 #include <wtf/PassOwnPtr.h> 33 #include <wtf/unicode/UTF8.h> 34 #include <wtf/unicode/Unicode.h> 33 35 34 36 using namespace std; … … 331 333 #endif 332 334 333 } 335 PassRefPtr<SharedBuffer> utf8Buffer(const String& string) 336 { 337 // Allocate a buffer big enough to hold all the characters. 338 const int length = string.length(); 339 Vector<char> buffer(length * 3); 340 341 // Convert to runs of 8-bit characters. 342 char* p = buffer.data(); 343 const UChar* d = string.characters(); 344 WTF::Unicode::ConversionResult result = WTF::Unicode::convertUTF16ToUTF8(&d, d + length, &p, p + buffer.size(), true); 345 if (result != WTF::Unicode::conversionOK) 346 return 0; 347 348 buffer.shrink(p - buffer.data()); 349 return SharedBuffer::adoptVector(buffer); 350 } 351 352 } // namespace WebCore -
trunk/Source/WebCore/platform/SharedBuffer.h
r123716 r127525 149 149 #endif 150 150 }; 151 152 } 151 152 PassRefPtr<SharedBuffer> utf8Buffer(const String&); 153 154 } // namespace WebCore 153 155 154 156 #endif // SharedBuffer_h -
trunk/Source/WebCore/platform/text/PlatformString.h
r57904 r127525 29 29 30 30 namespace WebCore { 31 32 class SharedBuffer;33 34 PassRefPtr<SharedBuffer> utf8Buffer(const String&);35 // Counts the number of grapheme clusters. A surrogate pair or a sequence36 // of a non-combining character and following combining characters is37 // counted as 1 grapheme cluster.38 unsigned numGraphemeClusters(const String& s);39 // Returns the number of characters which will be less than or equal to40 // the specified grapheme cluster length.41 unsigned numCharactersInGraphemeClusters(const String& s, unsigned);42 43 31 } // namespace WebCore 44 32 -
trunk/Source/WebCore/platform/text/TextAllInOne.cpp
r109929 r127525 27 27 28 28 #include "TextBoundaries.cpp" 29 #include "TextBreakIterator.cpp" 29 30 #include "TextBreakIteratorICU.cpp" 30 31 #include "TextCodec.cpp" -
trunk/Source/WebCore/platform/text/TextBreakIterator.cpp
r127520 r127525 21 21 22 22 #include "config.h" 23 #include "PlatformString.h"24 25 #include "SharedBuffer.h"26 23 #include "TextBreakIterator.h" 27 #include <wtf/unicode/UTF8.h>28 #include <wtf/unicode/Unicode.h>29 30 using namespace WTF;31 using namespace WTF::Unicode;32 24 33 25 namespace WebCore { 34 35 PassRefPtr<SharedBuffer> utf8Buffer(const String& string)36 {37 // Allocate a buffer big enough to hold all the characters.38 const int length = string.length();39 Vector<char> buffer(length * 3);40 41 // Convert to runs of 8-bit characters.42 char* p = buffer.data();43 const UChar* d = string.characters();44 ConversionResult result = convertUTF16ToUTF8(&d, d + length, &p, p + buffer.size(), true);45 if (result != conversionOK)46 return 0;47 48 buffer.shrink(p - buffer.data());49 return SharedBuffer::adoptVector(buffer);50 }51 26 52 27 unsigned numGraphemeClusters(const String& s) … … 66 41 NonSharedCharacterBreakIterator it(s.characters(), s.length()); 67 42 if (!it) 68 return min(s.length(), numGraphemeClusters);43 return std::min(s.length(), numGraphemeClusters); 69 44 70 45 for (unsigned i = 0; i < numGraphemeClusters; ++i) { -
trunk/Source/WebCore/platform/text/TextBreakIterator.h
r118568 r127525 116 116 }; 117 117 118 // Counts the number of grapheme clusters. A surrogate pair or a sequence 119 // of a non-combining character and following combining characters is 120 // counted as 1 grapheme cluster. 121 unsigned numGraphemeClusters(const String&); 122 // Returns the number of characters which will be less than or equal to 123 // the specified grapheme cluster length. 124 unsigned numCharactersInGraphemeClusters(const String&, unsigned); 125 118 126 } 119 127 -
trunk/Source/WebKit2/ChangeLog
r127513 r127525 1 2012-09-03 Sam Weinig <sam@webkit.org> 2 3 Part 1 of removing PlatformString.h, move remaining functions to new homes 4 https://bugs.webkit.org/show_bug.cgi?id=95702 5 6 Reviewed by Beth Dakin. 7 8 * UIProcess/WebPageProxy.h: 9 Forward declare SharedBuffer. 10 1 11 2012-09-04 Jeffrey Pfau <jpfau@apple.com> 2 12 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r126343 r127525 100 100 class IntSize; 101 101 class ProtectionSpace; 102 class SharedBuffer; 102 103 struct FileChooserSettings; 103 104 struct TextAlternativeWithRange;
Note: See TracChangeset
for help on using the changeset viewer.