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