diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-24 17:03:20 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-24 17:03:20 +0200 |
commit | 08d4a74d56ca431877819fc4566e27eafe150342 (patch) | |
tree | ebd8530838ab390c015c6b7e659a22852c1663ae /Source/WTF | |
parent | 1de6cd4794bbd5a52189384189a2b8df1848b39b (diff) | |
download | qtwebkit-08d4a74d56ca431877819fc4566e27eafe150342.tar.gz |
Imported WebKit commit 0fbd41c4e13f5a190faf160bf993eee614e6e18e (http://svn.webkit.org/repository/webkit/trunk@123477)
New snapshot that adapts to latest Qt API changes
Diffstat (limited to 'Source/WTF')
-rw-r--r-- | Source/WTF/ChangeLog | 64 | ||||
-rw-r--r-- | Source/WTF/GNUmakefile.list.am | 1 | ||||
-rw-r--r-- | Source/WTF/WTF.gypi | 1 | ||||
-rw-r--r-- | Source/WTF/WTF.pro | 1 | ||||
-rw-r--r-- | Source/WTF/WTF.vcproj/WTF.vcproj | 4 | ||||
-rw-r--r-- | Source/WTF/WTF.xcodeproj/project.pbxproj | 164 | ||||
-rw-r--r-- | Source/WTF/wtf/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Source/WTF/wtf/DateMath.cpp | 13 | ||||
-rw-r--r-- | Source/WTF/wtf/GregorianDateTime.h | 124 | ||||
-rw-r--r-- | Source/WTF/wtf/Platform.h | 1 | ||||
-rw-r--r-- | Source/WTF/wtf/ThreadSpecific.h | 36 | ||||
-rw-r--r-- | Source/WTF/wtf/ThreadSpecificWin.cpp | 90 | ||||
-rw-r--r-- | Source/WTF/wtf/ThreadingPthreads.cpp | 47 |
13 files changed, 298 insertions, 249 deletions
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog index b61d78c35..72543899f 100644 --- a/Source/WTF/ChangeLog +++ b/Source/WTF/ChangeLog @@ -1,3 +1,67 @@ +2012-07-23 Patrick Gansterer <paroga@webkit.org> + + Move GregorianDateTime from JSC to WTF namespace + https://bugs.webkit.org/show_bug.cgi?id=91948 + + Reviewed by Geoffrey Garen. + + Moving GregorianDateTime into the WTF namespace allows us to us to + use it in WebCore too. The new class has the same behaviour as the + old struct. Only the unused timeZone member has been removed. + + * GNUmakefile.list.am: + * WTF.gypi: + * WTF.pro: + * WTF.vcproj/WTF.vcproj: + * WTF.xcodeproj/project.pbxproj: + * wtf/CMakeLists.txt: + * wtf/GregorianDateTime.h: Added. + (GregorianDateTime): + +2012-07-23 Rob Buis <rbuis@rim.com> + + [BlackBerry] Merge createThreadInternal implementations + https://bugs.webkit.org/show_bug.cgi?id=91899 + + Reviewed by Yong Li. + + PR 111675 + + Remove our implementation since the default thread stack size on QNX is fine. + + * wtf/ThreadingPthreads.cpp: + (WTF::createThreadInternal): + (WTF::initializeCurrentThreadInternal): make sure we set the thread name. + +2012-07-23 Patrick Gansterer <paroga@webkit.org> + + [WINCE] Define NOMINMAX in the build system instead of Platform.h + https://bugs.webkit.org/show_bug.cgi?id=91938 + + Reviewed by Ryosuke Niwa. + + * wtf/Platform.h: + +2012-07-23 Patrick Gansterer <paroga@webkit.org> + + Build fix for Windows after r123317. + + * wtf/DateMath.cpp: Added missing header include. + +2012-07-23 Patrick Gansterer <paroga@webkit.org> + + [WIN] Use GetTimeZoneInformation() for calculateUTCOffset() + https://bugs.webkit.org/show_bug.cgi?id=91935 + + Reviewed by Ryosuke Niwa. + + GetTimeZoneInformation() returns the offset directly. Using it + avoids unnecessary calculations and remove dependencies on + other time related function, which do not exist on WinCE. + + * wtf/DateMath.cpp: + (WTF::calculateUTCOffset): + 2012-07-20 Han Shen <shenhan@google.com> [Chromium] Compilation fails under gcc 4.7 diff --git a/Source/WTF/GNUmakefile.list.am b/Source/WTF/GNUmakefile.list.am index 5f0ddd695..bb68bc268 100644 --- a/Source/WTF/GNUmakefile.list.am +++ b/Source/WTF/GNUmakefile.list.am @@ -52,6 +52,7 @@ wtf_sources += \ Source/WTF/wtf/Forward.h \ Source/WTF/wtf/Functional.h \ Source/WTF/wtf/GetPtr.h \ + Source/WTF/wtf/GregorianDateTime.h \ Source/WTF/wtf/HashCountedSet.h \ Source/WTF/wtf/HashFunctions.h \ Source/WTF/wtf/HashIterators.h \ diff --git a/Source/WTF/WTF.gypi b/Source/WTF/WTF.gypi index eb280703a..ebb41a454 100644 --- a/Source/WTF/WTF.gypi +++ b/Source/WTF/WTF.gypi @@ -34,6 +34,7 @@ 'wtf/Forward.h', 'wtf/Functional.h', 'wtf/GetPtr.h', + 'wtf/GregorianDateTime.h', 'wtf/HashCountedSet.h', 'wtf/HashFunctions.h', 'wtf/HashIterators.h', diff --git a/Source/WTF/WTF.pro b/Source/WTF/WTF.pro index 4bcb0ff0a..68d847112 100644 --- a/Source/WTF/WTF.pro +++ b/Source/WTF/WTF.pro @@ -61,6 +61,7 @@ HEADERS += \ Forward.h \ Functional.h \ GetPtr.h \ + GregorianDateTime.h \ HashCountedSet.h \ HashFunctions.h \ HashIterators.h \ diff --git a/Source/WTF/WTF.vcproj/WTF.vcproj b/Source/WTF/WTF.vcproj/WTF.vcproj index d1a295c87..1ac32b4d6 100644 --- a/Source/WTF/WTF.vcproj/WTF.vcproj +++ b/Source/WTF/WTF.vcproj/WTF.vcproj @@ -797,6 +797,10 @@ > </File> <File + RelativePath="..\wtf\GregorianDateTime.h" + > + </File> + <File RelativePath="..\wtf\HashCountedSet.h" > </File> diff --git a/Source/WTF/WTF.xcodeproj/project.pbxproj b/Source/WTF/WTF.xcodeproj/project.pbxproj index c47ec1946..372c15ec0 100644 --- a/Source/WTF/WTF.xcodeproj/project.pbxproj +++ b/Source/WTF/WTF.xcodeproj/project.pbxproj @@ -7,9 +7,10 @@ objects = { /* Begin PBXBuildFile section */ + 0FD81AC5154FB22E00983E72 /* FastBitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD81AC4154FB22E00983E72 /* FastBitVector.h */; settings = {ATTRIBUTES = (); }; }; 143F611F1565F0F900DB514A /* RAMSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 143F611D1565F0F900DB514A /* RAMSize.cpp */; }; 143F61201565F0F900DB514A /* RAMSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 143F611E1565F0F900DB514A /* RAMSize.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 0FD81AC5154FB22E00983E72 /* FastBitVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD81AC4154FB22E00983E72 /* FastBitVector.h */; settings = {ATTRIBUTES = (); }; }; + 2C05385415BC819000F21B96 /* GregorianDateTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 2C05385315BC819000F21B96 /* GregorianDateTime.h */; }; 4330F38F15745B0500AAFA8F /* URLString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4330F38E15745B0500AAFA8F /* URLString.cpp */; }; 4F0321BC156AA8D1006EBAF6 /* BitArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F0321BB156AA8D1006EBAF6 /* BitArray.h */; }; 8134013815B092FD001FF0B8 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8134013615B092FD001FF0B8 /* Base64.cpp */; }; @@ -247,9 +248,10 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 0FD81AC4154FB22E00983E72 /* FastBitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FastBitVector.h; sourceTree = "<group>"; }; 143F611D1565F0F900DB514A /* RAMSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RAMSize.cpp; sourceTree = "<group>"; }; 143F611E1565F0F900DB514A /* RAMSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RAMSize.h; sourceTree = "<group>"; }; - 0FD81AC4154FB22E00983E72 /* FastBitVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FastBitVector.h; sourceTree = "<group>"; }; + 2C05385315BC819000F21B96 /* GregorianDateTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GregorianDateTime.h; sourceTree = "<group>"; }; 4330F38E15745B0500AAFA8F /* URLString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = URLString.cpp; sourceTree = "<group>"; }; 4F0321BB156AA8D1006EBAF6 /* BitArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BitArray.h; sourceTree = "<group>"; }; 5D247B6214689B8600E78B76 /* libWTF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWTF.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -538,9 +540,9 @@ 5D247B7614689D7600E78B76 /* Source */ = { isa = PBXGroup; children = ( + A876DBD6151816E500DADB95 /* wtf */, A8A4748B151A8264004123FF /* config.h */, 5D247EB11468B01500E78B76 /* HeaderDetection.h */, - A876DBD6151816E500DADB95 /* wtf */, ); name = Source; sourceTree = "<group>"; @@ -548,8 +550,12 @@ A876DBD6151816E500DADB95 /* wtf */ = { isa = PBXGroup; children = ( - 143F611D1565F0F900DB514A /* RAMSize.cpp */, - 143F611E1565F0F900DB514A /* RAMSize.h */, + A8A47281151A825A004123FF /* dtoa */, + A8A472C4151A825A004123FF /* mac */, + A8A4731B151A825B004123FF /* text */, + A8A47339151A825B004123FF /* threads */, + A8A47348151A825B004123FF /* unicode */, + A8A4735E151A825B004123FF /* url */, A8A47254151A825A004123FF /* Alignment.h */, A8A47255151A825A004123FF /* AlwaysInline.h */, A8A47256151A825A004123FF /* ArrayBuffer.cpp */, @@ -561,8 +567,8 @@ A8A4725C151A825A004123FF /* Assertions.h */, A8A4725D151A825A004123FF /* Atomics.h */, A8A4725E151A825A004123FF /* AVLTree.h */, - A8A4725F151A825A004123FF /* Bitmap.h */, 4F0321BB156AA8D1006EBAF6 /* BitArray.h */, + A8A4725F151A825A004123FF /* Bitmap.h */, A8A47260151A825A004123FF /* BitVector.cpp */, A8A47261151A825A004123FF /* BitVector.h */, A8A47264151A825A004123FF /* BlockStack.h */, @@ -588,7 +594,6 @@ A8A4727E151A825A004123FF /* Deque.h */, A8A4727F151A825A004123FF /* DisallowCType.h */, A8A47280151A825A004123FF /* DoublyLinkedList.h */, - A8A47281151A825A004123FF /* dtoa */, A8A47297151A825A004123FF /* dtoa.cpp */, A8A47298151A825A004123FF /* dtoa.h */, A8A47299151A825A004123FF /* DynamicAnnotations.cpp */, @@ -605,6 +610,7 @@ A8A472A6151A825A004123FF /* Forward.h */, A8A472A7151A825A004123FF /* Functional.h */, A8A472A8151A825A004123FF /* GetPtr.h */, + 2C05385315BC819000F21B96 /* GregorianDateTime.h */, A8A472B3151A825A004123FF /* HashCountedSet.h */, A8A472B4151A825A004123FF /* HashFunctions.h */, A8A472B5151A825A004123FF /* HashIterators.h */, @@ -615,14 +621,13 @@ A8A472BA151A825A004123FF /* HashTraits.h */, A8A472BB151A825A004123FF /* HexNumber.h */, A8A472BC151A825A004123FF /* InlineASM.h */, - A8A472BD151A825A004123FF /* Int8Array.h */, A8A472BE151A825A004123FF /* Int16Array.h */, A8A472BF151A825A004123FF /* Int32Array.h */, + A8A472BD151A825A004123FF /* Int8Array.h */, A8A472C0151A825A004123FF /* IntegralTypedArrayBase.h */, A8A472C1151A825A004123FF /* ListHashSet.h */, A8A472C2151A825A004123FF /* ListRefPtr.h */, A8A472C3151A825A004123FF /* Locker.h */, - A8A472C4151A825A004123FF /* mac */, A8A472C6151A825A004123FF /* MainThread.cpp */, A8A472C7151A825B004123FF /* MainThread.h */, A8A472C8151A825B004123FF /* MallocZoneSupport.h */, @@ -661,7 +666,10 @@ A8A472ED151A825B004123FF /* PassRefPtr.h */, A8A472EE151A825B004123FF /* PassTraits.h */, A8A472EF151A825B004123FF /* Platform.h */, + A876DBD7151816E500DADB95 /* Platform.h */, A8A472F3151A825B004123FF /* PossiblyNull.h */, + 143F611D1565F0F900DB514A /* RAMSize.cpp */, + 143F611E1565F0F900DB514A /* RAMSize.h */, A8A472FB151A825B004123FF /* RandomNumber.cpp */, A8A472FC151A825B004123FF /* RandomNumber.h */, A8A472FD151A825B004123FF /* RandomNumberSeed.h */, @@ -694,7 +702,6 @@ A8A47318151A825B004123FF /* TCSystemAlloc.cpp */, A8A47319151A825B004123FF /* TCSystemAlloc.h */, A8A4731A151A825B004123FF /* TemporaryChange.h */, - A8A4731B151A825B004123FF /* text */, A8A4732F151A825B004123FF /* ThreadFunctionInvocation.h */, A8A47330151A825B004123FF /* ThreadIdentifierDataPthreads.cpp */, A8A47331151A825B004123FF /* ThreadIdentifierDataPthreads.h */, @@ -703,27 +710,23 @@ A8A47335151A825B004123FF /* ThreadingPrimitives.h */, A8A47336151A825B004123FF /* ThreadingPthreads.cpp */, A8A47338151A825B004123FF /* ThreadRestrictionVerifier.h */, - A8A47339151A825B004123FF /* threads */, A8A4733E151A825B004123FF /* ThreadSafeRefCounted.h */, A8A4733F151A825B004123FF /* ThreadSpecific.h */, A8A47341151A825B004123FF /* TypedArrayBase.h */, A8A47342151A825B004123FF /* TypeTraits.cpp */, A8A47343151A825B004123FF /* TypeTraits.h */, - A8A47344151A825B004123FF /* Uint8Array.h */, - A8A47345151A825B004123FF /* Uint8ClampedArray.h */, A8A47346151A825B004123FF /* Uint16Array.h */, A8A47347151A825B004123FF /* Uint32Array.h */, - A8A47348151A825B004123FF /* unicode */, + A8A47344151A825B004123FF /* Uint8Array.h */, + A8A47345151A825B004123FF /* Uint8ClampedArray.h */, A8A4735C151A825B004123FF /* UnionFind.h */, A8A4735D151A825B004123FF /* UnusedParam.h */, - A8A4735E151A825B004123FF /* url */, A8A4736F151A825B004123FF /* ValueCheck.h */, A8A47370151A825B004123FF /* Vector.h */, A8A47371151A825B004123FF /* VectorTraits.h */, A8A47372151A825B004123FF /* VMTags.h */, A8A4737A151A825B004123FF /* WTFThreadData.cpp */, A8A4737B151A825B004123FF /* WTFThreadData.h */, - A876DBD7151816E500DADB95 /* Platform.h */, ); path = wtf; sourceTree = "<group>"; @@ -731,13 +734,15 @@ A8A47281151A825A004123FF /* dtoa */ = { isa = PBXGroup; children = ( + A8A47288151A825A004123FF /* COPYING */, + A8A47292151A825A004123FF /* LICENSE */, + A8A47293151A825A004123FF /* README */, A8A47282151A825A004123FF /* bignum-dtoa.cc */, A8A47283151A825A004123FF /* bignum-dtoa.h */, A8A47284151A825A004123FF /* bignum.cc */, A8A47285151A825A004123FF /* bignum.h */, A8A47286151A825A004123FF /* cached-powers.cc */, A8A47287151A825A004123FF /* cached-powers.h */, - A8A47288151A825A004123FF /* COPYING */, A8A47289151A825A004123FF /* diy-fp.cc */, A8A4728A151A825A004123FF /* diy-fp.h */, A8A4728B151A825A004123FF /* double-conversion.cc */, @@ -747,8 +752,6 @@ A8A4728F151A825A004123FF /* fast-dtoa.h */, A8A47290151A825A004123FF /* fixed-dtoa.cc */, A8A47291151A825A004123FF /* fixed-dtoa.h */, - A8A47292151A825A004123FF /* LICENSE */, - A8A47293151A825A004123FF /* README */, A8A47294151A825A004123FF /* strtod.cc */, A8A47295151A825A004123FF /* strtod.h */, A8A47296151A825A004123FF /* utils.h */, @@ -767,13 +770,13 @@ A8A4731B151A825B004123FF /* text */ = { isa = PBXGroup; children = ( - 8134013615B092FD001FF0B8 /* Base64.cpp */, - 8134013715B092FD001FF0B8 /* Base64.h */, A8A4731C151A825B004123FF /* ASCIIFastPath.h */, A8A4731D151A825B004123FF /* AtomicString.cpp */, A8A4731E151A825B004123FF /* AtomicString.h */, A8A4731F151A825B004123FF /* AtomicStringHash.h */, A8A47320151A825B004123FF /* AtomicStringImpl.h */, + 8134013615B092FD001FF0B8 /* Base64.cpp */, + 8134013715B092FD001FF0B8 /* Base64.h */, A8A47321151A825B004123FF /* CString.cpp */, A8A47322151A825B004123FF /* CString.h */, A8A47323151A825B004123FF /* StringBuffer.h */, @@ -804,10 +807,10 @@ A8A47348151A825B004123FF /* unicode */ = { isa = PBXGroup; children = ( + A8A4734F151A825B004123FF /* icu */, A8A47349151A825B004123FF /* CharacterNames.h */, A8A4734A151A825B004123FF /* Collator.h */, A8A4734B151A825B004123FF /* CollatorDefault.cpp */, - A8A4734F151A825B004123FF /* icu */, A8A47354151A825B004123FF /* ScriptCodesFromICU.h */, A8A47355151A825B004123FF /* Unicode.h */, A8A47356151A825B004123FF /* UnicodeMacrosFromICU.h */, @@ -871,27 +874,39 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - A876DBD8151816E500DADB95 /* Platform.h in Headers */, A8A4737F151A825B004123FF /* Alignment.h in Headers */, A8A47380151A825B004123FF /* AlwaysInline.h in Headers */, A8A47382151A825B004123FF /* ArrayBuffer.h in Headers */, A8A47384151A825B004123FF /* ArrayBufferView.h in Headers */, A8A47385151A825B004123FF /* ASCIICType.h in Headers */, + A8A47434151A825B004123FF /* ASCIIFastPath.h in Headers */, A8A47387151A825B004123FF /* Assertions.h in Headers */, A8A47388151A825B004123FF /* Atomics.h in Headers */, + A8A47436151A825B004123FF /* AtomicString.h in Headers */, + A8A47437151A825B004123FF /* AtomicStringHash.h in Headers */, + A8A47438151A825B004123FF /* AtomicStringImpl.h in Headers */, A8A47389151A825B004123FF /* AVLTree.h in Headers */, - A8A4738A151A825B004123FF /* Bitmap.h in Headers */, + 8134013915B092FD001FF0B8 /* Base64.h in Headers */, + A8A473A9151A825B004123FF /* bignum-dtoa.h in Headers */, + A8A473AB151A825B004123FF /* bignum.h in Headers */, + A8A47452151A825B004123FF /* BinarySemaphore.h in Headers */, 4F0321BC156AA8D1006EBAF6 /* BitArray.h in Headers */, + A8A4738A151A825B004123FF /* Bitmap.h in Headers */, A8A4738C151A825B004123FF /* BitVector.h in Headers */, A8A4738E151A825B004123FF /* BlockStack.h in Headers */, A8A4738F151A825B004123FF /* BloomFilter.h in Headers */, A8A47390151A825B004123FF /* BoundsCheckedPointer.h in Headers */, A8A47391151A825B004123FF /* BumpPointerAllocator.h in Headers */, + A8A473AD151A825B004123FF /* cached-powers.h in Headers */, + A8A4745E151A825B004123FF /* CharacterNames.h in Headers */, A8A47394151A825B004123FF /* CheckedArithmetic.h in Headers */, A8A47395151A825B004123FF /* CheckedBoolean.h in Headers */, + A8A4745F151A825B004123FF /* Collator.h in Headers */, A8A47398151A825B004123FF /* Compiler.h in Headers */, A8A47399151A825B004123FF /* Complex.h in Headers */, + A8A4748C151A8264004123FF /* config.h in Headers */, A8A4739B151A825B004123FF /* CryptographicallyRandomNumber.h in Headers */, + A8A4743A151A825B004123FF /* CString.h in Headers */, A8A4739D151A825B004123FF /* CurrentTime.h in Headers */, A8A4739F151A825B004123FF /* DataLog.h in Headers */, A8A473A1151A825B004123FF /* DateMath.h in Headers */, @@ -899,29 +914,26 @@ A8A473A4151A825B004123FF /* Decoder.h in Headers */, A8A473A5151A825B004123FF /* Deque.h in Headers */, A8A473A6151A825B004123FF /* DisallowCType.h in Headers */, - A8A473A7151A825B004123FF /* DoublyLinkedList.h in Headers */, - A8A473A9151A825B004123FF /* bignum-dtoa.h in Headers */, - A8A473AB151A825B004123FF /* bignum.h in Headers */, - A8A473AD151A825B004123FF /* cached-powers.h in Headers */, A8A473AF151A825B004123FF /* diy-fp.h in Headers */, A8A473B1151A825B004123FF /* double-conversion.h in Headers */, A8A473B2151A825B004123FF /* double.h in Headers */, - A8A473B4151A825B004123FF /* fast-dtoa.h in Headers */, - A8A473B6151A825B004123FF /* fixed-dtoa.h in Headers */, - A8A473B8151A825B004123FF /* strtod.h in Headers */, - A8A473B9151A825B004123FF /* utils.h in Headers */, + A8A473A7151A825B004123FF /* DoublyLinkedList.h in Headers */, A8A473BB151A825B004123FF /* dtoa.h in Headers */, A8A473BD151A825B004123FF /* DynamicAnnotations.h in Headers */, A8A473C0151A825B004123FF /* Encoder.h in Headers */, A8A473C1151A825B004123FF /* ExportMacros.h in Headers */, + A8A473B4151A825B004123FF /* fast-dtoa.h in Headers */, A8A473C2151A825B004123FF /* FastAllocBase.h in Headers */, + 0FD81AC5154FB22E00983E72 /* FastBitVector.h in Headers */, A8A473C4151A825B004123FF /* FastMalloc.h in Headers */, + A8A473B6151A825B004123FF /* fixed-dtoa.h in Headers */, A8A473C5151A825B004123FF /* FixedArray.h in Headers */, A8A473C6151A825B004123FF /* Float32Array.h in Headers */, A8A473C7151A825B004123FF /* Float64Array.h in Headers */, A8A473C8151A825B004123FF /* Forward.h in Headers */, A8A473C9151A825B004123FF /* Functional.h in Headers */, A8A473CA151A825B004123FF /* GetPtr.h in Headers */, + 2C05385415BC819000F21B96 /* GregorianDateTime.h in Headers */, A8A473D3151A825B004123FF /* HashCountedSet.h in Headers */, A8A473D4151A825B004123FF /* HashFunctions.h in Headers */, A8A473D5151A825B004123FF /* HashIterators.h in Headers */, @@ -931,9 +943,9 @@ A8A473DA151A825B004123FF /* HashTraits.h in Headers */, A8A473DB151A825B004123FF /* HexNumber.h in Headers */, A8A473DC151A825B004123FF /* InlineASM.h in Headers */, - A8A473DD151A825B004123FF /* Int8Array.h in Headers */, A8A473DE151A825B004123FF /* Int16Array.h in Headers */, A8A473DF151A825B004123FF /* Int32Array.h in Headers */, + A8A473DD151A825B004123FF /* Int8Array.h in Headers */, A8A473E0151A825B004123FF /* IntegralTypedArrayBase.h in Headers */, A8A473E1151A825B004123FF /* ListHashSet.h in Headers */, A8A473E2151A825B004123FF /* ListRefPtr.h in Headers */, @@ -962,14 +974,18 @@ A8A47404151A825B004123FF /* PageReservation.h in Headers */, A8A47405151A825B004123FF /* ParallelJobs.h in Headers */, A8A47408151A825B004123FF /* ParallelJobsLibdispatch.h in Headers */, + A8A47470151A825B004123FF /* ParsedURL.h in Headers */, A8A4740A151A825B004123FF /* PassOwnArrayPtr.h in Headers */, A8A4740B151A825B004123FF /* PassOwnPtr.h in Headers */, A8A4740C151A825B004123FF /* PassRefPtr.h in Headers */, A8A4740D151A825B004123FF /* PassTraits.h in Headers */, + A876DBD8151816E500DADB95 /* Platform.h in Headers */, A8A4740E151A825B004123FF /* Platform.h in Headers */, A8A4740F151A825B004123FF /* PossiblyNull.h in Headers */, + 143F61201565F0F900DB514A /* RAMSize.h in Headers */, A8A47415151A825B004123FF /* RandomNumber.h in Headers */, A8A47416151A825B004123FF /* RandomNumberSeed.h in Headers */, + A8A47472151A825B004123FF /* RawURLBuffer.h in Headers */, A8A47417151A825B004123FF /* RedBlackTree.h in Headers */, A8A47418151A825B004123FF /* RefCounted.h in Headers */, A8A47419151A825B004123FF /* RefCountedArray.h in Headers */, @@ -977,6 +993,7 @@ A8A4741C151A825B004123FF /* RefPtr.h in Headers */, A8A4741D151A825B004123FF /* RefPtrHashMap.h in Headers */, A8A4741E151A825B004123FF /* RetainPtr.h in Headers */, + A8A47466151A825B004123FF /* ScriptCodesFromICU.h in Headers */, A8A4741F151A825B004123FF /* SegmentedVector.h in Headers */, A8A47420151A825B004123FF /* SentinelLinkedList.h in Headers */, A8A47422151A825B004123FF /* SHA1.h in Headers */, @@ -986,52 +1003,39 @@ A8A47428151A825B004123FF /* StackBounds.h in Headers */, A8A47429151A825B004123FF /* StaticConstructors.h in Headers */, A8A4742A151A825B004123FF /* StdLibExtras.h in Headers */, + A8A4743B151A825B004123FF /* StringBuffer.h in Headers */, + A8A4743D151A825B004123FF /* StringBuilder.h in Headers */, + A8A4743E151A825B004123FF /* StringConcatenate.h in Headers */, A8A4742C151A825B004123FF /* StringExtras.h in Headers */, + A8A4743F151A825B004123FF /* StringHash.h in Headers */, A8A4742D151A825B004123FF /* StringHasher.h in Headers */, + A8A47441151A825B004123FF /* StringImpl.h in Headers */, + A8A47442151A825B004123FF /* StringOperators.h in Headers */, + A8A473B8151A825B004123FF /* strtod.h in Headers */, A8A4742E151A825B004123FF /* TCPackedCache.h in Headers */, A8A4742F151A825B004123FF /* TCPageMap.h in Headers */, A8A47430151A825B004123FF /* TCSpinLock.h in Headers */, A8A47432151A825B004123FF /* TCSystemAlloc.h in Headers */, A8A47433151A825B004123FF /* TemporaryChange.h in Headers */, - A8A47434151A825B004123FF /* ASCIIFastPath.h in Headers */, - A8A47436151A825B004123FF /* AtomicString.h in Headers */, - A8A47437151A825B004123FF /* AtomicStringHash.h in Headers */, - A8A47438151A825B004123FF /* AtomicStringImpl.h in Headers */, - A8A4743A151A825B004123FF /* CString.h in Headers */, - A8A4743B151A825B004123FF /* StringBuffer.h in Headers */, - A8A4743D151A825B004123FF /* StringBuilder.h in Headers */, - A8A4743E151A825B004123FF /* StringConcatenate.h in Headers */, - A8A4743F151A825B004123FF /* StringHash.h in Headers */, - A8A47441151A825B004123FF /* StringImpl.h in Headers */, - A8A47442151A825B004123FF /* StringOperators.h in Headers */, A8A47444151A825B004123FF /* TextPosition.h in Headers */, - A8A47446151A825B004123FF /* WTFString.h in Headers */, A8A47447151A825B004123FF /* ThreadFunctionInvocation.h in Headers */, A8A47449151A825B004123FF /* ThreadIdentifierDataPthreads.h in Headers */, A8A4744B151A825B004123FF /* Threading.h in Headers */, A8A4744D151A825B004123FF /* ThreadingPrimitives.h in Headers */, A8A47450151A825B004123FF /* ThreadRestrictionVerifier.h in Headers */, - A8A47452151A825B004123FF /* BinarySemaphore.h in Headers */, A8A47454151A825B004123FF /* ThreadSafeRefCounted.h in Headers */, A8A47455151A825B004123FF /* ThreadSpecific.h in Headers */, A8A47457151A825B004123FF /* TypedArrayBase.h in Headers */, A8A47459151A825B004123FF /* TypeTraits.h in Headers */, - A8A4745A151A825B004123FF /* Uint8Array.h in Headers */, - A8A4745B151A825B004123FF /* Uint8ClampedArray.h in Headers */, A8A4745C151A825B004123FF /* Uint16Array.h in Headers */, A8A4745D151A825B004123FF /* Uint32Array.h in Headers */, - A8A4745E151A825B004123FF /* CharacterNames.h in Headers */, - A8A4745F151A825B004123FF /* Collator.h in Headers */, - A8A47464151A825B004123FF /* UnicodeIcu.h in Headers */, - A8A47466151A825B004123FF /* ScriptCodesFromICU.h in Headers */, + A8A4745A151A825B004123FF /* Uint8Array.h in Headers */, + A8A4745B151A825B004123FF /* Uint8ClampedArray.h in Headers */, A8A47467151A825B004123FF /* Unicode.h in Headers */, + A8A47464151A825B004123FF /* UnicodeIcu.h in Headers */, A8A47468151A825B004123FF /* UnicodeMacrosFromICU.h in Headers */, - A8A4746A151A825B004123FF /* UTF8.h in Headers */, A8A4746D151A825B004123FF /* UnionFind.h in Headers */, A8A4746E151A825B004123FF /* UnusedParam.h in Headers */, - A8A47470151A825B004123FF /* ParsedURL.h in Headers */, - A8A47471151A825B004123FF /* URLString.h in Headers */, - A8A47472151A825B004123FF /* RawURLBuffer.h in Headers */, A8A47473151A825B004123FF /* URLBuffer.h in Headers */, A8A47475151A825B004123FF /* URLCharacterTypes.h in Headers */, A8A47476151A825B004123FF /* URLComponent.h in Headers */, @@ -1039,15 +1043,15 @@ A8A47479151A825B004123FF /* URLParser.h in Headers */, A8A4747A151A825B004123FF /* URLQueryCanonicalizer.h in Headers */, A8A4747C151A825B004123FF /* URLSegments.h in Headers */, + A8A47471151A825B004123FF /* URLString.h in Headers */, + A8A4746A151A825B004123FF /* UTF8.h in Headers */, + A8A473B9151A825B004123FF /* utils.h in Headers */, A8A4747D151A825B004123FF /* ValueCheck.h in Headers */, A8A4747E151A825B004123FF /* Vector.h in Headers */, A8A4747F151A825B004123FF /* VectorTraits.h in Headers */, A8A47480151A825B004123FF /* VMTags.h in Headers */, + A8A47446151A825B004123FF /* WTFString.h in Headers */, A8A47487151A825B004123FF /* WTFThreadData.h in Headers */, - A8A4748C151A8264004123FF /* config.h in Headers */, - 143F61201565F0F900DB514A /* RAMSize.h in Headers */, - 0FD81AC5154FB22E00983E72 /* FastBitVector.h in Headers */, - 8134013915B092FD001FF0B8 /* Base64.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1139,26 +1143,31 @@ A8A47381151A825B004123FF /* ArrayBuffer.cpp in Sources */, A8A47383151A825B004123FF /* ArrayBufferView.cpp in Sources */, A8A47386151A825B004123FF /* Assertions.cpp in Sources */, + A8A47435151A825B004123FF /* AtomicString.cpp in Sources */, + 8134013815B092FD001FF0B8 /* Base64.cpp in Sources */, + A8A473A8151A825B004123FF /* bignum-dtoa.cc in Sources */, + A8A473AA151A825B004123FF /* bignum.cc in Sources */, + A8A47451151A825B004123FF /* BinarySemaphore.cpp in Sources */, A8A4738B151A825B004123FF /* BitVector.cpp in Sources */, + A8A473AC151A825B004123FF /* cached-powers.cc in Sources */, + A8A47460151A825B004123FF /* CollatorDefault.cpp in Sources */, + A8A47463151A825B004123FF /* CollatorICU.cpp in Sources */, A8A4739A151A825B004123FF /* CryptographicallyRandomNumber.cpp in Sources */, + A8A47439151A825B004123FF /* CString.cpp in Sources */, A8A4739C151A825B004123FF /* CurrentTime.cpp in Sources */, A8A4739E151A825B004123FF /* DataLog.cpp in Sources */, A8A473A0151A825B004123FF /* DateMath.cpp in Sources */, A8A473A2151A825B004123FF /* DecimalNumber.cpp in Sources */, - A8A473A8151A825B004123FF /* bignum-dtoa.cc in Sources */, - A8A473AA151A825B004123FF /* bignum.cc in Sources */, - A8A473AC151A825B004123FF /* cached-powers.cc in Sources */, A8A473AE151A825B004123FF /* diy-fp.cc in Sources */, A8A473B0151A825B004123FF /* double-conversion.cc in Sources */, - A8A473B3151A825B004123FF /* fast-dtoa.cc in Sources */, - A8A473B5151A825B004123FF /* fixed-dtoa.cc in Sources */, - A8A473B7151A825B004123FF /* strtod.cc in Sources */, A8A473BA151A825B004123FF /* dtoa.cpp in Sources */, A8A473BC151A825B004123FF /* DynamicAnnotations.cpp in Sources */, + A8A473B3151A825B004123FF /* fast-dtoa.cc in Sources */, A8A473C3151A825B004123FF /* FastMalloc.cpp in Sources */, + A8A473B5151A825B004123FF /* fixed-dtoa.cc in Sources */, A8A473D8151A825B004123FF /* HashTable.cpp in Sources */, - A8A473E4151A825B004123FF /* MainThreadMac.mm in Sources */, A8A473E5151A825B004123FF /* MainThread.cpp in Sources */, + A8A473E4151A825B004123FF /* MainThreadMac.mm in Sources */, A8A473E9151A825B004123FF /* MD5.cpp in Sources */, A8A473EC151A825B004123FF /* MetaAllocator.cpp in Sources */, A8A473F2151A825B004123FF /* NullPtr.cpp in Sources */, @@ -1167,35 +1176,30 @@ A8A473F9151A825B004123FF /* OSRandomSource.cpp in Sources */, A8A47400151A825B004123FF /* PageAllocationAligned.cpp in Sources */, A8A47402151A825B004123FF /* PageBlock.cpp in Sources */, + A8A4746F151A825B004123FF /* ParsedURL.cpp in Sources */, + 143F611F1565F0F900DB514A /* RAMSize.cpp in Sources */, A8A47414151A825B004123FF /* RandomNumber.cpp in Sources */, A8A4741A151A825B004123FF /* RefCountedLeakCounter.cpp in Sources */, A8A47421151A825B004123FF /* SHA1.cpp in Sources */, A8A47425151A825B004123FF /* SizeLimits.cpp in Sources */, A8A47427151A825B004123FF /* StackBounds.cpp in Sources */, - A8A4742B151A825B004123FF /* StringExtras.cpp in Sources */, - A8A47431151A825B004123FF /* TCSystemAlloc.cpp in Sources */, - A8A47435151A825B004123FF /* AtomicString.cpp in Sources */, - A8A47439151A825B004123FF /* CString.cpp in Sources */, A8A4743C151A825B004123FF /* StringBuilder.cpp in Sources */, + A8A4742B151A825B004123FF /* StringExtras.cpp in Sources */, A8A47440151A825B004123FF /* StringImpl.cpp in Sources */, A8A47443151A825B004123FF /* StringStatics.cpp in Sources */, - 4330F38F15745B0500AAFA8F /* URLString.cpp in Sources */, - A8A47445151A825B004123FF /* WTFString.cpp in Sources */, + A8A473B7151A825B004123FF /* strtod.cc in Sources */, + A8A47431151A825B004123FF /* TCSystemAlloc.cpp in Sources */, A8A47448151A825B004123FF /* ThreadIdentifierDataPthreads.cpp in Sources */, A8A4744A151A825B004123FF /* Threading.cpp in Sources */, A8A4744E151A825B004123FF /* ThreadingPthreads.cpp in Sources */, - A8A47451151A825B004123FF /* BinarySemaphore.cpp in Sources */, A8A47458151A825B004123FF /* TypeTraits.cpp in Sources */, - A8A47460151A825B004123FF /* CollatorDefault.cpp in Sources */, - A8A47463151A825B004123FF /* CollatorICU.cpp in Sources */, - A8A47469151A825B004123FF /* UTF8.cpp in Sources */, - A8A4746F151A825B004123FF /* ParsedURL.cpp in Sources */, A8A47474151A825B004123FF /* URLCharacterTypes.cpp in Sources */, A8A47477151A825B004123FF /* URLEscape.cpp in Sources */, A8A4747B151A825B004123FF /* URLSegments.cpp in Sources */, + 4330F38F15745B0500AAFA8F /* URLString.cpp in Sources */, + A8A47469151A825B004123FF /* UTF8.cpp in Sources */, + A8A47445151A825B004123FF /* WTFString.cpp in Sources */, A8A47486151A825B004123FF /* WTFThreadData.cpp in Sources */, - 143F611F1565F0F900DB514A /* RAMSize.cpp in Sources */, - 8134013815B092FD001FF0B8 /* Base64.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Source/WTF/wtf/CMakeLists.txt b/Source/WTF/wtf/CMakeLists.txt index 9d34d4563..bd2914971 100644 --- a/Source/WTF/wtf/CMakeLists.txt +++ b/Source/WTF/wtf/CMakeLists.txt @@ -28,6 +28,7 @@ SET(WTF_HEADERS FixedArray.h Forward.h GetPtr.h + GregorianDateTime.h HashCountedSet.h HashFunctions.h HashIterators.h diff --git a/Source/WTF/wtf/DateMath.cpp b/Source/WTF/wtf/DateMath.cpp index ea2cb60ee..3b0bbd309 100644 --- a/Source/WTF/wtf/DateMath.cpp +++ b/Source/WTF/wtf/DateMath.cpp @@ -86,6 +86,10 @@ #include <time.h> #include <wtf/text/StringBuilder.h> +#if OS(WINDOWS) +#include <windows.h> +#endif + #if HAVE(ERRNO_H) #include <errno.h> #endif @@ -356,6 +360,12 @@ int equivalentYearForDST(int year) int32_t calculateUTCOffset() { +#if OS(WINDOWS) + TIME_ZONE_INFORMATION timeZoneInformation; + GetTimeZoneInformation(&timeZoneInformation); + int32_t bias = timeZoneInformation.Bias + timeZoneInformation.StandardBias; + return -bias * 60 * 1000; +#else time_t localTime = time(0); tm localt; getLocalTime(&localTime, &localt); @@ -376,7 +386,7 @@ int32_t calculateUTCOffset() #if HAVE(TM_ZONE) localt.tm_zone = 0; #endif - + #if HAVE(TIMEGM) time_t utcOffset = timegm(&localt) - mktime(&localt); #else @@ -386,6 +396,7 @@ int32_t calculateUTCOffset() #endif return static_cast<int32_t>(utcOffset * 1000); +#endif } /* diff --git a/Source/WTF/wtf/GregorianDateTime.h b/Source/WTF/wtf/GregorianDateTime.h new file mode 100644 index 000000000..2b4fc352f --- /dev/null +++ b/Source/WTF/wtf/GregorianDateTime.h @@ -0,0 +1,124 @@ +/* + * Copyright (C) 2012 Patrick Gansterer <paroga@paroga.com> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WTF_GregorianDateTime_h +#define WTF_GregorianDateTime_h + +#include <wtf/text/CString.h> + +namespace WTF { + +class GregorianDateTime { + WTF_MAKE_NONCOPYABLE(GregorianDateTime); +public: + GregorianDateTime() + : m_year(0) + , m_month(0) + , m_yearDay(0) + , m_monthDay(0) + , m_weekDay(0) + , m_hour(0) + , m_minute(0) + , m_second(0) + , m_utcOffset(0) + , m_isDST(0) + { + } + + inline int year() const { return m_year; } + inline int month() const { return m_month; } + inline int yearDay() const { return m_yearDay; } + inline int monthDay() const { return m_monthDay; } + inline int weekDay() const { return m_weekDay; } + inline int hour() const { return m_hour; } + inline int minute() const { return m_minute; } + inline int second() const { return m_second; } + inline int utcOffset() const { return m_utcOffset; } + inline int isDST() const { return m_isDST; } + + inline void setYear(int year) { m_year = year; } + inline void setMonth(int month) { m_month = month; } + inline void setYearDay(int yearDay) { m_yearDay = yearDay; } + inline void setMonthDay(int monthDay) { m_monthDay = monthDay; } + inline void setWeekDay(int weekDay) { m_weekDay = weekDay; } + inline void setHour(int hour) { m_hour = hour; } + inline void setMinute(int minute) { m_minute = minute; } + inline void setSecond(int second) { m_second = second; } + inline void setUtcOffset(int utcOffset) { m_utcOffset = utcOffset; } + inline void setIsDST(int isDST) { m_isDST = isDST; } + + operator tm() const + { + tm ret; + memset(&ret, 0, sizeof(ret)); + + ret.tm_year = m_year; + ret.tm_mon = m_month; + ret.tm_yday = m_yearDay; + ret.tm_mday = m_monthDay; + ret.tm_wday = m_weekDay; + ret.tm_hour = m_hour; + ret.tm_min = m_minute; + ret.tm_sec = m_second; + ret.tm_isdst = m_isDST; + +#if HAVE(TM_GMTOFF) + ret.tm_gmtoff = static_cast<long>(m_utcOffset); +#endif + + return ret; + } + + void copyFrom(const GregorianDateTime& other) + { + m_year = other.m_year; + m_month = other.m_month; + m_yearDay = other.m_yearDay; + m_monthDay = other.m_monthDay; + m_weekDay = other.m_weekDay; + m_hour = other.m_hour; + m_minute = other.m_minute; + m_second = other.m_second; + m_utcOffset = other.m_utcOffset; + m_isDST = other.m_isDST; + } + +private: + int m_year; + int m_month; + int m_yearDay; + int m_monthDay; + int m_weekDay; + int m_hour; + int m_minute; + int m_second; + int m_utcOffset; + int m_isDST; +}; + +} // namespace WTF + +using WTF::GregorianDateTime; + +#endif // WTF_GregorianDateTime_h diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h index a7e1d52e3..a25893685 100644 --- a/Source/WTF/wtf/Platform.h +++ b/Source/WTF/wtf/Platform.h @@ -502,7 +502,6 @@ #endif #if OS(WINCE) && !PLATFORM(QT) -#define NOMINMAX /* Windows min and max conflict with standard macros */ #define NOSHLWAPI /* shlwapi.h not available on WinCe */ /* MSDN documentation says these functions are provided with uspce.lib. But we cannot find this file. */ diff --git a/Source/WTF/wtf/ThreadSpecific.h b/Source/WTF/wtf/ThreadSpecific.h index 60c9907bd..f51ab4cf2 100644 --- a/Source/WTF/wtf/ThreadSpecific.h +++ b/Source/WTF/wtf/ThreadSpecific.h @@ -1,7 +1,6 @@ /* * Copyright (C) 2008 Apple Inc. All rights reserved. * Copyright (C) 2009 Jian Li <jianli@chromium.org> - * Copyright (C) 2012 Patrick Gansterer <paroga@paroga.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -103,33 +102,6 @@ private: }; #if USE(PTHREADS) - -typedef pthread_key_t ThreadSpecificKey; - -inline void ThreadSpecificKeyCreate(ThreadSpecificKey* key, void (*destructor)(void *)) -{ - int error = pthread_key_create(key, destructor); - if (error) - CRASH(); -} - -inline void ThreadSpecificKeyDelete(ThreadSpecificKey key) -{ - int error = pthread_key_delete(key); - if (error) - CRASH(); -} - -inline void ThreadSpecificSet(ThreadSpecificKey key, void* value) -{ - pthread_setspecific(key, value); -} - -inline void* ThreadSpecificGet(ThreadSpecificKey key) -{ - return pthread_getspecific(key); -} - template<typename T> inline ThreadSpecific<T>::ThreadSpecific() { @@ -167,14 +139,6 @@ const int kMaxTlsKeySize = 256; WTF_EXPORT_PRIVATE long& tlsKeyCount(); WTF_EXPORT_PRIVATE DWORD* tlsKeys(); -class ThreadSpecificKeyValue; -typedef ThreadSpecificKeyValue* ThreadSpecificKey; - -void ThreadSpecificKeyCreate(ThreadSpecificKey*, void (*)(void *)); -void ThreadSpecificKeyDelete(ThreadSpecificKey); -void ThreadSpecificSet(ThreadSpecificKey, void*); -void* ThreadSpecificGet(ThreadSpecificKey); - template<typename T> inline ThreadSpecific<T>::ThreadSpecific() : m_index(-1) diff --git a/Source/WTF/wtf/ThreadSpecificWin.cpp b/Source/WTF/wtf/ThreadSpecificWin.cpp index 61a594251..d72996a7a 100644 --- a/Source/WTF/wtf/ThreadSpecificWin.cpp +++ b/Source/WTF/wtf/ThreadSpecificWin.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2009 Jian Li <jianli@chromium.org> - * Copyright (C) 2012 Patrick Gansterer <paroga@paroga.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -20,72 +19,15 @@ */ #include "config.h" -#include "ThreadSpecific.h" -#include "StdLibExtras.h" -#include "ThreadingPrimitives.h" +#include "ThreadSpecific.h" -#if !USE(PTHREADS) +#if USE(PTHREADS) +#error This file should not be compiled by ports that do not use Windows native ThreadSpecific implementation. +#endif namespace WTF { -static Mutex& destructorsMutex() -{ - DEFINE_STATIC_LOCAL(Mutex, staticMutex, ()); - return staticMutex; -} - -class ThreadSpecificKeyValue { -public: - ThreadSpecificKeyValue(void (*destructor)(void *)) - : m_destructor(destructor) - { - m_tlsKey = TlsAlloc(); - if (m_tlsKey == TLS_OUT_OF_INDEXES) - CRASH(); - - MutexLocker locker(destructorsMutex()); - m_next = m_first; - m_first = this; - } - - ~ThreadSpecificKeyValue() - { - MutexLocker locker(destructorsMutex()); - ThreadSpecificKeyValue** next = &m_first; - while (*next != this) { - ASSERT(*next); - next = &(*next)->m_next; - } - *next = (*next)->m_next; - - TlsFree(m_tlsKey); - } - - void setValue(void* data) { TlsSetValue(m_tlsKey, data); } - void* value() { return TlsGetValue(m_tlsKey); } - - static void callDestructors() - { - MutexLocker locker(destructorsMutex()); - ThreadSpecificKeyValue* next = m_first; - while (next) { - if (void* data = next->value()) - next->m_destructor(data); - next = next->m_next; - } - } - -private: - void (*m_destructor)(void *); - DWORD m_tlsKey; - ThreadSpecificKeyValue* m_next; - - static ThreadSpecificKeyValue* m_first; -}; - -ThreadSpecificKeyValue* ThreadSpecificKeyValue::m_first = 0; - long& tlsKeyCount() { static long count; @@ -98,26 +40,6 @@ DWORD* tlsKeys() return keys; } -void ThreadSpecificKeyCreate(ThreadSpecificKey* key, void (*destructor)(void *)) -{ - *key = new ThreadSpecificKeyValue(destructor); -} - -void ThreadSpecificKeyDelete(ThreadSpecificKey key) -{ - delete key; -} - -void ThreadSpecificSet(ThreadSpecificKey key, void* data) -{ - key->setValue(data); -} - -void* ThreadSpecificGet(ThreadSpecificKey key) -{ - return key->value(); -} - void ThreadSpecificThreadExit() { for (long i = 0; i < tlsKeyCount(); i++) { @@ -126,10 +48,6 @@ void ThreadSpecificThreadExit() if (data) data->destructor(data); } - - ThreadSpecificKeyValue::callDestructors(); } } // namespace WTF - -#endif // !USE(PTHREADS) diff --git a/Source/WTF/wtf/ThreadingPthreads.cpp b/Source/WTF/wtf/ThreadingPthreads.cpp index 2cfa874e0..921dd3be7 100644 --- a/Source/WTF/wtf/ThreadingPthreads.cpp +++ b/Source/WTF/wtf/ThreadingPthreads.cpp @@ -59,11 +59,6 @@ #include <objc/objc-auto.h> #endif -#if PLATFORM(BLACKBERRY) -#include <BlackBerryPlatformMisc.h> -#include <BlackBerryPlatformSettings.h> -#endif - namespace WTF { typedef HashMap<ThreadIdentifier, pthread_t> ThreadMap; @@ -164,45 +159,6 @@ static void* wtfThreadEntryPoint(void* param) return 0; } -#if PLATFORM(BLACKBERRY) -ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char* threadName) -{ - pthread_attr_t attr; - if (pthread_attr_init(&attr)) { - LOG_ERROR("pthread_attr_init() failed: %d", errno); - return 0; - } - - void* stackAddr; - size_t stackSize; - if (pthread_attr_getstack(&attr, &stackAddr, &stackSize)) - LOG_ERROR("pthread_attr_getstack() failed: %d", errno); - else { - stackSize = BlackBerry::Platform::Settings::instance()->secondaryThreadStackSize(); - if (pthread_attr_setstack(&attr, stackAddr, stackSize)) - LOG_ERROR("pthread_attr_getstack() failed: %d", errno); - } - - OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(new ThreadFunctionInvocation(entryPoint, data)); - pthread_t threadHandle; - if (pthread_create(&threadHandle, &attr, wtfThreadEntryPoint, invocation.get())) { - LOG_ERROR("pthread_create() failed: %d", errno); - threadHandle = 0; - } - pthread_setname_np(threadHandle, threadName); - - pthread_attr_destroy(&attr); - - if (!threadHandle) - return 0; - - // Balanced by adoptPtr() in wtfThreadEntryPoint. - ThreadFunctionInvocation* leakedInvocation = invocation.leakPtr(); - UNUSED_PARAM(leakedInvocation); - - return establishIdentifierForPthreadHandle(threadHandle); -} -#else ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char*) { OwnPtr<ThreadFunctionInvocation> invocation = adoptPtr(new ThreadFunctionInvocation(entryPoint, data)); @@ -218,12 +174,13 @@ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, con return establishIdentifierForPthreadHandle(threadHandle); } -#endif void initializeCurrentThreadInternal(const char* threadName) { #if HAVE(PTHREAD_SETNAME_NP) pthread_setname_np(threadName); +#elif OS(QNX) + pthread_setname_np(pthread_self(), threadName); #else UNUSED_PARAM(threadName); #endif |