tree: 21488c3b057b761d817d115f360254ab6595e269 [path history] [tgz]
  1. BUILD.gn
  2. DEPS
  3. OWNERS
  4. PRESUBMIT.py
  5. README.md
  6. SECURITY_OWNERS
  7. allocator/
  8. android/
  9. at_exit.cc
  10. at_exit.h
  11. at_exit_unittest.cc
  12. atomic_ref_count.h
  13. atomic_sequence_num.h
  14. atomicops.h
  15. atomicops_internals_atomicword_compat.h
  16. atomicops_internals_portable.h
  17. atomicops_internals_x86_msvc.h
  18. atomicops_unittest.cc
  19. auto_reset.h
  20. barrier_closure.cc
  21. barrier_closure.h
  22. barrier_closure_unittest.cc
  23. base64.cc
  24. base64.h
  25. base64_decode_fuzzer.cc
  26. base64_encode_fuzzer.cc
  27. base64_unittest.cc
  28. base64url.cc
  29. base64url.h
  30. base64url_unittest.cc
  31. base_export.h
  32. base_paths.cc
  33. base_paths.h
  34. base_paths_android.cc
  35. base_paths_android.h
  36. base_paths_fuchsia.cc
  37. base_paths_fuchsia.h
  38. base_paths_mac.h
  39. base_paths_mac.mm
  40. base_paths_posix.cc
  41. base_paths_posix.h
  42. base_paths_win.cc
  43. base_paths_win.h
  44. base_switches.cc
  45. base_switches.h
  46. big_endian.cc
  47. big_endian.h
  48. big_endian_unittest.cc
  49. bind.h
  50. bind_helpers.h
  51. bind_internal.h
  52. bind_unittest.cc
  53. bind_unittest.nc
  54. bit_cast.h
  55. bit_cast_unittest.cc
  56. bits.h
  57. bits_unittest.cc
  58. build_time.cc
  59. build_time.h
  60. build_time_unittest.cc
  61. callback.h
  62. callback_forward.h
  63. callback_helpers.cc
  64. callback_helpers.h
  65. callback_helpers_unittest.cc
  66. callback_internal.cc
  67. callback_internal.h
  68. callback_list.h
  69. callback_list_unittest.cc
  70. callback_list_unittest.nc
  71. callback_unittest.cc
  72. callback_unittest.nc
  73. cancelable_callback.h
  74. cancelable_callback_unittest.cc
  75. check_example.cc
  76. command_line.cc
  77. command_line.h
  78. command_line_unittest.cc
  79. compiler_specific.h
  80. component_export.h
  81. component_export_unittest.cc
  82. containers/
  83. cpu.cc
  84. cpu.h
  85. cpu_unittest.cc
  86. critical_closure.h
  87. critical_closure_internal_ios.mm
  88. debug/
  89. deferred_sequenced_task_runner.cc
  90. deferred_sequenced_task_runner.h
  91. deferred_sequenced_task_runner_unittest.cc
  92. environment.cc
  93. environment.h
  94. environment_unittest.cc
  95. export_template.h
  96. feature_list.cc
  97. feature_list.h
  98. feature_list_unittest.cc
  99. file_descriptor_posix.h
  100. file_descriptor_store.cc
  101. file_descriptor_store.h
  102. file_version_info.h
  103. file_version_info_mac.h
  104. file_version_info_mac.mm
  105. file_version_info_win.cc
  106. file_version_info_win.h
  107. file_version_info_win_unittest.cc
  108. files/
  109. format_macros.h
  110. fuchsia/
  111. gmock_unittest.cc
  112. gtest_prod_util.h
  113. guid.cc
  114. guid.h
  115. guid_unittest.cc
  116. hash.cc
  117. hash.h
  118. hash_unittest.cc
  119. i18n/
  120. ios/
  121. json/
  122. lazy_instance.h
  123. lazy_instance_helpers.cc
  124. lazy_instance_helpers.h
  125. lazy_instance_unittest.cc
  126. linux_util.cc
  127. linux_util.h
  128. location.cc
  129. location.h
  130. logging.cc
  131. logging.h
  132. logging_unittest.cc
  133. logging_win.cc
  134. logging_win.h
  135. mac/
  136. macros.h
  137. md5.cc
  138. md5.h
  139. md5_unittest.cc
  140. memory/
  141. message_loop/
  142. metrics/
  143. native_library.cc
  144. native_library.h
  145. native_library_fuchsia.cc
  146. native_library_ios.mm
  147. native_library_mac.mm
  148. native_library_posix.cc
  149. native_library_unittest.cc
  150. native_library_win.cc
  151. nix/
  152. no_destructor.h
  153. no_destructor_unittest.cc
  154. numerics/
  155. observer_list.h
  156. observer_list_internal.cc
  157. observer_list_internal.h
  158. observer_list_perftest.cc
  159. observer_list_threadsafe.cc
  160. observer_list_threadsafe.h
  161. observer_list_threadsafe_unittest.cc
  162. observer_list_types.cc
  163. observer_list_types.h
  164. observer_list_unittest.cc
  165. observer_list_unittest.nc
  166. optional.h
  167. optional_unittest.cc
  168. optional_unittest.nc
  169. os_compat_android.cc
  170. os_compat_android.h
  171. os_compat_android_unittest.cc
  172. os_compat_nacl.cc
  173. os_compat_nacl.h
  174. path_service.cc
  175. path_service.h
  176. path_service_unittest.cc
  177. pending_task.cc
  178. pending_task.h
  179. pickle.cc
  180. pickle.h
  181. pickle_unittest.cc
  182. posix/
  183. post_task_and_reply_with_result_internal.h
  184. power_monitor/
  185. process/
  186. profiler/
  187. rand_util.cc
  188. rand_util.h
  189. rand_util_fuchsia.cc
  190. rand_util_nacl.cc
  191. rand_util_posix.cc
  192. rand_util_unittest.cc
  193. rand_util_win.cc
  194. run_loop.cc
  195. run_loop.h
  196. run_loop_unittest.cc
  197. safe_numerics_unittest.cc
  198. sampling_heap_profiler/
  199. scoped_clear_last_error.h
  200. scoped_clear_last_error_unittest.cc
  201. scoped_clear_last_error_win.cc
  202. scoped_generic.h
  203. scoped_generic_unittest.cc
  204. scoped_native_library.cc
  205. scoped_native_library.h
  206. scoped_native_library_unittest.cc
  207. scoped_observer.h
  208. security_unittest.cc
  209. sequence_checker.h
  210. sequence_checker_impl.cc
  211. sequence_checker_impl.h
  212. sequence_checker_unittest.cc
  213. sequence_token.cc
  214. sequence_token.h
  215. sequence_token_unittest.cc
  216. sequenced_task_runner.cc
  217. sequenced_task_runner.h
  218. sequenced_task_runner_helpers.h
  219. sequenced_task_runner_unittest.cc
  220. sha1.cc
  221. sha1.h
  222. sha1_unittest.cc
  223. single_thread_task_runner.h
  224. stl_util.h
  225. stl_util_unittest.cc
  226. strings/
  227. supports_user_data.cc
  228. supports_user_data.h
  229. supports_user_data_unittest.cc
  230. sync_socket.h
  231. sync_socket_nacl.cc
  232. sync_socket_posix.cc
  233. sync_socket_unittest.cc
  234. sync_socket_win.cc
  235. synchronization/
  236. sys_byteorder.h
  237. sys_byteorder_unittest.cc
  238. syslog_logging.cc
  239. syslog_logging.h
  240. system/
  241. task/
  242. task_runner.cc
  243. task_runner.h
  244. task_runner_util.h
  245. task_runner_util_unittest.cc
  246. template_util.h
  247. template_util_unittest.cc
  248. test/
  249. third_party/
  250. thread_annotations.h
  251. thread_annotations_unittest.cc
  252. thread_annotations_unittest.nc
  253. threading/
  254. time/
  255. timer/
  256. token.cc
  257. token.h
  258. token_unittest.cc
  259. tools_sanity_unittest.cc
  260. trace_event/
  261. tuple.h
  262. tuple_unittest.cc
  263. unguessable_token.cc
  264. unguessable_token.h
  265. unguessable_token_unittest.cc
  266. value_conversions.cc
  267. value_conversions.h
  268. value_iterators.cc
  269. value_iterators.h
  270. value_iterators_unittest.cc
  271. values.cc
  272. values.h
  273. values_unittest.cc
  274. version.cc
  275. version.h
  276. version_unittest.cc
  277. vlog.cc
  278. vlog.h
  279. vlog_unittest.cc
  280. win/
base/README.md

What is this

Contains a written down set of principles and other information on //base. Please add to it!

About //base:

Chromium is a very mature project. Most things that are generally useful are already here and things not here aren't generally useful.

Base is pulled into many projects. For example, various ChromeOS daemons. So the bar for adding stuff is that it must have demonstrated wide applicability. Prefer to add things closer to where they're used (i.e. “not base”), and pull into base only when needed. In a project our size, sometimes even duplication is OK and inevitable.

Adding a new logging macro DPVELOG_NE is not more clear than just writing the stuff you want to log in a regular logging statement, even if it makes your calling code longer. Just add it to your own code.

If the code in question does not need to be used inside base, but will have multiple consumers across the codebase, consider placing it in a new directory under components/ instead.

Qualifications for being in //base OWNERS

  • interest and ability to learn low level/high detail/complex c++ stuff
  • inclination to always ask why and understand everything (including external interactions like win32) rather than just hoping the author did it right
  • mentorship/experience
  • demonstrated good judgement (esp with regards to public APIs) over a length of time

Owners are added when a contributor has shown the above qualifications and when they express interest. There isn't an upper bound on the number of OWNERS.

Performance testing

Since the primitives provided by //base are used very widely, it is important to ensure they scale to the necessary workloads and perform well under all supported platforms. The base_perftests target is a suite of synthetic microbenchmarks that measure performance in various scenarios:

  • BasicPostTaskPerfTest: Exercises MessageLoopTaskRunner's multi-threaded queue in isolation.
  • ConditionVariablePerfTest: Measures thread switching cost of condition variables.
  • IntegratedPostTaskPerfTest: Exercises the full MessageLoop/RunLoop machinery.
  • JSONPerfTest: Tests JSONWriter and JSONReader performance.
  • MessageLoopPerfTest: Measures the speed of task posting in various configurations.
  • ObserverListPerfTest: Exercises adding, removing and signalling observers.
  • PthreadEventPerfTest: Establishes the baseline thread switching cost using pthreads.
  • ScheduleWorkTest: Measures the overhead of MessagePump::ScheduleWork.
  • SequenceManagerPerfTest: Benchmarks SequenceManager scheduling with various underlying task runners.
  • TaskObserverPerfTest: Measures the incremental cost of adding task observers.
  • TaskPerfTest: Checks the cost of posting tasks between threads.
  • WaitableEvent{Thread,}PerfTest: Measures waitable events in single and multithreaded scenarios.

Regressions in these benchmarks can generally by caused by 1) operating system changes, 2) compiler version or flag changes or 3) changes in //base code itself.