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