tree: 23589943a6b6e7b14c63e4b472a8e0ae0239cd4e [path history] [tgz]
  1. allocator/
  2. dtoa/
  3. experimental/
  4. testing/
  5. text/
  6. typed_arrays/
  7. address_sanitizer.h
  8. alignment.h
  9. allocator.cc
  10. allocator.h
  11. Allocator.md
  12. ascii_ctype.cc
  13. ascii_ctype.h
  14. ascii_ctype_test.cc
  15. assertions.cc
  16. assertions.h
  17. assertions_test.cc
  18. atomics.h
  19. bit_vector.cc
  20. bit_vector.h
  21. bloom_filter.h
  22. BUILD.gn
  23. casting.h
  24. compiler.h
  25. conditional_destructor.h
  26. construct_traits.h
  27. container_annotations.h
  28. CONTRIBUTORS.pthreads-win32
  29. cpu.h
  30. date_math.cc
  31. date_math.h
  32. decimal.cc
  33. decimal.h
  34. decimal_test.cc
  35. DEPS
  36. deque.h
  37. deque_test.cc
  38. doubly_linked_list.h
  39. doubly_linked_list_test.cc
  40. dtoa.cc
  41. dtoa.h
  42. dtoa_test.cc
  43. dynamic_annotations.cc
  44. dynamic_annotations.h
  45. forward.h
  46. functional.h
  47. functional_test.cc
  48. get_ptr.h
  49. hash_counted_set.h
  50. hash_functions.h
  51. hash_iterators.h
  52. hash_map.h
  53. hash_map_test.cc
  54. hash_set.h
  55. hash_set_test.cc
  56. hash_table.cc
  57. hash_table.h
  58. hash_table_deleted_value_type.h
  59. hash_traits.h
  60. hex_number.h
  61. leak_annotations.h
  62. linked_hash_set.h
  63. list_hash_set.h
  64. list_hash_set_test.cc
  65. locker.h
  66. math_extras.h
  67. math_extras_test.cc
  68. noncopyable.h
  69. not_found.h
  70. OWNERS
  71. pod_arena.h
  72. pod_arena_test.cc
  73. pod_arena_test_helpers.h
  74. pod_free_list_arena.h
  75. pod_free_list_arena_test.cc
  76. pod_interval.h
  77. pod_interval_tree.h
  78. pod_interval_tree_test.cc
  79. pod_red_black_tree.h
  80. pod_red_black_tree_test.cc
  81. pod_tree_test_helpers.cc
  82. pod_tree_test_helpers.h
  83. README.md
  84. ref_counted.h
  85. ref_vector.h
  86. retain_ptr.h
  87. saturated_arithmetic.h
  88. saturated_arithmetic_arm.h
  89. saturated_arithmetic_test.cc
  90. scoped_logger.cc
  91. scoped_logger.h
  92. scoped_logger_test.cc
  93. ScopedLogger.md
  94. size_assertions.h
  95. size_limits.cc
  96. stack_util.cc
  97. stack_util.h
  98. static_constructors.h
  99. std_lib_extras.h
  100. string_extras.h
  101. string_hasher.h
  102. string_hasher_test.cc
  103. terminated_array.h
  104. terminated_array_builder.h
  105. thread_restriction_verifier.h
  106. thread_safe_ref_counted.h
  107. thread_specific.h
  108. threading.cc
  109. threading.h
  110. threading_primitives.h
  111. threading_primitives_test.cc
  112. threading_pthreads.cc
  113. threading_win.cc
  114. time.cc
  115. time.h
  116. tree_node.h
  117. tree_node_test.cc
  118. type_traits.h
  119. type_traits_test.cc
  120. vector.h
  121. vector_test.cc
  122. vector_traits.h
  123. wtf.cc
  124. wtf.h
  125. wtf_export.h
  126. wtf_size_t.h
  127. wtf_test_helper.h
  128. wtf_thread_data.cc
  129. wtf_thread_data.h
third_party/blink/renderer/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 shareable 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.