naiveproxy/src/base/android
2024-11-20 20:19:38 +08:00
..
javatests Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_generator Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
library_loader Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
linker Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
orderfile Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
proguard Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
shared_preferences Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
task_scheduler Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
android_hardware_buffer_compat.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
android_hardware_buffer_compat.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
android_image_reader_compat.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
android_image_reader_compat.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
android_input_receiver_compat.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
android_input_receiver_compat.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
apk_assets.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
apk_assets.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
application_status_listener_stub.cc android: base: Add Android stubs 2024-11-20 20:19:38 +08:00
application_status_listener.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
application_status_listener.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
base_feature_map.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
base_jni_onload.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
base_jni_onload.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
binder_box.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
binder_box.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
binder.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
binder.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
build_info_stub.cc android: base: Add Android stubs 2024-11-20 20:19:38 +08:00
build_info.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
build_info.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
bundle_utils.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
bundle_utils.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
callback_android.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
callback_android.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
child_process_binding_types.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
child_process_service.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
command_line_android.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
COMMON_METADATA Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
content_uri_utils_stub.cc android: base: Add Android stubs 2024-11-20 20:19:38 +08:00
content_uri_utils.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
content_uri_utils.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
cpu_features.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
DIR_METADATA Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
early_trace_event_binding.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
early_trace_event_binding.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
event_log.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
event_log.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
feature_list_jni.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
feature_map.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
feature_map.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
features_jni.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
field_trial_list.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
important_file_writer_android.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
input_hint_checker.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
input_hint_checker.h android: base: Add Android stubs 2024-11-20 20:19:38 +08:00
int_string_callback.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
int_string_callback.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jank_metric_uma_recorder.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jank_metric_uma_recorder.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
java_exception_reporter.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
java_exception_reporter.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
java_handler_thread.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
java_handler_thread.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
java_heap_dump_generator.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
java_heap_dump_generator.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
java_runtime.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
java_runtime.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_android_stub.cc android: base: Add Android stubs 2024-11-20 20:19:38 +08:00
jni_android.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_android.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_array.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_array.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_bytebuffer.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_bytebuffer.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_registrar.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_registrar.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_string.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_string.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_utils.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_utils.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
jni_weak_ref.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
locale_utils.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
locale_utils.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
meminfo_dump_provider.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
meminfo_dump_provider.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
memory_pressure_listener_android.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
memory_pressure_listener_android.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
memory_purge_manager_android.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
memory_purge_manager_android.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
native_uma_recorder.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
OWNERS Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
path_service_android.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
path_utils.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
path_utils.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
pmf_utils.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
pmf_utils.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
pre_freeze_background_memory_trimmer.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
pre_freeze_background_memory_trimmer.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
radio_utils.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
radio_utils.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
README.md Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
requires_api.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
resource_exclusions.gni Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
robolectric_jni_onload.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
scoped_hardware_buffer_fence_sync.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
scoped_hardware_buffer_fence_sync.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
scoped_hardware_buffer_handle.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
scoped_hardware_buffer_handle.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
scoped_java_ref.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
statistics_recorder_android.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
sys_utils.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
sys_utils.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
thread_instruction_count.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
thread_instruction_count.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
timezone_utils.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
timezone_utils.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
token_android.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
token_android.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
trace_event_binding.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
trace_event_binding.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
unguessable_token_android.cc Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00
unguessable_token_android.h Import chromium-131.0.6778.86 2024-11-20 19:32:56 +08:00

//base/android

This directory contains:

  • C++ APIs that are broadly useful and are unique to target_os="android", and
  • Java APIs that are broadly useful, along C++ bindings when necessary.

This directory does not contain Android-specific implementations / extensions to APIs declared directly in //base. Those live in //base/*_android.cc, or behind #ifdefs.

Adding New APIs

The advice laid out in //base/README.md applies to this directory as well. The bars for what APIs should exist and for code quality are generally higher than for other directories. If you find yourself wanting to add a new API, you should expect that code reviews take multiple revisions and that they be met with (respectful) scrutiny.

If you are not sure whether an API would make sense to add, you can ask via java@chromium.org. It is common to add APIs to //chrome (or elsewhere) first, and move them into //base after their usefulness has been proven.

What Uses //base/android?

The main two clients are Chrome and WebView, but it is also used by other Chromium-based apps, such as Chromecast and Chrome Remote desktop. Some //base/android classes are used by //build (this is a layering violation, tracked in crbug/1364192 and crbug/1377351).

Two considerations for WebView:

  1. The application Context is that of the host app's.
  2. The UI thread might be different from the main thread.

New API Checklist

Here is a list of checks you should go through when adding a new API:

  1. The functionality does not already exist in system libraries (Java APIs, Android SDK) or in already adopted third_party libraries, such as AndroidX.
  2. Reasonable effort has been made to ensure the new API is discoverable. E.g.: Coordinate refactorings of existing patterns to it, add a [presubmit check], to recommend it, etc.
  3. Tests (ideally Robolectric) are added.
  4. Thought has been put into API design.
    • E.g. adding @Nullable, or @DoNotMock
    • E.g. adding test helpers, such as ForTesting() methods or TestRules
    • E.g. adding asserts or comments about thread-safety
    • E.g. could usage of the API be made harder to get wrong?

Choosing a Reviewer

All members of //base/android/OWNERS will be CC'ed on reviews through a //WATCHLIST entry. For new APIs, feel free to pick a reviewer at random. For modifying existing files, it is best to use a reviewer from prior changes to the file.