• Home
Name Date Size #Lines LOC

..--

allocator/06-Sep-2024-79,17153,388

android/06-Sep-2024-54,17634,988

apple/06-Sep-2024-4,8273,315

containers/06-Sep-2024-18,94712,583

debug/06-Sep-2024-11,2717,321

files/06-Sep-2024-28,81719,738

fuchsia/06-Sep-2024-4,8063,146

functional/06-Sep-2024-8,5135,652

hash/06-Sep-2024-2,0981,326

i18n/06-Sep-2024-9,8716,609

ios/06-Sep-2024-1,9001,257

json/06-Sep-2024-6,5294,694

mac/06-Sep-2024-4,0212,899

macros/06-Sep-2024-9437

memory/06-Sep-2024-16,75410,888

message_loop/06-Sep-2024-10,8726,853

metrics/06-Sep-2024-26,04816,537

nix/06-Sep-2024-1,315898

numerics/06-Sep-2024-3,9262,893

posix/06-Sep-2024-1,7481,119

power_monitor/06-Sep-2024-3,7972,486

process/06-Sep-2024-15,74310,524

profiler/06-Sep-2024-16,13510,620

ranges/06-Sep-2024-7,2144,066

sampling_heap_profiler/06-Sep-2024-2,4651,592

strings/06-Sep-2024-16,16811,093

substring_set_matcher/06-Sep-2024-1,290773

synchronization/06-Sep-2024-4,9253,028

system/06-Sep-2024-3,3702,341

task/06-Sep-2024-59,79139,900

test/06-Sep-2024-50,42533,341

third_party/06-Sep-2024-17,39811,506

threading/06-Sep-2024-21,53913,607

time/06-Sep-2024-7,9295,059

timer/06-Sep-2024-3,0391,930

trace_event/06-Sep-2024-29,41420,720

tracing/06-Sep-2024-6,3484,751

types/06-Sep-2024-8,3315,804

win/06-Sep-2024-30,94821,726

BUILD.gnD06-Sep-2024185.4 KiB5,1124,767

DEPSD06-Sep-20241.3 KiB4237

DIR_METADATAD06-Sep-202443 43

PRESUBMIT.pyD06-Sep-20245.7 KiB160125

README.mdD06-Sep-20244.2 KiB8874

at_exit.ccD06-Sep-20243.3 KiB11675

at_exit.hD06-Sep-20242.8 KiB8939

at_exit_unittest.ccD06-Sep-20242.4 KiB8864

atomic_ref_count.hD06-Sep-20242.7 KiB7632

atomic_sequence_num.hD06-Sep-2024992 3215

atomicops.hD06-Sep-20246.5 KiB15457

atomicops_internals_atomicword_compat.hD06-Sep-20243.3 KiB9560

atomicops_internals_portable.hD06-Sep-20247.5 KiB196132

atomicops_unittest.ccD06-Sep-20247.4 KiB242171

auto_reset.hD06-Sep-20242.3 KiB7037

auto_reset_unittest.ccD06-Sep-2024822 3420

barrier_callback.hD06-Sep-20244 KiB12069

barrier_callback_unittest.ccD06-Sep-20245.2 KiB168121

barrier_closure.ccD06-Sep-20241.5 KiB5941

barrier_closure.hD06-Sep-2024930 299

barrier_closure_unittest.ccD06-Sep-20242.8 KiB8961

base64.ccD06-Sep-20243.5 KiB10871

base64.hD06-Sep-20242 KiB6327

base64_decode_fuzzer.ccD06-Sep-2024470 169

base64_encode_fuzzer.ccD06-Sep-2024854 2614

base64_unittest.ccD06-Sep-20244.8 KiB15494

base64url.ccD06-Sep-20244.6 KiB152105

base64url.hD06-Sep-20242.3 KiB6832

base64url_fuzzer.ccD06-Sep-20242 KiB6244

base64url_unittest.ccD06-Sep-20246.4 KiB188124

base_export.hD06-Sep-2024699 3020

base_paths.ccD06-Sep-20243.8 KiB11592

base_paths.hD06-Sep-20244.3 KiB10041

base_paths_android.ccD06-Sep-20242.3 KiB7147

base_paths_android.hD06-Sep-2024661 2611

base_paths_apple.ccD06-Sep-20241.5 KiB4930

base_paths_apple.hD06-Sep-2024711 239

base_paths_fuchsia.ccD06-Sep-20241.7 KiB5733

base_paths_ios.hD06-Sep-2024624 2610

base_paths_ios.mmD06-Sep-20242.1 KiB7056

base_paths_mac.hD06-Sep-2024629 2610

base_paths_mac.mmD06-Sep-20242.3 KiB7162

base_paths_posix.ccD06-Sep-20243.1 KiB10585

base_paths_posix.hD06-Sep-2024837 2910

base_paths_win.ccD06-Sep-20247.8 KiB214180

base_paths_win.hD06-Sep-20243.1 KiB6528

base_switches.ccD06-Sep-20249.1 KiB20058

base_switches.hD06-Sep-20242.3 KiB7858

big_endian.ccD06-Sep-20243.4 KiB154120

big_endian.hD06-Sep-20244.9 KiB15788

big_endian_perftest.ccD06-Sep-20243.4 KiB11491

big_endian_unittest.ccD06-Sep-20248.4 KiB267214

bit_cast.hD06-Sep-20241.3 KiB4932

bit_cast_unittest.ccD06-Sep-2024558 3220

bits.hD06-Sep-20245.1 KiB14777

bits_unittest.ccD06-Sep-20246.6 KiB174142

build_time.hD06-Sep-20241.2 KiB3710

build_time_unittest.ccD06-Sep-20241,022 3424

callback_list.ccD06-Sep-20241,007 4024

callback_list.hD06-Sep-202412.8 KiB348160

callback_list_nocompile.ncD06-Sep-20241.4 KiB5038

callback_list_unittest.ccD06-Sep-202417.5 KiB581391

cancelable_callback.hD06-Sep-20244.8 KiB15277

cancelable_callback_unittest.ccD06-Sep-20246 KiB207131

check.ccD06-Sep-202411.5 KiB329256

check.hD06-Sep-202410.7 KiB279136

check_deref.hD06-Sep-20241.5 KiB5323

check_example.ccD06-Sep-20241.2 KiB4019

check_is_test.ccD06-Sep-20241.2 KiB3918

check_is_test.hD06-Sep-20241.4 KiB448

check_is_test_unittest.ccD06-Sep-2024451 165

check_op.ccD06-Sep-20242.2 KiB10278

check_op.hD06-Sep-202410.7 KiB252158

check_unittest.ccD06-Sep-202425.3 KiB673503

command_line.ccD06-Sep-202423.8 KiB707541

command_line.hD06-Sep-202414.6 KiB343132

command_line_fuzzer.ccD06-Sep-20244.1 KiB143111

command_line_unittest.ccD06-Sep-202428.8 KiB803661

compiler_specific.hD06-Sep-202417.5 KiB468237

component_export.hD06-Sep-20243.5 KiB7732

component_export_unittest.ccD06-Sep-20242 KiB8355

cpu.ccD06-Sep-202413.1 KiB388263

cpu.hD06-Sep-20244.8 KiB160122

cpu_reduction_experiment.ccD06-Sep-20242 KiB7749

cpu_reduction_experiment.hD06-Sep-20241.1 KiB309

cpu_unittest.ccD06-Sep-20246.8 KiB221127

critical_closure.hD06-Sep-20244.6 KiB12875

critical_closure_internal_ios.mmD06-Sep-20241.1 KiB3928

dcheck_is_on.hD06-Sep-2024537 2314

enterprise_util.ccD06-Sep-2024310 146

enterprise_util.hD06-Sep-20242.2 KiB6627

enterprise_util_mac.mmD06-Sep-20248 KiB223190

enterprise_util_mac_unittest.mmD06-Sep-2024559 1912

enterprise_util_win.ccD06-Sep-20241 KiB3012

environment.ccD06-Sep-20243.6 KiB12488

environment.hD06-Sep-20241.7 KiB6133

environment_unittest.ccD06-Sep-20242.8 KiB10359

export_template.hD06-Sep-20246.3 KiB14839

feature_list.ccD06-Sep-202433.9 KiB959676

feature_list.hD06-Sep-202431.3 KiB656194

feature_list_unittest.ccD06-Sep-202436.9 KiB837641

features.ccD06-Sep-20242.7 KiB7132

features.hD06-Sep-20241.1 KiB4020

file_descriptor_posix.ccD06-Sep-2024913 3420

file_descriptor_posix.hD06-Sep-20242 KiB5520

file_descriptor_store.ccD06-Sep-20242.2 KiB7453

file_descriptor_store.hD06-Sep-20242.3 KiB7441

file_version_info.hD06-Sep-20242.4 KiB7038

file_version_info_apple.hD06-Sep-20241.4 KiB4527

file_version_info_apple.mmD06-Sep-20242.9 KiB9879

file_version_info_win.ccD06-Sep-20246 KiB201151

file_version_info_win.hD06-Sep-20242.6 KiB7947

file_version_info_win_unittest.ccD06-Sep-20245.8 KiB170129

format_macros.hD06-Sep-20241.9 KiB7542

gmock_unittest.ccD06-Sep-20243.8 KiB13685

gtest_prod_util.hD06-Sep-20241.9 KiB6712

immediate_crash.hD06-Sep-20245.9 KiB16767

immediate_crash_unittest.ccD06-Sep-20249 KiB237144

lazy_instance.hD06-Sep-20247.6 KiB21499

lazy_instance_helpers.ccD06-Sep-20242.7 KiB6936

lazy_instance_helpers.hD06-Sep-20244.5 KiB10141

lazy_instance_unittest.ccD06-Sep-202410 KiB323230

libcpp_hardening_test.ccD06-Sep-20242.4 KiB6124

linux_util.ccD06-Sep-20246.5 KiB232176

linux_util.hD06-Sep-20242.6 KiB6624

linux_util_unittest.ccD06-Sep-20242.6 KiB7764

location.ccD06-Sep-20244.6 KiB141100

location.hD06-Sep-20244.1 KiB11253

location_unittest.ccD06-Sep-20241.5 KiB4629

logging.ccD06-Sep-202441.2 KiB1,235881

logging.hD06-Sep-202429.7 KiB733311

logging_chromeos.ccD06-Sep-20243.2 KiB9164

logging_unittest.ccD06-Sep-202430.5 KiB955686

logging_win.ccD06-Sep-20244.2 KiB13993

logging_win.hD06-Sep-20242.5 KiB8541

moving_window.hD06-Sep-202421 KiB718467

moving_window_unittest.ccD06-Sep-20246.4 KiB205176

native_library.ccD06-Sep-2024438 168

native_library.hD06-Sep-20244.6 KiB13673

native_library_fuchsia.ccD06-Sep-20243.4 KiB11086

native_library_ios.mmD06-Sep-20241.2 KiB4837

native_library_mac.mmD06-Sep-20244.5 KiB133115

native_library_posix.ccD06-Sep-20242.3 KiB7550

native_library_unittest.ccD06-Sep-20246.1 KiB182121

native_library_win.ccD06-Sep-20246.2 KiB188128

no_destructor.hD06-Sep-20244.9 KiB13336

no_destructor_nocompile.ncD06-Sep-2024624 1913

no_destructor_unittest.ccD06-Sep-20247.5 KiB229144

nodebug_assertion.ccD06-Sep-2024455 189

notreached.hD06-Sep-20244 KiB9944

observer_list.hD06-Sep-202411.5 KiB383225

observer_list_internal.ccD06-Sep-2024666 2112

observer_list_internal.hD06-Sep-20245.8 KiB175120

observer_list_nocompile.ncD06-Sep-20241.1 KiB3325

observer_list_perftest.ccD06-Sep-20244.2 KiB13193

observer_list_threadsafe.ccD06-Sep-2024932 3016

observer_list_threadsafe.hD06-Sep-202412.8 KiB335208

observer_list_threadsafe_unittest.ccD06-Sep-202419.2 KiB600420

observer_list_types.ccD06-Sep-2024393 178

observer_list_types.hD06-Sep-20241.5 KiB4821

observer_list_unittest.ccD06-Sep-202429.2 KiB1,068808

one_shot_event.ccD06-Sep-20243.3 KiB10576

one_shot_event.hD06-Sep-20243.9 KiB10742

one_shot_event_unittest.ccD06-Sep-20245.2 KiB175136

os_compat_android.ccD06-Sep-20245.5 KiB17997

os_compat_android.hD06-Sep-2024558 229

os_compat_android_unittest.ccD06-Sep-20241.4 KiB4220

os_compat_nacl.ccD06-Sep-2024561 3121

os_compat_nacl.hD06-Sep-2024395 177

parameter_pack.hD06-Sep-20242.3 KiB8149

parameter_pack_unittest.ccD06-Sep-20242.6 KiB7457

path_service.ccD06-Sep-20249.8 KiB385279

path_service.hD06-Sep-20243.6 KiB9431

path_service_unittest.ccD06-Sep-202417.3 KiB470339

pending_task.ccD06-Sep-20243.1 KiB10374

pending_task.hD06-Sep-20244 KiB11158

pickle.ccD06-Sep-202412.7 KiB460363

pickle.hD06-Sep-202414.3 KiB364171

pickle_fuzzer.ccD06-Sep-20243.2 KiB128115

pickle_unittest.ccD06-Sep-202418.1 KiB650464

rand_util.ccD06-Sep-20245.3 KiB180116

rand_util.hD06-Sep-20247.6 KiB233104

rand_util_fuchsia.ccD06-Sep-20241.6 KiB6638

rand_util_nacl.ccD06-Sep-2024658 2818

rand_util_perftest.ccD06-Sep-20241.8 KiB5940

rand_util_posix.ccD06-Sep-20247 KiB242165

rand_util_unittest.ccD06-Sep-202413.2 KiB386244

rand_util_win.ccD06-Sep-20242.7 KiB10162

run_loop.ccD06-Sep-202412.5 KiB376245

run_loop.hD06-Sep-202414.9 KiB368140

run_loop_unittest.ccD06-Sep-202422.8 KiB671473

safe_numerics_unittest.ccD06-Sep-202488 KiB1,9721,677

scoped_add_feature_flags.ccD06-Sep-20243.2 KiB9175

scoped_add_feature_flags.hD06-Sep-20242.2 KiB6334

scoped_add_feature_flags_unittest.ccD06-Sep-20243.5 KiB8866

scoped_clear_last_error.hD06-Sep-20241.6 KiB5630

scoped_clear_last_error_unittest.ccD06-Sep-20241.2 KiB5843

scoped_clear_last_error_win.ccD06-Sep-2024473 2111

scoped_environment_variable_override.ccD06-Sep-20241.6 KiB5137

scoped_environment_variable_override.hD06-Sep-20241.6 KiB4831

scoped_generic.hD06-Sep-202410.6 KiB311145

scoped_generic_unittest.ccD06-Sep-20246.9 KiB321228

scoped_multi_source_observation.hD06-Sep-20243.3 KiB10448

scoped_multi_source_observation_unittest.ccD06-Sep-20246.3 KiB226171

scoped_native_library.ccD06-Sep-20241.2 KiB4125

scoped_native_library.hD06-Sep-20242 KiB6530

scoped_native_library_unittest.ccD06-Sep-20241.7 KiB4930

scoped_observation.hD06-Sep-20244.5 KiB14539

scoped_observation_traits.hD06-Sep-20242.6 KiB8123

scoped_observation_unittest.ccD06-Sep-20248.2 KiB297216

security_unittest.ccD06-Sep-20244 KiB11572

sequence_checker.ccD06-Sep-2024771 3019

sequence_checker.hD06-Sep-20244.8 KiB13248

sequence_checker_impl.ccD06-Sep-20242.9 KiB7940

sequence_checker_impl.hD06-Sep-20242.6 KiB6929

sequence_checker_nocompile.ncD06-Sep-20241.1 KiB4732

sequence_checker_unittest.ccD06-Sep-20249.2 KiB286194

sequence_token.ccD06-Sep-20242.4 KiB8657

sequence_token.hD06-Sep-20244.1 KiB12053

sequence_token_unittest.ccD06-Sep-20244.2 KiB13492

stack_canary_linux.ccD06-Sep-20243.7 KiB10969

stack_canary_linux.hD06-Sep-20241.3 KiB338

stack_canary_linux_unittest.ccD06-Sep-20241.5 KiB4624

state_transitions.hD06-Sep-20243.3 KiB10136

state_transitions_unittest.ccD06-Sep-20243.8 KiB10176

std_clamp_unittest.ccD06-Sep-20241.2 KiB4833

stl_util.hD06-Sep-20243.7 KiB12080

stl_util_unittest.ccD06-Sep-20245.7 KiB238204

supports_user_data.ccD06-Sep-20243.6 KiB11678

supports_user_data.hD06-Sep-20243.5 KiB9953

supports_user_data_unittest.ccD06-Sep-20244.9 KiB155109

sync_socket.ccD06-Sep-2024829 3216

sync_socket.hD06-Sep-20245 KiB14266

sync_socket_nacl.ccD06-Sep-20241.6 KiB7451

sync_socket_posix.ccD06-Sep-20246.7 KiB225158

sync_socket_unittest.ccD06-Sep-20245.5 KiB191134

sync_socket_win.ccD06-Sep-202410.4 KiB317232

sys_byteorder.hD06-Sep-20244.4 KiB156107

sys_byteorder_unittest.ccD06-Sep-20243.7 KiB143119

syslog_logging.ccD06-Sep-20244.9 KiB182130

syslog_logging.hD06-Sep-20241.9 KiB5730

template_util.hD06-Sep-20244.5 KiB14769

template_util_unittest.ccD06-Sep-20242 KiB5839

thread_annotations.hD06-Sep-20249.7 KiB26463

thread_annotations_nocompile.ncD06-Sep-20241.7 KiB6249

thread_annotations_unittest.ccD06-Sep-20241.2 KiB6044

token.ccD06-Sep-20242.2 KiB8357

token.hD06-Sep-20242.9 KiB9044

token_unittest.ccD06-Sep-20243 KiB9264

tools_sanity_unittest.ccD06-Sep-202414.1 KiB460318

traits_bag.hD06-Sep-20249.5 KiB247108

traits_bag_nocompile.ncD06-Sep-20242.3 KiB5338

traits_bag_unittest.ccD06-Sep-20246.5 KiB217152

tuple.hD06-Sep-20244.1 KiB11362

tuple_unittest.ccD06-Sep-20242.8 KiB11178

unguessable_token.ccD06-Sep-20241.9 KiB6440

unguessable_token.hD06-Sep-20245.1 KiB13864

unguessable_token_unittest.ccD06-Sep-20246 KiB189144

uuid.ccD06-Sep-20244.8 KiB170110

uuid.hD06-Sep-20244.3 KiB11648

uuid_unittest.ccD06-Sep-20246.9 KiB220169

value_iterators.ccD06-Sep-20243.1 KiB12985

value_iterators.hD06-Sep-20244.4 KiB13785

value_iterators_unittest.ccD06-Sep-20247.3 KiB265198

values.ccD06-Sep-202437.2 KiB1,3661,053

values.hD06-Sep-202445.8 KiB1,136523

values_nocompile.ncD06-Sep-20244.7 KiB11689

values_unittest.ccD06-Sep-202466.4 KiB2,2641,808

version.ccD06-Sep-20245.9 KiB198136

version.hD06-Sep-20242.6 KiB7834

version_unittest.ccD06-Sep-20246.2 KiB244211

vlog.ccD06-Sep-20245.6 KiB184145

vlog.hD06-Sep-20243.3 KiB10040

vlog_unittest.ccD06-Sep-20247.4 KiB189144

write_build_date_header.pyD06-Sep-20241.3 KiB3827

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