• Home
Name Date Size #Lines LOC

..--

allocator/03-May-2024-72,34148,815

android/03-May-2024-68,31547,262

containers/03-May-2024-19,87913,193

debug/03-May-2024-11,0617,168

files/03-May-2024-26,57718,185

fuchsia/03-May-2024-4,7973,141

functional/03-May-2024-8,3365,468

hash/03-May-2024-2,1111,333

i18n/03-May-2024-9,5756,411

ios/03-May-2024-1,9731,316

json/03-May-2024-6,3614,560

mac/03-May-2024-8,3395,800

memory/03-May-2024-16,17710,501

message_loop/03-May-2024-10,8536,827

metrics/03-May-2024-24,65915,676

nix/03-May-2024-688489

numerics/03-May-2024-3,9522,970

posix/03-May-2024-1,6091,031

power_monitor/03-May-2024-3,9852,616

process/03-May-2024-15,41210,299

profiler/03-May-2024-15,94210,465

ranges/03-May-2024-7,2094,063

sampling_heap_profiler/03-May-2024-2,5061,617

strings/03-May-2024-16,83711,717

substring_set_matcher/03-May-2024-1,290773

synchronization/03-May-2024-4,8772,992

system/03-May-2024-3,2102,259

task/03-May-2024-60,07740,052

test/03-May-2024-45,58330,026

third_party/03-May-2024-17,38711,495

threading/03-May-2024-20,71713,032

time/03-May-2024-7,8385,043

timer/03-May-2024-3,0161,912

trace_event/03-May-2024-28,94420,359

tracing/03-May-2024-2,1461,676

types/03-May-2024-7,2755,202

win/03-May-2024-30,89021,816

BUILD.gnD03-May-2024177.6 KiB4,9424,608

DEPSD03-May-20241.3 KiB4237

DIR_METADATAD03-May-202443 43

PRESUBMIT.pyD03-May-20245.8 KiB164126

README.mdD03-May-20244.2 KiB8874

at_exit.ccD03-May-20243.3 KiB11675

at_exit.hD03-May-20242.8 KiB8939

at_exit_unittest.ccD03-May-20242.4 KiB8864

atomic_ref_count.hD03-May-20242.7 KiB7632

atomic_sequence_num.hD03-May-2024992 3215

atomicops.hD03-May-20246.6 KiB15558

atomicops_internals_atomicword_compat.hD03-May-20243.3 KiB9560

atomicops_internals_portable.hD03-May-20247.5 KiB195131

atomicops_unittest.ccD03-May-20247.3 KiB239168

auto_reset.hD03-May-20242.3 KiB7037

auto_reset_unittest.ccD03-May-2024822 3420

barrier_callback.hD03-May-20244.1 KiB12170

barrier_callback_unittest.ccD03-May-20245.2 KiB168121

barrier_closure.ccD03-May-20241.5 KiB5941

barrier_closure.hD03-May-2024930 299

barrier_closure_unittest.ccD03-May-20242.8 KiB8961

base64.ccD03-May-20243.4 KiB10468

base64.hD03-May-20241.8 KiB5826

base64_decode_fuzzer.ccD03-May-2024470 169

base64_encode_fuzzer.ccD03-May-2024955 2816

base64_unittest.ccD03-May-20244.8 KiB15696

base64url.ccD03-May-20243.4 KiB10162

base64url.hD03-May-20241.7 KiB5523

base64url_fuzzer.ccD03-May-20242 KiB6244

base64url_unittest.ccD03-May-20243.5 KiB11572

base_export.hD03-May-2024699 3020

base_paths.ccD03-May-20241.8 KiB6147

base_paths.hD03-May-20243.5 KiB8737

base_paths_android.ccD03-May-20242.3 KiB7147

base_paths_android.hD03-May-2024661 2611

base_paths_fuchsia.ccD03-May-20241.5 KiB5131

base_paths_mac.hD03-May-2024629 2610

base_paths_mac.mmD03-May-20244.9 KiB143128

base_paths_posix.ccD03-May-20243.8 KiB12197

base_paths_posix.hD03-May-2024837 2910

base_paths_win.ccD03-May-20247.8 KiB213179

base_paths_win.hD03-May-20243.1 KiB6528

base_switches.ccD03-May-20248.2 KiB18753

base_switches.hD03-May-20242.1 KiB7353

big_endian.ccD03-May-20243.4 KiB154120

big_endian.hD03-May-20244.7 KiB14789

big_endian_unittest.ccD03-May-20248.4 KiB267214

bit_cast.hD03-May-20241.3 KiB4932

bit_cast_unittest.ccD03-May-2024558 3220

bits.hD03-May-20245.3 KiB14473

bits_unittest.ccD03-May-202410.3 KiB278237

build_time.hD03-May-20241.2 KiB3710

build_time_unittest.ccD03-May-2024831 2819

callback_list.ccD03-May-20241,007 4024

callback_list.hD03-May-202412.8 KiB350162

callback_list_unittest.ccD03-May-202417.5 KiB581391

callback_list_unittest.ncD03-May-20241.4 KiB5540

cancelable_callback.hD03-May-20244.8 KiB15277

cancelable_callback_unittest.ccD03-May-20246 KiB207131

check.ccD03-May-20249.3 KiB271204

check.hD03-May-20247.5 KiB216112

check_deref.hD03-May-20241.5 KiB5323

check_example.ccD03-May-20241.2 KiB4019

check_is_test.ccD03-May-20241.2 KiB3918

check_is_test.hD03-May-20241.4 KiB448

check_is_test_unittest.ccD03-May-2024451 165

check_op.ccD03-May-20241.6 KiB8059

check_op.hD03-May-202410.6 KiB257163

check_unittest.ccD03-May-202420.9 KiB566414

command_line.ccD03-May-202423.8 KiB707541

command_line.hD03-May-202414.5 KiB342132

command_line_fuzzer.ccD03-May-20244.1 KiB143111

command_line_unittest.ccD03-May-202427.3 KiB766633

compiler_specific.hD03-May-202415.1 KiB418215

component_export.hD03-May-20243.5 KiB7732

component_export_unittest.ccD03-May-20242 KiB8355

cpu.ccD03-May-202413.1 KiB388263

cpu.hD03-May-20244.8 KiB159121

cpu_reduction_experiment.ccD03-May-20242 KiB7749

cpu_reduction_experiment.hD03-May-20241.1 KiB309

cpu_unittest.ccD03-May-20246.8 KiB221127

critical_closure.hD03-May-20244.6 KiB12875

critical_closure_internal_ios.mmD03-May-20241.1 KiB4130

cxx17_backports.hD03-May-2024424 197

cxx17_backports_unittest.ccD03-May-20243.6 KiB11186

cxx20_is_constant_evaluated.hD03-May-2024598 228

cxx20_is_constant_evaluated_unittest.ccD03-May-2024408 178

cxx20_to_address.hD03-May-20241.3 KiB5130

dcheck_is_on.hD03-May-2024537 2314

enterprise_util.ccD03-May-2024310 146

enterprise_util.hD03-May-20242.7 KiB7935

enterprise_util_mac.mmD03-May-202411 KiB300254

enterprise_util_mac_unittest.mmD03-May-20241,014 3021

enterprise_util_win.ccD03-May-20241 KiB3012

environment.ccD03-May-20243.6 KiB12488

environment.hD03-May-20241.7 KiB6133

environment_unittest.ccD03-May-20242.8 KiB10359

export_template.hD03-May-20246.3 KiB14839

feature_list.ccD03-May-202431.9 KiB904632

feature_list.hD03-May-202429.5 KiB620184

feature_list_unittest.ccD03-May-202435.5 KiB804613

features.ccD03-May-20241.5 KiB4116

features.hD03-May-2024789 3013

file_descriptor_posix.ccD03-May-2024913 3420

file_descriptor_posix.hD03-May-20242 KiB5520

file_descriptor_store.ccD03-May-20242.2 KiB7453

file_descriptor_store.hD03-May-20242.3 KiB7441

file_version_info.hD03-May-20242.4 KiB7038

file_version_info_mac.hD03-May-20241.4 KiB4528

file_version_info_mac.mmD03-May-20242.8 KiB9778

file_version_info_win.ccD03-May-20246 KiB201151

file_version_info_win.hD03-May-20242.6 KiB7947

file_version_info_win_unittest.ccD03-May-20245.8 KiB170129

format_macros.hD03-May-20242.4 KiB9957

gmock_unittest.ccD03-May-20243.8 KiB13685

gtest_prod_util.hD03-May-20241.9 KiB6712

guid.hD03-May-2024405 144

immediate_crash.hD03-May-20245.5 KiB15559

immediate_crash_unittest.ccD03-May-20249 KiB237144

lazy_instance.hD03-May-20247.6 KiB21499

lazy_instance_helpers.ccD03-May-20242.7 KiB6936

lazy_instance_helpers.hD03-May-20244.5 KiB10141

lazy_instance_unittest.ccD03-May-202410 KiB323230

libcpp_hardening_test.ccD03-May-20242.3 KiB6125

linux_util.ccD03-May-20246.2 KiB223169

linux_util.hD03-May-20242.1 KiB5823

linux_util_unittest.ccD03-May-20242.6 KiB7764

location.ccD03-May-20244.6 KiB141100

location.hD03-May-20243.9 KiB10952

location_unittest.ccD03-May-20241.5 KiB4730

logging.ccD03-May-202442.9 KiB1,291927

logging.hD03-May-202432.2 KiB797322

logging_chromeos.ccD03-May-20243.2 KiB9164

logging_unittest.ccD03-May-202430.9 KiB967696

logging_win.ccD03-May-20244.2 KiB13993

logging_win.hD03-May-20242.5 KiB8541

native_library.ccD03-May-2024438 168

native_library.hD03-May-20244.4 KiB13372

native_library_fuchsia.ccD03-May-20243.4 KiB11086

native_library_ios.mmD03-May-20241.2 KiB4837

native_library_mac.mmD03-May-20244.5 KiB133115

native_library_posix.ccD03-May-20242.3 KiB7550

native_library_unittest.ccD03-May-20246 KiB181120

native_library_win.ccD03-May-20247.9 KiB231148

no_destructor.hD03-May-20244.9 KiB13336

no_destructor_unittest.ccD03-May-20247.5 KiB229144

no_destructor_unittest.ncD03-May-2024624 2415

nodebug_assertion.ccD03-May-2024455 189

notreached.hD03-May-20243 KiB8041

observer_list.hD03-May-202411.9 KiB391233

observer_list_internal.ccD03-May-2024666 2112

observer_list_internal.hD03-May-20245.7 KiB173118

observer_list_perftest.ccD03-May-20244.2 KiB13193

observer_list_threadsafe.ccD03-May-2024932 3016

observer_list_threadsafe.hD03-May-202410.9 KiB285172

observer_list_threadsafe_unittest.ccD03-May-202415.7 KiB518363

observer_list_types.ccD03-May-2024393 178

observer_list_types.hD03-May-20241.5 KiB4821

observer_list_unittest.ccD03-May-202429.2 KiB1,068808

observer_list_unittest.ncD03-May-20241.2 KiB3928

one_shot_event.ccD03-May-20243.3 KiB10576

one_shot_event.hD03-May-20243.9 KiB10742

one_shot_event_unittest.ccD03-May-20245.2 KiB175136

os_compat_android.ccD03-May-20245.5 KiB17997

os_compat_android.hD03-May-2024558 229

os_compat_android_unittest.ccD03-May-20241.4 KiB4220

os_compat_nacl.ccD03-May-2024561 3121

os_compat_nacl.hD03-May-2024395 177

parameter_pack.hD03-May-20242.3 KiB8351

parameter_pack_unittest.ccD03-May-20242.7 KiB7760

path_service.ccD03-May-20249 KiB362258

path_service.hD03-May-20243.6 KiB9431

path_service_unittest.ccD03-May-202414.4 KiB391285

pending_task.ccD03-May-20242.4 KiB7654

pending_task.hD03-May-20243.3 KiB9343

pickle.ccD03-May-202412.3 KiB448354

pickle.hD03-May-202414.4 KiB363170

pickle_fuzzer.ccD03-May-20243.2 KiB128115

pickle_unittest.ccD03-May-202417.8 KiB638456

rand_util.ccD03-May-20244.1 KiB13886

rand_util.hD03-May-20246.5 KiB20194

rand_util_fuchsia.ccD03-May-20241.6 KiB6638

rand_util_nacl.ccD03-May-2024658 2818

rand_util_perftest.ccD03-May-20241.8 KiB5940

rand_util_posix.ccD03-May-20247 KiB242165

rand_util_unittest.ccD03-May-202412 KiB343208

rand_util_win.ccD03-May-20242.6 KiB9660

run_loop.ccD03-May-202412.5 KiB376245

run_loop.hD03-May-202414.9 KiB368140

run_loop_unittest.ccD03-May-202422.8 KiB671473

safe_numerics_unittest.ccD03-May-202485 KiB1,8951,607

scoped_add_feature_flags.ccD03-May-20243.2 KiB9175

scoped_add_feature_flags.hD03-May-20242.2 KiB6334

scoped_add_feature_flags_unittest.ccD03-May-20243.5 KiB8866

scoped_clear_last_error.hD03-May-20241.6 KiB5630

scoped_clear_last_error_unittest.ccD03-May-20241.2 KiB5843

scoped_clear_last_error_win.ccD03-May-2024473 2111

scoped_environment_variable_override.ccD03-May-20241.6 KiB5137

scoped_environment_variable_override.hD03-May-20241.6 KiB4831

scoped_generic.hD03-May-202411 KiB326158

scoped_generic_unittest.ccD03-May-20246.9 KiB321228

scoped_multi_source_observation.hD03-May-20243.3 KiB10448

scoped_multi_source_observation_unittest.ccD03-May-20246.3 KiB226171

scoped_native_library.ccD03-May-20241.2 KiB4125

scoped_native_library.hD03-May-20242 KiB6530

scoped_native_library_unittest.ccD03-May-20241.7 KiB4930

scoped_observation.hD03-May-20244.3 KiB14138

scoped_observation_traits.hD03-May-20242.6 KiB7920

scoped_observation_traits_internal.hD03-May-2024963 3220

scoped_observation_unittest.ccD03-May-20247 KiB267186

security_unittest.ccD03-May-20244 KiB11572

sequence_checker.ccD03-May-2024771 3019

sequence_checker.hD03-May-20245.1 KiB13752

sequence_checker_impl.ccD03-May-20243 KiB8041

sequence_checker_impl.hD03-May-20242.6 KiB6929

sequence_checker_unittest.ccD03-May-20249.2 KiB286194

sequence_checker_unittest.ncD03-May-20241.1 KiB4429

sequence_token.ccD03-May-20242.4 KiB8657

sequence_token.hD03-May-20244.1 KiB12053

sequence_token_unittest.ccD03-May-20244.2 KiB13492

stack_canary_linux.ccD03-May-20243.7 KiB10969

stack_canary_linux.hD03-May-20241.3 KiB338

stack_canary_linux_unittest.ccD03-May-20241.5 KiB4523

state_transitions.hD03-May-20243.3 KiB10136

state_transitions_unittest.ccD03-May-20243.8 KiB10176

stl_util.hD03-May-20245.2 KiB161104

stl_util_unittest.ccD03-May-20247.1 KiB283237

supports_user_data.ccD03-May-20244.2 KiB13496

supports_user_data.hD03-May-20243.7 KiB10456

supports_user_data_unittest.ccD03-May-20244.1 KiB13698

sync_socket.ccD03-May-2024829 3216

sync_socket.hD03-May-20245 KiB14266

sync_socket_nacl.ccD03-May-20241.6 KiB7451

sync_socket_posix.ccD03-May-20246.7 KiB225158

sync_socket_unittest.ccD03-May-20245.5 KiB191134

sync_socket_win.ccD03-May-202410.4 KiB317232

sys_byteorder.hD03-May-20244.4 KiB156107

sys_byteorder_unittest.ccD03-May-20243.7 KiB143119

syslog_logging.ccD03-May-20244.9 KiB182130

syslog_logging.hD03-May-20241.9 KiB5730

template_util.hD03-May-20244.8 KiB15374

template_util_unittest.ccD03-May-20242.8 KiB7554

thread_annotations.hD03-May-20249.7 KiB26463

thread_annotations_unittest.ccD03-May-20241.2 KiB6044

thread_annotations_unittest.ncD03-May-20241.8 KiB7254

token.ccD03-May-20242 KiB7752

token.hD03-May-20243.1 KiB10052

token_unittest.ccD03-May-20243 KiB9264

tools_sanity_unittest.ccD03-May-202414.1 KiB460318

traits_bag.hD03-May-20249.9 KiB256115

traits_bag_unittest.ccD03-May-20246.9 KiB224159

traits_bag_unittest.ncD03-May-20241.8 KiB5240

tuple.hD03-May-20244.2 KiB11362

tuple_unittest.ccD03-May-20242.8 KiB11178

unguessable_token.ccD03-May-20241.9 KiB6440

unguessable_token.hD03-May-20244.8 KiB13764

unguessable_token_unittest.ccD03-May-20246 KiB188143

uuid.ccD03-May-20245.6 KiB212143

uuid.hD03-May-20245.3 KiB14362

uuid_unittest.ccD03-May-20247.8 KiB247193

value_iterators.ccD03-May-20243.1 KiB12985

value_iterators.hD03-May-20244.4 KiB13785

value_iterators_unittest.ccD03-May-20247.3 KiB265198

values.ccD03-May-202437.8 KiB1,4031,079

values.hD03-May-202447.7 KiB1,185530

values_unittest.ccD03-May-202467.2 KiB2,2711,811

values_unittest.ncD03-May-20243.4 KiB13193

version.ccD03-May-20245.9 KiB198136

version.hD03-May-20242.6 KiB7834

version_unittest.ccD03-May-20246.2 KiB244211

vlog.ccD03-May-20245.6 KiB184145

vlog.hD03-May-20243.3 KiB10040

vlog_unittest.ccD03-May-20247.4 KiB189144

write_build_date_header.pyD03-May-20241.2 KiB4027

README.md

1# What is this
2Contains a written down set of principles and other information on //base.
3Please add to it!
4
5## About //base:
6
7Chromium is a very mature project. Most things that are generally useful are
8already here and things not here aren't generally useful.
9
10The bar for adding stuff to base is that it must have demonstrated wide
11applicability. Prefer to add things closer to where they're used (i.e. "not
12base"), and pull into base only when needed. In a project our size,
13sometimes even duplication is OK and inevitable.
14
15Adding a new logging macro `DPVELOG_NE` is not more clear than just
16writing the stuff you want to log in a regular logging statement, even
17if it makes your calling code longer. Just add it to your own code.
18
19If the code in question does not need to be used inside base, but will have
20multiple consumers across the codebase, consider placing it in a new directory
21under components/ instead.
22
23base is written for the Chromium project and is not intended to be used
24outside it.  Using base outside of src.git is explicitly not supported,
25and base makes no guarantees about API (or even ABI) stability (like all
26other code in Chromium).  New code that depends on base/ must be in
27src.git. Code that's not in src.git but pulled in through DEPS (for
28example, v8) cannot use base.
29
30## Qualifications for being in //base OWNERS
31  * interest and ability to learn low level/high detail/complex c++ stuff
32  * inclination to always ask why and understand everything (including external
33    interactions like win32) rather than just hoping the author did it right
34  * mentorship/experience
35  * demonstrated good judgement (esp with regards to public APIs) over a length
36    of time
37
38Owners are added when a contributor has shown the above qualifications and
39when they express interest. There isn't an upper bound on the number of OWNERS.
40
41## Design and naming
42  * Be sure to use the base namespace.
43  * STL-like constructs should adhere as closely to STL as possible. Functions
44    and behaviors not present in STL should only be added when they are related
45    to the specific data structure implemented by the container.
46  * For STL-like constructs our policy is that they should use STL-like naming
47    even when it may conflict with the style guide. So functions and class names
48    should be lower case with underscores. Non-STL-like classes and functions
49    should use Google naming.
50
51## Performance testing
52
53Since the primitives provided by //base are used very widely, it is important to
54ensure they scale to the necessary workloads and perform well under all
55supported platforms. The `base_perftests` target is a suite of
56synthetic microbenchmarks that measure performance in various scenarios:
57
58  * BasicPostTaskPerfTest: Exercises MessageLoopTaskRunner's multi-threaded
59    queue in isolation.
60  * ConditionVariablePerfTest: Measures thread switching cost of condition
61    variables.
62  * IntegratedPostTaskPerfTest: Exercises the full MessageLoop/RunLoop
63    machinery.
64  * JSONPerfTest: Tests JSONWriter and JSONReader performance.
65  * MessageLoopPerfTest: Measures the speed of task posting in various
66    configurations.
67  * ObserverListPerfTest: Exercises adding, removing and signalling observers.
68  * PartitionLockPerfTest: Tests the implementation of Lock used in
69    PartitionAlloc
70  * PthreadEventPerfTest: Establishes the baseline thread switching cost using
71    pthreads.
72  * RandUtilPerfTest: Measures the time it takes to generate random numbers.
73  * ScheduleWorkTest: Measures the overhead of MessagePump::ScheduleWork.
74  * SequenceManagerPerfTest: Benchmarks SequenceManager scheduling with various
75    underlying task runners.
76  * TaskObserverPerfTest: Measures the incremental cost of adding task
77    observers.
78  * TaskPerfTest: Checks the cost of posting tasks between threads.
79  * ThreadLocalStoragePerfTest: Exercises different mechanisms for accessing
80    data associated with the current thread (C++ `thread_local`, the
81    implementation in //base, the POSIX/WinAPI directly)
82  * WaitableEvent{Thread,}PerfTest: Measures waitable events in single and
83    multithreaded scenarios.
84
85Regressions in these benchmarks can generally by caused by 1) operating system
86changes, 2) compiler version or flag changes or 3) changes in //base code
87itself.
88