tree: e8b2d29ed8ec74188d484f99cd84f0f343ed2b97 [path history] [tgz]
  1. allocator/
  2. dtoa/
  3. experimental/
  4. testing/
  5. text/
  6. typed_arrays/
  7. AddressSanitizer.h
  8. Alignment.h
  9. Allocator.h
  10. Allocator.md
  11. ASCIICType.cpp
  12. ASCIICType.h
  13. ASCIICTypeTest.cpp
  14. Assertions.cpp
  15. Assertions.h
  16. AssertionsTest.cpp
  17. Atomics.h
  18. AutoReset.h
  19. BitVector.cpp
  20. BitVector.h
  21. BloomFilter.h
  22. BUILD.gn
  23. ByteOrder.h
  24. ByteSwap.h
  25. CheckedNumeric.h
  26. Compiler.h
  27. ConditionalDestructor.h
  28. ContainerAnnotations.h
  29. CONTRIBUTORS.pthreads-win32
  30. CPU.h
  31. CryptographicallyRandomNumber.cpp
  32. CryptographicallyRandomNumber.h
  33. DataLog.cpp
  34. DataLog.h
  35. DateMath.cpp
  36. DateMath.h
  37. DEPS
  38. Deque.h
  39. DequeTest.cpp
  40. DoublyLinkedList.h
  41. dtoa.cpp
  42. dtoa.h
  43. dtoa_test.cpp
  44. DynamicAnnotations.cpp
  45. DynamicAnnotations.h
  46. FilePrintStream.cpp
  47. FilePrintStream.h
  48. Forward.h
  49. Functional.h
  50. FunctionalTest.cpp
  51. GetPtr.h
  52. HashCountedSet.h
  53. HashFunctions.h
  54. HashIterators.h
  55. HashMap.h
  56. HashMapTest.cpp
  57. HashSet.h
  58. HashSetTest.cpp
  59. HashTable.cpp
  60. HashTable.h
  61. HashTableDeletedValueType.h
  62. HashTraits.h
  63. HexNumber.h
  64. LeakAnnotations.h
  65. LinkedHashSet.h
  66. ListHashSet.h
  67. ListHashSetTest.cpp
  68. Locker.h
  69. MathExtras.h
  70. MathExtrasTest.cpp
  71. Noncopyable.h
  72. NonCopyingSort.h
  73. NotFound.h
  74. Optional.h
  75. OptionalTest.cpp
  76. OWNERS
  77. PrintStream.cpp
  78. PrintStream.h
  79. ProcessMetrics.h
  80. PtrUtil.h
  81. PtrUtilTest.cpp
  82. README.md
  83. RefCounted.h
  84. RefPtrTest.cpp
  85. RefVector.h
  86. RetainPtr.h
  87. SaturatedArithmetic.h
  88. SaturatedArithmeticARM.h
  89. SaturatedArithmeticTest.cpp
  90. ScopedLogger.cpp
  91. ScopedLogger.h
  92. ScopedLogger.md
  93. ScopedLoggerTest.cpp
  94. SizeAssertions.h
  95. SizeLimits.cpp
  96. StackUtil.cpp
  97. StackUtil.h
  98. StaticConstructors.h
  99. StdLibExtras.h
  100. StringExtras.h
  101. StringExtrasTest.cpp
  102. StringHasher.h
  103. StringHasherTest.cpp
  104. TerminatedArray.h
  105. TerminatedArrayBuilder.h
  106. Threading.h
  107. ThreadingPrimitives.h
  108. ThreadingPthreads.cpp
  109. ThreadingWin.cpp
  110. ThreadRestrictionVerifier.h
  111. ThreadSafeRefCounted.h
  112. ThreadSpecific.h
  113. ThreadSpecificWin.cpp
  114. Time.cpp
  115. Time.h
  116. TimeTest.cpp
  117. TreeNode.h
  118. TreeNodeTest.cpp
  119. TypeTraits.h
  120. TypeTraitsTest.cpp
  121. Vector.h
  122. VectorTest.cpp
  123. VectorTraits.h
  124. WTF.cpp
  125. WTF.h
  126. WTFExport.h
  127. WTFTestHelper.h
  128. WTFThreadData.cpp
  129. WTFThreadData.h
third_party/WebKit/Source/platform/wtf/README.md

WTF (Web Template Framework)

WTF is a base library for Blink providing a variety of basic functionalities, like containers, string libraries, reference counting mechanisms, functors, threading primitives etc.

WTF's mission is to power and support all other Blink code base by providing fast, reliable, user-friendly and secure generic primitives.

Dependency-wise, WTF cannot depend on any other Blink headers, including files under other platform/ subdirectories, since WTF is a library that can be referred from anywhere in Blink. WTF basically can only depend on base.

Main code base of Blink (core and modules) cannot directly depend on base. The main objective of this is to limit what Blink core can use, so that Blink core code wouldn't use libraries prohibited in Blink accidentally (such as std::string or std::vector).

Our approach here is to make WTF and other platform/ components a gatekeeper of the use of base libraries. platform/ (including WTF) can directly depend on base, and if some of the base functionalities are worth having in Blink, WTF can expose them in a way Blink core code can easily use them. Usually, such a library would be a thin wrapper of the corresponding base functionality.

Also, we are trying to eliminate duplicated functionalities between WTF and base. Historically, WTF was developed as a stand-alone library, so there are still many overlaps. We want to eventually delegate sharable implementation to base as much as possible.

If you find a missing functionality in WTF, regardless of whether it is available in base or not, feel free to file a bug under the component Blink>Internals>WTF.

Library catalog

The below is a list of major libraries. For a complete list, look at the directory listing.

History

The name WTF first appeared in 2006, as a replacement of its older name KXMLCore. At that point, there were already plenty of libraries we see today. For example, you can see the initial implementation of Vector was landed in 2006, replacing several manual array allocations and deallocations(!).

If you dig the repository a bit more, you can find the original version of Assertions.h was committed back in 2002. This is probably the oldest library that we can find from the repository history.

As you see, pretty much everything that we have today in WTF was created in the WebKit era. WTF was initially under the directory Source/JavaScriptCore, but it moved to Source/WTF/wtf in 2011-2012, then to Source/wtf in 2013.

Blink forked WebKit in 2013. In 2017, the directory finally moved to the current location Source/platform/wtf.