Changeset 57904 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Apr 20, 2010, 12:28:41 PM (15 years ago)
Author:
[email protected]
Message:

Bug 37828 - Move WebCore's String classes to WTF

Reviewed by Geoff Garen.

Move these classes up to WTF so they are available to all clients of WTF (in
particular JSC).

As a first patch, making the most minimal change possible, since this patch
could easily grow rather large since we'll have to change every class forward
declaration ( e.g. every "namespace WebCore { class String; }" much change to
"namespace WTF { class String; }").

JavaScriptCore:

Moving the files, but leaving the classes logically in the WebCore namespace -
which is technically a layering violation - I'll come back and fix this up in a
subsequent patch.

  • Android.mk:
  • Android.v8.wtf.mk:
  • GNUmakefile.am:
  • JavaScriptCore.exp:
  • JavaScriptCore.gypi:
  • JavaScriptCore.pro:
  • JavaScriptCore.vcproj/WTF/WTF.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • config.h:
  • wtf/StaticConstructors.h: Copied from WebCore/platform/StaticConstructors.h.
  • wtf/text/AtomicString.cpp: Copied from WebCore/platform/text/AtomicString.cpp.
  • wtf/text/AtomicString.h: Copied from WebCore/platform/text/AtomicString.h.
  • wtf/text/AtomicStringImpl.h: Copied from WebCore/platform/text/AtomicStringImpl.h.
  • wtf/text/StringBuffer.h: Copied from WebCore/platform/text/StringBuffer.h.
  • wtf/text/StringHash.h: Copied from WebCore/platform/text/StringHash.h.
  • wtf/text/StringImpl.cpp: Copied from WebCore/platform/text/StringImpl.cpp.
  • wtf/text/StringImpl.h: Copied from WebCore/platform/text/StringImpl.h.
  • wtf/text/WTFString.cpp: Copied from WebCore/platform/text/String.cpp.

(WebCore::charactersToFloat):

  • wtf/text/WTFString.h: Copied from WebCore/platform/text/PlatformString.h.

WebCore:

Moving the files, but leaving the classes logically in the WebCore namespace –
which is technically a layering violation – I'll come back and fix this up in a
subsequent patch.

  • Android.mk:
  • ForwardingHeaders/wtf/StaticConstructors.h: Added.
  • ForwardingHeaders/wtf/text/AtomicString.h: Added.
  • ForwardingHeaders/wtf/text/AtomicStringImpl.h: Added.
  • ForwardingHeaders/wtf/text/StringBuffer.h: Added.
  • ForwardingHeaders/wtf/text/StringHash.h: Added.
  • ForwardingHeaders/wtf/text/StringImpl.h: Added.
  • ForwardingHeaders/wtf/text/WTFString.h: Added.
  • GNUmakefile.am:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • css/MediaFeatureNames.cpp:
  • dom/QualifiedName.cpp:
  • dom/make_names.pl:
  • platform/StaticConstructors.h: Removed.
  • platform/text/AtomicString.cpp: Removed.
  • platform/text/AtomicString.h:
  • platform/text/AtomicStringImpl.h:
  • platform/text/PlatformString.h:
  • platform/text/String.cpp:
  • platform/text/StringHash.h:
  • platform/text/StringImpl.cpp: Removed.
  • platform/text/StringImpl.h:
Location:
trunk/JavaScriptCore
Files:
10 edited
7 copied
3 moved

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/Android.mk

    r57879 r57904  
    173173        wtf/android/MainThreadAndroid.cpp \
    174174        \
     175        wtf/text/AtomicString.cpp \
    175176        wtf/text/CString.cpp \
     177        wtf/text/StringImpl.cpp \
     178        wtf/text/WTFString.cpp \
    176179        \
    177180        wtf/unicode/CollatorDefault.cpp \
  • trunk/JavaScriptCore/Android.v8.wtf.mk

    r57879 r57904  
    4848        wtf/WTFThreadData.cpp \
    4949        \
     50        wtf/TypeTraits.cpp \
     51        wtf/dtoa.cpp \
     52        \
    5053        wtf/android/MainThreadAndroid.cpp \
    5154        \
    52         wtf/TypeTraits.cpp \
    53         wtf/dtoa.cpp \
     55        wtf/text/AtomicString.cpp \
     56        wtf/text/CString.cpp \
     57        wtf/text/StringImpl.cpp \
     58        wtf/text/WTFString.cpp \
    5459        \
    5560        wtf/unicode/CollatorDefault.cpp \
  • trunk/JavaScriptCore/ChangeLog

    r57885 r57904  
     12010-04-20  Gavin Barraclough  <[email protected]>
     2
     3        Reviewed by Geoff Garen.
     4
     5        Bug 37828 - Move WebCore's String classes to WTF
     6
     7        Move these classes up to WTF so they are available to all clients of WTF (in
     8        particular JSC).
     9
     10        As a first patch, making the most minimal change possible, since this patch
     11        could easily grow rather large since we'll have to change every class forward
     12        declaration ( e.g. every "namespace WebCore { class String; }" much change to
     13        "namespace WTF { class String; }").
     14
     15        Moving the files, but leaving the classes logically in the WebCore namespace -
     16        which is technically a layering violation - I'll come back and fix this up in a
     17        subsequent patch.
     18
     19        * Android.mk:
     20        * Android.v8.wtf.mk:
     21        * GNUmakefile.am:
     22        * JavaScriptCore.exp:
     23        * JavaScriptCore.gypi:
     24        * JavaScriptCore.pro:
     25        * JavaScriptCore.vcproj/WTF/WTF.vcproj:
     26        * JavaScriptCore.xcodeproj/project.pbxproj:
     27        * config.h:
     28        * wtf/StaticConstructors.h: Copied from WebCore/platform/StaticConstructors.h.
     29        * wtf/text/AtomicString.cpp: Copied from WebCore/platform/text/AtomicString.cpp.
     30        * wtf/text/AtomicString.h: Copied from WebCore/platform/text/AtomicString.h.
     31        * wtf/text/AtomicStringImpl.h: Copied from WebCore/platform/text/AtomicStringImpl.h.
     32        * wtf/text/StringBuffer.h: Copied from WebCore/platform/text/StringBuffer.h.
     33        * wtf/text/StringHash.h: Copied from WebCore/platform/text/StringHash.h.
     34        * wtf/text/StringImpl.cpp: Copied from WebCore/platform/text/StringImpl.cpp.
     35        * wtf/text/StringImpl.h: Copied from WebCore/platform/text/StringImpl.h.
     36        * wtf/text/WTFString.cpp: Copied from WebCore/platform/text/String.cpp.
     37        (WebCore::charactersToFloat):
     38        * wtf/text/WTFString.h: Copied from WebCore/platform/text/PlatformString.h.
     39
    1402010-04-20  Csaba Osztrogonác  <[email protected]>
    241
  • trunk/JavaScriptCore/GNUmakefile.am

    r57879 r57904  
    267267        JavaScriptCore/wtf/RetainPtr.h \
    268268        JavaScriptCore/wtf/SegmentedVector.h \
     269        JavaScriptCore/wtf/StaticConstructors.h \
    269270        JavaScriptCore/wtf/StdLibExtras.h \
    270271        JavaScriptCore/wtf/StringExtras.h \
     
    293294        JavaScriptCore/wtf/gtk/MainThreadGtk.cpp \
    294295        JavaScriptCore/wtf/gtk/ThreadingGtk.cpp \
     296        JavaScriptCore/wtf/text/AtomicString.cpp \
     297        JavaScriptCore/wtf/text/AtomicString.h \
     298        JavaScriptCore/wtf/text/AtomicStringImpl.h \
    295299        JavaScriptCore/wtf/text/CString.cpp \
    296300        JavaScriptCore/wtf/text/CString.h \
     301        JavaScriptCore/wtf/text/StringHash.h \
     302        JavaScriptCore/wtf/text/StringImpl.cpp \
     303        JavaScriptCore/wtf/text/StringImpl.h \
     304        JavaScriptCore/wtf/text/WTFString.cpp \
     305        JavaScriptCore/wtf/text/WTFString.h \
    297306        JavaScriptCore/wtf/unicode/Collator.h \
    298307        JavaScriptCore/wtf/unicode/CollatorDefault.cpp \
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r57879 r57904  
    372372__ZN3WTF9dayInYearEdi
    373373__ZN3WTFeqERKNS_7CStringES2_
     374__ZN7WebCore10StringImpl11reverseFindEPS0_ib
     375__ZN7WebCore10StringImpl11reverseFindEti
     376__ZN7WebCore10StringImpl12sharedBufferEv
     377__ZN7WebCore10StringImpl18simplifyWhiteSpaceEv
     378__ZN7WebCore10StringImpl19characterStartingAtEj
     379__ZN7WebCore10StringImpl19createUninitializedEjRPt
     380__ZN7WebCore10StringImpl22containsOnlyWhitespaceEv
     381__ZN7WebCore10StringImpl23defaultWritingDirectionEv
     382__ZN7WebCore10StringImpl37createStrippingNullCharactersSlowCaseEPKtj
     383__ZN7WebCore10StringImpl4findEPFbtEi
     384__ZN7WebCore10StringImpl4findEPKcib
     385__ZN7WebCore10StringImpl4findEPS0_ib
     386__ZN7WebCore10StringImpl4findEti
     387__ZN7WebCore10StringImpl5adoptERNS_12StringBufferE
     388__ZN7WebCore10StringImpl5emptyEv
     389__ZN7WebCore10StringImpl5lowerEv
     390__ZN7WebCore10StringImpl5toIntEPb
     391__ZN7WebCore10StringImpl5upperEv
     392__ZN7WebCore10StringImpl6createEPKc
     393__ZN7WebCore10StringImpl6createEPKtj
     394__ZN7WebCore10StringImpl6createEPKtjN3WTF10PassRefPtrINS3_21CrossThreadRefCountedINS3_16OwnFastMallocPtrIS1_EEEEEE
     395__ZN7WebCore10StringImpl6secureEt
     396__ZN7WebCore10StringImpl7replaceEPS0_S1_
     397__ZN7WebCore10StringImpl7replaceEjjPS0_
     398__ZN7WebCore10StringImpl7replaceEtPS0_
     399__ZN7WebCore10StringImpl7replaceEtt
     400__ZN7WebCore10StringImpl8endsWithEPS0_b
     401__ZN7WebCore10StringImpl9substringEjj
     402__ZN7WebCore10StringImplD1Ev
     403__ZN7WebCore11commentAtomE
     404__ZN7WebCore12AtomicString3addEPKc
     405__ZN7WebCore12AtomicString3addEPKt
     406__ZN7WebCore12AtomicString3addEPKtj
     407__ZN7WebCore12AtomicString3addEPKtjj
     408__ZN7WebCore12AtomicString3addEPNS_10StringImplE
     409__ZN7WebCore12AtomicString4findEPKtjj
     410__ZN7WebCore12AtomicString4initEv
     411__ZN7WebCore15charactersToIntEPKtmPb
     412__ZN7WebCore17charactersToFloatEPKtmPb
     413__ZN7WebCore17equalIgnoringCaseEPKtPKcj
     414__ZN7WebCore17equalIgnoringCaseEPNS_10StringImplEPKc
     415__ZN7WebCore17equalIgnoringCaseEPNS_10StringImplES1_
     416__ZN7WebCore18charactersToDoubleEPKtmPb
     417__ZN7WebCore20equalIgnoringNullityEPNS_10StringImplES1_
     418__ZN7WebCore21charactersToIntStrictEPKtmPbi
     419__ZN7WebCore22charactersToUIntStrictEPKtmPbi
     420__ZN7WebCore5equalEPNS_10StringImplEPKc
     421__ZN7WebCore5equalEPNS_10StringImplES1_
     422__ZN7WebCore6String26fromUTF8WithLatin1FallbackEPKcm
     423__ZN7WebCore6String29charactersWithNullTerminationEv
     424__ZN7WebCore6String6appendEPKtj
     425__ZN7WebCore6String6appendERKS0_
     426__ZN7WebCore6String6appendEc
     427__ZN7WebCore6String6appendEt
     428__ZN7WebCore6String6formatEPKcz
     429__ZN7WebCore6String6insertERKS0_j
     430__ZN7WebCore6String6numberEd
     431__ZN7WebCore6String6numberEi
     432__ZN7WebCore6String6numberEj
     433__ZN7WebCore6String6numberEl
     434__ZN7WebCore6String6numberEm
     435__ZN7WebCore6String6numberEt
     436__ZN7WebCore6String6numberEx
     437__ZN7WebCore6String6numberEy
     438__ZN7WebCore6String6removeEji
     439__ZN7WebCore6String8fromUTF8EPKc
     440__ZN7WebCore6String8fromUTF8EPKcm
     441__ZN7WebCore6String8truncateEj
     442__ZN7WebCore6StringC1EPKc
     443__ZN7WebCore6StringC1EPKcj
     444__ZN7WebCore6StringC1EPKt
     445__ZN7WebCore6StringC1EPKtj
     446__ZN7WebCore7xmlAtomE
     447__ZN7WebCore8nullAtomE
     448__ZN7WebCore8starAtomE
     449__ZN7WebCore8textAtomE
     450__ZN7WebCore9emptyAtomE
     451__ZN7WebCore9xmlnsAtomE
     452__ZN7WebCoreeqERKNS_12AtomicStringEPKc
     453__ZN7WebCoreplEPKcRKNS_6StringE
     454__ZN7WebCoreplERKNS_6StringEPKc
     455__ZN7WebCoreplERKNS_6StringES2_
    374456__ZNK3JSC10JSFunction23isHostFunctionNonInlineEv
    375457__ZNK3JSC11Interpreter14retrieveCallerEPNS_9ExecStateEPNS_16InternalFunctionE
     
    432514__ZNK3WTF7CString6lengthEv
    433515__ZNK3WTF8Collator7collateEPKtmS2_m
     516__ZNK7WebCore12AtomicString5lowerEv
     517__ZNK7WebCore6String10charactersEv
     518__ZNK7WebCore6String11toIntStrictEPbi
     519__ZNK7WebCore6String12toUIntStrictEPbi
     520__ZNK7WebCore6String14threadsafeCopyEv
     521__ZNK7WebCore6String15stripWhiteSpaceEv
     522__ZNK7WebCore6String16removeCharactersEPFbtE
     523__ZNK7WebCore6String17crossThreadStringEv
     524__ZNK7WebCore6String18simplifyWhiteSpaceEv
     525__ZNK7WebCore6String19characterStartingAtEj
     526__ZNK7WebCore6String4utf8Ev
     527__ZNK7WebCore6String5asciiEv
     528__ZNK7WebCore6String5lowerEv
     529__ZNK7WebCore6String5splitERKS0_RN3WTF6VectorIS0_Lm0EEE
     530__ZNK7WebCore6String5splitERKS0_bRN3WTF6VectorIS0_Lm0EEE
     531__ZNK7WebCore6String5splitEtRN3WTF6VectorIS0_Lm0EEE
     532__ZNK7WebCore6String5splitEtbRN3WTF6VectorIS0_Lm0EEE
     533__ZNK7WebCore6String5toIntEPb
     534__ZNK7WebCore6String5upperEv
     535__ZNK7WebCore6String6latin1Ev
     536__ZNK7WebCore6String6lengthEv
     537__ZNK7WebCore6String6toUIntEPb
     538__ZNK7WebCore6String7isEmptyEv
     539__ZNK7WebCore6String7toFloatEPb
     540__ZNK7WebCore6String8foldCaseEv
     541__ZNK7WebCore6String8toDoubleEPb
     542__ZNK7WebCore6String8toIntPtrEPb
     543__ZNK7WebCore6String8toUInt64EPb
     544__ZNK7WebCore6String9substringEjj
     545__ZNK7WebCore6StringixEj
    434546__ZTVN3JSC12StringObjectE
    435547__ZTVN3JSC14JSGlobalObjectE
  • trunk/JavaScriptCore/JavaScriptCore.gypi

    r57879 r57904  
    397397            'wtf/RetainPtr.h',
    398398            'wtf/SegmentedVector.h',
     399            'wtf/StaticConstructors.h',
    399400            'wtf/StdLibExtras.h',
    400401            'wtf/StringExtras.h',
     
    418419            'wtf/TypeTraits.cpp',
    419420            'wtf/TypeTraits.h',
     421            'wtf/text/AtomicString.cpp',
     422            'wtf/text/AtomicString.h',
     423            'wtf/text/AtomicStringImpl.h',
    420424            'wtf/text/CString.cpp',
    421425            'wtf/text/CString.h',
     426            'wtf/text/StringHash.h',
     427            'wtf/text/StringImpl.cpp',
     428            'wtf/text/StringImpl.h',
     429            'wtf/text/WTFString.cpp',
     430            'wtf/text/WTFString.h',
    422431            'wtf/unicode/Collator.h',
    423432            'wtf/unicode/CollatorDefault.cpp',
  • trunk/JavaScriptCore/JavaScriptCore.pro

    r57879 r57904  
    205205    wtf/TypeTraits.cpp \
    206206    wtf/WTFThreadData.cpp \
     207    wtf/text/AtomicString.cpp \
    207208    wtf/text/CString.cpp \
     209    wtf/text/StringImpl.cpp \
     210    wtf/text/WTFString.cpp \
    208211    wtf/unicode/CollatorDefault.cpp \
    209212    wtf/unicode/icu/CollatorICU.cpp \
  • trunk/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj

    r57879 r57904  
    538538                </File>
    539539                <File
     540                        RelativePath="..\..\wtf\text\AtomicString.cpp"
     541                        >
     542                </File>
     543                <File
     544                        RelativePath="..\..\wtf\text\AtomicString.h"
     545                        >
     546                </File>
     547                <File
     548                        RelativePath="..\..\wtf\text\AtomicStringImpl.h"
     549                        >
     550                </File>
     551                <File
    540552                        RelativePath="..\..\wtf\text\CString.cpp"
    541553                        >
     
    543555                <File
    544556                        RelativePath="..\..\wtf\text\CString.h"
     557                        >
     558                </File>
     559                <File
     560                        RelativePath="..\..\wtf\text\StringHash.h"
     561                        >
     562                </File>
     563                <File
     564                        RelativePath="..\..\wtf\text\StringImpl.cpp"
     565                        >
     566                </File>
     567                <File
     568                        RelativePath="..\..\wtf\text\StringImpl.h"
     569                        >
     570                </File>
     571                <File
     572                        RelativePath="..\..\wtf\text\WTFString.cpp"
     573                        >
     574                </File>
     575                <File
     576                        RelativePath="..\..\wtf\text\WTFString.h"
    545577                        >
    546578                </File>
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r57879 r57904  
    199199                86565743115BE3DA00291F40 /* CString.h in Headers */ = {isa = PBXBuildFile; fileRef = 86565741115BE3DA00291F40 /* CString.h */; settings = {ATTRIBUTES = (Private, ); }; };
    200200                865F408810E7D56300947361 /* APIShims.h in Headers */ = {isa = PBXBuildFile; fileRef = 865F408710E7D56300947361 /* APIShims.h */; };
     201                868BFA08117CEFD100B908B1 /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868BFA00117CEFD100B908B1 /* AtomicString.cpp */; };
     202                868BFA09117CEFD100B908B1 /* AtomicString.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA01117CEFD100B908B1 /* AtomicString.h */; settings = {ATTRIBUTES = (Private, ); }; };
     203                868BFA0A117CEFD100B908B1 /* AtomicStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA02117CEFD100B908B1 /* AtomicStringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
     204                868BFA0D117CEFD100B908B1 /* StringHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA05117CEFD100B908B1 /* StringHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
     205                868BFA0E117CEFD100B908B1 /* StringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868BFA06117CEFD100B908B1 /* StringImpl.cpp */; };
     206                868BFA0F117CEFD100B908B1 /* StringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA07117CEFD100B908B1 /* StringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
     207                868BFA17117CF19900B908B1 /* WTFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868BFA15117CF19900B908B1 /* WTFString.cpp */; };
     208                868BFA18117CF19900B908B1 /* WTFString.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA16117CF19900B908B1 /* WTFString.h */; settings = {ATTRIBUTES = (Private, ); }; };
     209                868BFA60117D048200B908B1 /* StaticConstructors.h in Headers */ = {isa = PBXBuildFile; fileRef = 868BFA5F117D048200B908B1 /* StaticConstructors.h */; settings = {ATTRIBUTES = (Private, ); }; };
    201210                8698B86910D44D9400D8D01B /* StringBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 8698B86810D44D9400D8D01B /* StringBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
    202211                8698BB3910D86BAF00D8D01B /* UStringImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 8698BB3710D86BAF00D8D01B /* UStringImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    561570                088FA5BA0EF76D4300578E6F /* RandomNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RandomNumber.h; sourceTree = "<group>"; };
    562571                08E279E80EF83B10007DB523 /* RandomNumberSeed.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RandomNumberSeed.h; sourceTree = "<group>"; };
    563                 0B1F921B0F17502D0036468E /* PtrAndFlags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PtrAndFlags.h; sourceTree = "<group>"; };
    564572                0B330C260F38C62300692DE3 /* TypeTraits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TypeTraits.cpp; sourceTree = "<group>"; };
    565573                0B4D7E620F319AC800AD7E58 /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = "<group>"; };
     
    730738                86565741115BE3DA00291F40 /* CString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CString.h; path = text/CString.h; sourceTree = "<group>"; };
    731739                865F408710E7D56300947361 /* APIShims.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIShims.h; sourceTree = "<group>"; };
     740                868BFA00117CEFD100B908B1 /* AtomicString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AtomicString.cpp; path = text/AtomicString.cpp; sourceTree = "<group>"; };
     741                868BFA01117CEFD100B908B1 /* AtomicString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomicString.h; path = text/AtomicString.h; sourceTree = "<group>"; };
     742                868BFA02117CEFD100B908B1 /* AtomicStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AtomicStringImpl.h; path = text/AtomicStringImpl.h; sourceTree = "<group>"; };
     743                868BFA05117CEFD100B908B1 /* StringHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringHash.h; path = text/StringHash.h; sourceTree = "<group>"; };
     744                868BFA06117CEFD100B908B1 /* StringImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringImpl.cpp; path = text/StringImpl.cpp; sourceTree = "<group>"; };
     745                868BFA07117CEFD100B908B1 /* StringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringImpl.h; path = text/StringImpl.h; sourceTree = "<group>"; };
     746                868BFA15117CF19900B908B1 /* WTFString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WTFString.cpp; path = text/WTFString.cpp; sourceTree = "<group>"; };
     747                868BFA16117CF19900B908B1 /* WTFString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WTFString.h; path = text/WTFString.h; sourceTree = "<group>"; };
     748                868BFA5F117D048200B908B1 /* StaticConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticConstructors.h; sourceTree = "<group>"; };
    732749                8698B86810D44D9400D8D01B /* StringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringBuilder.h; sourceTree = "<group>"; };
    733750                8698BB3710D86BAF00D8D01B /* UStringImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UStringImpl.h; sourceTree = "<group>"; };
     
    13571374                                65D6D87E09B5A32E0002E4D7 /* Platform.h */,
    13581375                                A7D649A91015224E009B2E1B /* PossiblyNull.h */,
    1359                                 0B1F921B0F17502D0036468E /* PtrAndFlags.h */,
    13601376                                088FA5B90EF76D4300578E6F /* RandomNumber.cpp */,
    13611377                                088FA5BA0EF76D4300578E6F /* RandomNumber.h */,
     
    13681384                                51F648D60BB4E2CA0033D760 /* RetainPtr.h */,
    13691385                                969A07290ED1CE6900F1F681 /* SegmentedVector.h */,
     1386                                868BFA5F117D048200B908B1 /* StaticConstructors.h */,
    13701387                                FE1B44790ECCD73B004F4DD1 /* StdLibExtras.h */,
    13711388                                E11D51750B2E798D0056C188 /* StringExtras.h */,
     
    16461663                        isa = PBXGroup;
    16471664                        children = (
     1665                                868BFA00117CEFD100B908B1 /* AtomicString.cpp */,
     1666                                868BFA01117CEFD100B908B1 /* AtomicString.h */,
     1667                                868BFA02117CEFD100B908B1 /* AtomicStringImpl.h */,
    16481668                                86565740115BE3DA00291F40 /* CString.cpp */,
    16491669                                86565741115BE3DA00291F40 /* CString.h */,
     1670                                868BFA05117CEFD100B908B1 /* StringHash.h */,
     1671                                868BFA06117CEFD100B908B1 /* StringImpl.cpp */,
     1672                                868BFA07117CEFD100B908B1 /* StringImpl.h */,
     1673                                868BFA15117CF19900B908B1 /* WTFString.cpp */,
     1674                                868BFA16117CF19900B908B1 /* WTFString.h */,
    16501675                        );
    16511676                        name = text;
     
    20432068                                A7482E93116A7CAD003B0712 /* JSWeakObjectMapRefInternal.h in Headers */,
    20442069                                86D08D5411793613006E5ED0 /* WTFThreadData.h in Headers */,
     2070                                868BFA09117CEFD100B908B1 /* AtomicString.h in Headers */,
     2071                                868BFA0A117CEFD100B908B1 /* AtomicStringImpl.h in Headers */,
     2072                                868BFA0D117CEFD100B908B1 /* StringHash.h in Headers */,
     2073                                868BFA0F117CEFD100B908B1 /* StringImpl.h in Headers */,
     2074                                868BFA18117CF19900B908B1 /* WTFString.h in Headers */,
     2075                                868BFA60117D048200B908B1 /* StaticConstructors.h in Headers */,
    20452076                        );
    20462077                        runOnlyForDeploymentPostprocessing = 0;
     
    24872518                                A7482B9411671147003B0712 /* JSWeakObjectMapRefPrivate.cpp in Sources */,
    24882519                                86D08D5311793613006E5ED0 /* WTFThreadData.cpp in Sources */,
     2520                                868BFA08117CEFD100B908B1 /* AtomicString.cpp in Sources */,
     2521                                868BFA0E117CEFD100B908B1 /* StringImpl.cpp in Sources */,
     2522                                868BFA17117CF19900B908B1 /* WTFString.cpp in Sources */,
    24892523                        );
    24902524                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/JavaScriptCore/config.h

    r57884 r57904  
    7676#endif
    7777
     78#if COMPILER(MSVC)
     79#define SKIP_STATIC_CONSTRUCTORS_ON_MSVC 1
     80#else
     81#define SKIP_STATIC_CONSTRUCTORS_ON_GCC 1
     82#endif
     83
    7884#if PLATFORM(CHROMIUM)
    7985#if !defined(WTF_USE_V8)
  • trunk/JavaScriptCore/wtf/StaticConstructors.h

    r57828 r57904  
    2222#define StaticConstructors_h
    2323
    24 // For WebCore we need to avoid having static constructors. We achieve this
     24// We need to avoid having static constructors. We achieve this
    2525// with two separate methods for GCC and MSVC. Both methods prevent the static
    2626// initializers from being registered and called on program startup. On GCC, we
  • trunk/JavaScriptCore/wtf/text/AtomicString.h

    r57828 r57904  
    2323
    2424#include "AtomicStringImpl.h"
    25 #include "PlatformString.h"
     25#include "WTFString.h"
    2626
    2727// Define 'NO_IMPLICIT_ATOMICSTRING' before including this header,
     
    3333#endif
    3434
     35// FIXME: This is a temporary layering violation while we move string code to WTF.
     36// Landing the file moves in one patch, will follow on with patches to change the namespaces.
    3537namespace WebCore {
    3638
  • trunk/JavaScriptCore/wtf/text/AtomicStringImpl.h

    r57828 r57904  
    2424#include "StringImpl.h"
    2525
     26// FIXME: This is a temporary layering violation while we move string code to WTF.
     27// Landing the file moves in one patch, will follow on with patches to change the namespaces.
    2628namespace WebCore {
    2729
  • trunk/JavaScriptCore/wtf/text/StringHash.h

    r57828 r57904  
    2424
    2525#include "AtomicString.h"
    26 #include "PlatformString.h"
     26#include "WTFString.h"
    2727#include <wtf/HashTraits.h>
    2828#include <wtf/StringHashFunctions.h>
    2929#include <wtf/unicode/Unicode.h>
    3030
     31// FIXME: This is a temporary layering violation while we move string code to WTF.
     32// Landing the file moves in one patch, will follow on with patches to change the namespaces.
    3133namespace WebCore {
    3234
  • trunk/JavaScriptCore/wtf/text/StringImpl.h

    r57828 r57904  
    4242#endif
    4343
     44// FIXME: This is a temporary layering violation while we move string code to WTF.
     45// Landing the file moves in one patch, will follow on with patches to change the namespaces.
    4446namespace WebCore {
    4547
  • trunk/JavaScriptCore/wtf/text/WTFString.cpp

    r57828 r57904  
    2121
    2222#include "config.h"
    23 #include "PlatformString.h"
    24 
    25 #include "FloatConversion.h"
    26 #include "SharedBuffer.h"
    27 #include "StringBuffer.h"
    28 #include "TextBreakIterator.h"
     23#include "WTFString.h"
     24
    2925#include <limits>
    3026#include <stdarg.h>
     
    641637}
    642638
    643 #ifndef NDEBUG
    644639Vector<char> String::ascii() const
    645640{
     
    655650    return buffer;
    656651}
    657 #endif
    658652
    659653CString String::latin1() const
     
    951945{
    952946    // FIXME: This will return ok even when the string fits into a double but not a float.
    953     return narrowPrecisionToFloat(charactersToDouble(data, length, ok));
    954 }
    955 
    956 PassRefPtr<SharedBuffer> utf8Buffer(const String& string)
    957 {
    958     // Allocate a buffer big enough to hold all the characters.
    959     const int length = string.length();
    960     Vector<char> buffer(length * 3);
    961 
    962     // Convert to runs of 8-bit characters.
    963     char* p = buffer.data();
    964     const UChar* d = string.characters();
    965     ConversionResult result = convertUTF16ToUTF8(&d, d + length, &p, p + buffer.size(), true);
    966     if (result != conversionOK)
    967         return 0;
    968 
    969     buffer.shrink(p - buffer.data());
    970     return SharedBuffer::adoptVector(buffer);
    971 }
    972 
    973 unsigned numGraphemeClusters(const String& s)
    974 {
    975     TextBreakIterator* it = characterBreakIterator(s.characters(), s.length());
    976     if (!it)
    977         return s.length();
    978 
    979     unsigned num = 0;
    980     while (textBreakNext(it) != TextBreakDone)
    981         ++num;
    982     return num;
    983 }
    984 
    985 unsigned numCharactersInGraphemeClusters(const String& s, unsigned numGraphemeClusters)
    986 {
    987     TextBreakIterator* it = characterBreakIterator(s.characters(), s.length());
    988     if (!it)
    989         return min(s.length(), numGraphemeClusters);
    990 
    991     for (unsigned i = 0; i < numGraphemeClusters; ++i) {
    992         if (textBreakNext(it) == TextBreakDone)
    993             return s.length();
    994     }
    995     return textBreakCurrent(it);
     947    return static_cast<float>(charactersToDouble(data, length, ok));
    996948}
    997949
  • trunk/JavaScriptCore/wtf/text/WTFString.h

    r57828 r57904  
    2020 */
    2121
    22 #ifndef PlatformString_h
    23 #define PlatformString_h
     22#ifndef WTFString_h
     23#define WTFString_h
    2424
    2525// This file would be called String.h, but that conflicts with <string.h>
     
    5656using WTF::CString;
    5757
     58// FIXME: This is a temporary layering violation while we move string code to WTF.
     59// Landing the file moves in one patch, will follow on with patches to change the namespaces.
    5860namespace WebCore {
    5961
     
    247249#endif
    248250
    249 #ifndef NDEBUG
    250251    Vector<char> ascii() const;
    251 #endif
    252252
    253253    CString latin1() const;
     
    384384}
    385385
    386 
    387 
    388 PassRefPtr<SharedBuffer> utf8Buffer(const String&);
    389 // Counts the number of grapheme clusters. A surrogate pair or a sequence
    390 // of a non-combining character and following combining characters is
    391 // counted as 1 grapheme cluster.
    392 unsigned numGraphemeClusters(const String& s);
    393 // Returns the number of characters which will be less than or equal to
    394 // the specified grapheme cluster length.
    395 unsigned numCharactersInGraphemeClusters(const String& s, unsigned);
    396 
    397386} // namespace WebCore
    398387
Note: See TracChangeset for help on using the changeset viewer.