tree: cb9831fe16d9629febb0a23f0c11f71e47881235 [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. ConstructTraits.h
  29. ContainerAnnotations.h
  30. CONTRIBUTORS.pthreads-win32
  31. CPU.h
  32. CryptographicallyRandomNumber.cpp
  33. CryptographicallyRandomNumber.h
  34. DataLog.cpp
  35. DataLog.h
  36. DateMath.cpp
  37. DateMath.h
  38. DEPS
  39. Deque.h
  40. DequeTest.cpp
  41. DoublyLinkedList.h
  42. dtoa.cpp
  43. dtoa.h
  44. dtoa_test.cpp
  45. DynamicAnnotations.cpp
  46. DynamicAnnotations.h
  47. FilePrintStream.cpp
  48. FilePrintStream.h
  49. Forward.h
  50. Functional.h
  51. FunctionalTest.cpp
  52. GetPtr.h
  53. HashCountedSet.h
  54. HashFunctions.h
  55. HashIterators.h
  56. HashMap.h
  57. HashMapTest.cpp
  58. HashSet.h
  59. HashSetTest.cpp
  60. HashTable.cpp
  61. HashTable.h
  62. HashTableDeletedValueType.h
  63. HashTraits.h
  64. HexNumber.h
  65. LeakAnnotations.h
  66. LinkedHashSet.h
  67. ListHashSet.h
  68. ListHashSetTest.cpp
  69. Locker.h
  70. MathExtras.h
  71. MathExtrasTest.cpp
  72. Noncopyable.h
  73. NonCopyingSort.h
  74. NotFound.h
  75. Optional.h
  76. OptionalTest.cpp
  77. OWNERS
  78. PrintStream.cpp
  79. PrintStream.h
  80. ProcessMetrics.h
  81. PtrUtil.h
  82. PtrUtilTest.cpp
  83. README.md
  84. RefCounted.h
  85. RefPtrTest.cpp
  86. RefVector.h
  87. RetainPtr.h
  88. SaturatedArithmetic.h
  89. SaturatedArithmeticARM.h
  90. SaturatedArithmeticTest.cpp
  91. ScopedLogger.cpp
  92. ScopedLogger.h
  93. ScopedLogger.md
  94. ScopedLoggerTest.cpp
  95. SizeAssertions.h
  96. SizeLimits.cpp
  97. StackUtil.cpp
  98. StackUtil.h
  99. StaticConstructors.h
  100. StdLibExtras.h
  101. StringExtras.h
  102. StringExtrasTest.cpp
  103. StringHasher.h
  104. StringHasherTest.cpp
  105. TerminatedArray.h
  106. TerminatedArrayBuilder.h
  107. Threading.h
  108. ThreadingPrimitives.h
  109. ThreadingPthreads.cpp
  110. ThreadingWin.cpp
  111. ThreadRestrictionVerifier.h
  112. ThreadSafeRefCounted.h
  113. ThreadSpecific.h
  114. ThreadSpecificWin.cpp
  115. Time.cpp
  116. Time.h
  117. TimeTest.cpp
  118. TreeNode.h
  119. TreeNodeTest.cpp
  120. TypeTraits.h
  121. TypeTraitsTest.cpp
  122. Vector.h
  123. VectorTest.cpp
  124. VectorTraits.h
  125. WTF.cpp
  126. WTF.h
  127. WTFExport.h
  128. WTFTestHelper.h
  129. WTFThreadData.cpp
  130. 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.