tree: 0686c49e266616266c10d3626a2f197e03704d8f [path history] [tgz]
  1. about_ui/
  2. access_code_cast/
  3. account_id/
  4. account_manager_core/
  5. aggregation_service/
  6. android_autofill/
  7. android_system_error_page/
  8. apdu/
  9. app_constants/
  10. app_restore/
  11. arc/
  12. arc_strings_grdp/
  13. assist_ranker/
  14. attribution_reporting/
  15. autofill/
  16. autofill_payments_strings_grdp/
  17. autofill_strings_grdp/
  18. back_forward_cache/
  19. background_fetch/
  20. background_sync/
  21. background_task_scheduler/
  22. base32/
  23. blocked_content/
  24. blocklist/
  25. bookmark_bar_strings_grdp/
  26. bookmark_component_strings_grdp/
  27. bookmarks/
  28. breadcrumbs/
  29. browser_sync/
  30. browser_ui/
  31. browser_watcher/
  32. browsing_data/
  33. browsing_data_strings_grdp/
  34. browsing_topics/
  35. captive_portal/
  36. cast/
  37. cast_receiver/
  38. cast_streaming/
  39. cbor/
  40. cdm/
  41. certificate_matching/
  42. certificate_transparency/
  43. chrome_cleaner/
  44. chromeos_camera/
  45. client_hints/
  46. client_update_protocol/
  47. cloud_devices/
  48. commerce/
  49. commerce_strings_grdp/
  50. component_updater/
  51. components_chromium_strings_grd/
  52. components_google_chrome_strings_grd/
  53. components_strings_grd/
  54. consent_auditor/
  55. constrained_window/
  56. content_capture/
  57. content_creation/
  58. content_creation_strings_grdp/
  59. content_settings/
  60. contextual_search/
  61. continuous_search/
  62. cookie_config/
  63. country_codes/
  64. crash/
  65. crash_strings_grdp/
  66. creator/
  67. cronet/
  68. crx_file/
  69. custom_handlers/
  70. database_utils/
  71. dbus/
  72. desks_storage/
  73. device_event_log/
  74. device_reauth/
  75. device_signals/
  76. devtools/
  77. digital_asset_links/
  78. digital_goods/
  79. discardable_memory/
  80. dom_distiller/
  81. dom_distiller_strings_grdp/
  82. domain_reliability/
  83. download/
  84. drive/
  85. embedder_support/
  86. encrypted_messages/
  87. endpoint_fetcher/
  88. enterprise/
  89. enterprise_strings_grdp/
  90. error_page/
  91. error_page_strings_grdp/
  92. exo/
  93. external_intents/
  94. external_intents_strings_grdp/
  95. externalauth/
  96. favicon/
  97. favicon_base/
  98. feature_engagement/
  99. feed/
  100. feedback/
  101. file_access/
  102. filename_generation/
  103. find_in_page/
  104. flags_strings_grdp/
  105. flags_ui/
  106. fuchsia_component_support/
  107. fuchsia_legacymetrics/
  108. fullscreen_control/
  109. fullscreen_control_strings_grdp/
  110. gcm_driver/
  111. global_media_controls/
  112. global_media_controls_strings_grdp/
  113. google/
  114. grpc_support/
  115. guest_os/
  116. guest_view/
  117. gwp_asan/
  118. handoff/
  119. heap_profiling/
  120. heavy_ad_intervention/
  121. heavy_ad_intervention_strings_grdp/
  122. history/
  123. history_clusters/
  124. history_clusters_strings_grdp/
  125. history_strings_grdp/
  126. image_fetcher/
  127. image_service/
  128. infobars/
  129. installedapp/
  130. invalidation/
  131. javascript_dialogs/
  132. javascript_dialogs_strings_grdp/
  133. js_injection/
  134. keep_alive_registry/
  135. keyed_service/
  136. language/
  137. lens/
  138. leveldb_proto/
  139. link_header_util/
  140. live_caption/
  141. live_caption_strings_grdp/
  142. local_state/
  143. location/
  144. login/
  145. lookalikes/
  146. management/
  147. management_ios_strings_grdp/
  148. management_strings_grdp/
  149. media_control/
  150. media_message_center/
  151. media_message_center_strings_grdp/
  152. media_router/
  153. memory_pressure/
  154. messages/
  155. metal_util/
  156. metrics/
  157. metrics_services_manager/
  158. minidump_uploader/
  159. mirroring/
  160. ml/
  161. module_installer/
  162. nacl/
  163. named_mojo_ipc_server/
  164. navigation_interception/
  165. navigation_metrics/
  166. net_log/
  167. neterror/
  168. network_hints/
  169. network_session_configurator/
  170. network_time/
  171. new_or_sad_tab_strings_grdp/
  172. no_state_prefetch/
  173. ntp_snippets/
  174. ntp_snippets_strings_grdp/
  175. ntp_tiles/
  176. offline_items_collection/
  177. offline_pages/
  178. omnibox/
  179. omnibox_pedal_ui_strings_grdp/
  180. omnibox_strings_grdp/
  181. on_load_script_injector/
  182. onc/
  183. open_from_clipboard/
  184. openscreen_platform/
  185. optimization_guide/
  186. origin_trials/
  187. os_crypt/
  188. ownership/
  189. page_image_annotation/
  190. page_info/
  191. page_info_strings_grdp/
  192. page_load_metrics/
  193. paint_preview/
  194. password_manager/
  195. password_manager_strings_grdp/
  196. payments/
  197. payments_strings_grdp/
  198. pdf/
  199. pdf_strings_grdp/
  200. performance_manager/
  201. permissions/
  202. permissions_strings_grdp/
  203. plugins/
  204. policy/
  205. policy_strings_grdp/
  206. power_bookmarks/
  207. power_metrics/
  208. power_monitor/
  209. power_scheduler/
  210. pref_registry/
  211. prefs/
  212. previous_session_info/
  213. print_media_strings_grdp/
  214. printing/
  215. printing_component_strings_grdp/
  216. privacy_sandbox/
  217. privacy_sandbox_strings_grdp/
  218. profile_metrics/
  219. proxy_config/
  220. pwg_encoder/
  221. qr_code_generator/
  222. query_parser/
  223. query_tiles/
  224. quirks/
  225. reading_list/
  226. reduce_accept_language/
  227. remote_cocoa/
  228. renderer_context_menu/
  229. reporting/
  230. reputation/
  231. reset_password_strings_grdp/
  232. resources/
  233. rlz/
  234. safe_browsing/
  235. safe_search_api/
  236. safety_check/
  237. saved_tab_groups/
  238. scheduling_metrics/
  239. schema_org/
  240. search/
  241. search_engines/
  242. search_provider_logos/
  243. security_interstitials/
  244. security_interstitials_strings_grdp/
  245. security_state/
  246. segmentation_platform/
  247. send_tab_to_self/
  248. send_tab_to_self_strings_grdp/
  249. services/
  250. session_manager/
  251. session_proto_db/
  252. sessions/
  253. shared_highlighting/
  254. signin/
  255. site_engagement/
  256. site_isolation/
  257. site_settings_strings_grdp/
  258. sms_strings_grdp/
  259. soda/
  260. soda_strings_grdp/
  261. speech/
  262. spellcheck/
  263. sqlite_proto/
  264. ssl_errors/
  265. ssl_errors_strings_grdp/
  266. startup_metric_utils/
  267. storage_monitor/
  268. strictmode/
  269. strings/
  270. stylus_handwriting/
  271. subresource_filter/
  272. subresource_filter_strings_grdp/
  273. supervised_user/
  274. supervised_user_strings_grdp/
  275. sync/
  276. sync_bookmarks/
  277. sync_device_info/
  278. sync_preferences/
  279. sync_sessions/
  280. sync_ui_strings_grdp/
  281. sync_user_events/
  282. system_media_controls/
  283. tab_count_metrics/
  284. tab_groups/
  285. tab_groups_strings_grdp/
  286. test/
  287. thin_webview/
  288. tracing/
  289. translate/
  290. translate_strings_grdp/
  291. ui_devtools/
  292. ui_metrics/
  293. ukm/
  294. undo/
  295. undo_strings_grdp/
  296. unified_consent/
  297. update_client/
  298. upload_list/
  299. url_formatter/
  300. url_matcher/
  301. url_pattern_index/
  302. url_rewrite/
  303. user_actions_ui/
  304. user_education/
  305. user_education_strings_grdp/
  306. user_manager/
  307. user_notes/
  308. user_prefs/
  309. value_store/
  310. variations/
  311. vector_icons/
  312. version_info/
  313. version_ui/
  314. version_ui_strings_grdp/
  315. visitedlink/
  316. viz/
  317. web_app_resources/
  318. web_cache/
  319. web_modal/
  320. web_package/
  321. web_resource/
  322. webapk/
  323. webapps/
  324. webauthn/
  325. webcrypto/
  326. webdata/
  327. webdata_services/
  328. webrtc/
  329. webrtc_logging/
  330. webxr/
  331. webxr_strings_grdp/
  332. wifi/
  333. winhttp/
  334. zoom/
  335. zucchini/
  336. .eslintrc.js
  337. android_system_error_page_strings.grdp
  338. arc_strings.grdp
  339. autofill_payments_strings.grdp
  340. autofill_strings.grdp
  341. blocked_content_strings.grdp
  342. bookmark_bar_strings.grdp
  343. bookmark_component_strings.grdp
  344. browsing_data_strings.grdp
  345. BUILD.gn
  346. commerce_strings.grdp
  347. components_chromium_strings.grd
  348. components_google_chrome_strings.grd
  349. components_locale_settings.grd
  350. components_settings_strings.grdp
  351. components_strings.grd
  352. content_creation_strings.grdp
  353. crash_strings.grdp
  354. DEPS
  355. dialog_strings.grdp
  356. dom_distiller_strings.grdp
  357. enterprise_strings.grdp
  358. error_page_strings.grdp
  359. external_intents_strings.grdp
  360. find_in_page_strings.grdp
  361. flags_strings.grdp
  362. fullscreen_control_strings.grdp
  363. global_media_controls_strings.grdp
  364. heavy_ad_intervention_strings.grdp
  365. history_clusters_strings.grdp
  366. history_strings.grdp
  367. javascript_dialogs_strings.grdp
  368. live_caption_strings.grdp
  369. login_dialog_strings.grdp
  370. management_ios_strings.grdp
  371. management_strings.grdp
  372. media_message_center_strings.grdp
  373. new_or_sad_tab_strings.grdp
  374. ntp_snippets_strings.grdp
  375. omnibox_pedal_ui_strings.grdp
  376. omnibox_strings.grdp
  377. OWNERS
  378. page_info_strings.grdp
  379. paint_preview_strings.grdp
  380. password_manager_strings.grdp
  381. payments_strings.grdp
  382. pdf_strings.grdp
  383. permissions_strings.grdp
  384. policy_strings.grdp
  385. PRESUBMIT.py
  386. print_media_strings.grdp
  387. printing_component_strings.grdp
  388. privacy_sandbox_strings.grdp
  389. protocol_handler_strings.grdp
  390. README.md
  391. reset_password_strings.grdp
  392. security_interstitials_strings.grdp
  393. send_tab_to_self_strings.grdp
  394. site_settings_strings.grdp
  395. sms_strings.grdp
  396. soda_strings.grdp
  397. ssl_errors_strings.grdp
  398. subresource_filter_strings.grdp
  399. supervised_user_strings.grdp
  400. sync_ui_strings.grdp
  401. tab_groups_strings.grdp
  402. translate_strings.grdp
  403. undo_strings.grdp
  404. user_education_strings.grdp
  405. version_ui_strings.grdp
  406. webapps_strings.grdp
  407. webxr_strings.grdp
components/README.md

About //components

This directory is meant to house features or subsystems that are used in more than one part of the Chromium codebase.

Use cases:

  • Features that are shared by Chrome on iOS (//ios/chrome) and Chrome on other platforms (//chrome).
    • Note: //ios doesn't depend on //chrome.
  • Features that are shared between multiple embedders of content. For example, //chrome and //android_webview.
  • Features that are shared between Blink and the browser process.
    • Note: It is also possible to place code shared between Blink and the browser process into //third_party/blink/common. The distinction comes down to (a) whether Blink is the owner of the code in question or a consumer of it and (b) whether the code in question is shared by Chrome on iOS as well. If the code is conceptually its own cross-process feature with Blink as a consumer, then //components can make sense. If it‘s conceptually Blink code, then //third_party/blink/common likely makes more sense. (In the so-far hypothetical case where it’s conceptually Blink code that is shared by iOS, raise the question on chromium-dev@, where the right folks will see it).

Note that the above list is meant to be exhaustive. A component should not be added just to separate it from other code in the same layer that is the only consumer; that can be done with strict DEPS or GN visibility rules.

Guidelines for adding a new component

  • You will be added to an OWNERS file under //components/{your component} and be responsible for maintaining your addition.
  • A //components/OWNER must approve of the location of your code.
  • Code must be needed in at least 2 places in Chrome that don't have a “higher layered” directory that could facilitate sharing (e.g. //content/common, //chrome/utility, etc.).
  • The CL adding a new component should be substantial enough so that //components/OWNERS can see its basic intended structure and usage before approving the addition (e.g., it should not just be an empty shell).

Dependencies of a component

Components cannot depend on the higher layers of the Chromium codebase:

  • //android_webview
  • //chrome
  • //chromecast
  • //headless
  • //ios/chrome
  • //content/shell

Components can depend on the lower layers of the Chromium codebase:

  • //base
  • //gpu
  • //mojo
  • //net
  • //printing
  • //ui

Components can depend on each other. This must be made explicit in the DEPS file of the component.

Components can depend on //content/public, //ipc, and //third_party/blink/public. This must be made explicit in the DEPS file of the component. If such a component is used by Chrome for iOS (which does not use content or IPC), the component will have to be in the form of a layered component.

//chrome, //ios/chrome, //content and //ios/web can depend on individual components. The dependency might have to be made explicit in the DEPS file of the higher layer (e.g. in //content/browser/DEPS). Circular dependencies are not allowed: if //content depends on a component, then that component cannot depend on //content/public, directly or indirectly.

Structure of a component

As mentioned above, components that depend on //content/public, //ipc, or third_party/blink/public might have to be in the form of a layered component.

Components that have bits of code that need to live in different processes (e.g. some code in the browser process, some in the renderer process, etc.) should separate the code into different subdirectories. Hence for a component named ‘foo’ you might end up with a structure like the following (assuming that foo is not used by iOS and thus does not need to be a layered component):

  • components/foo - BUILD.gn, DEPS, DIR_METADATA, OWNERS, README.md
  • components/foo/browser - code that needs the browser process
  • components/foo/common - for e.g. Mojo interfaces and such
  • components/foo/renderer - code that needs renderer process

These subdirectories should have DEPS files with the relevant restrictions in place, i.e. only components/foo/browser should be allowed to #include from content/public/browser. Note that third_party/blink/public is a renderer process directory except for third_party/blink/public/common which can be used by all processes.

Note that there may also be an android subdir, with a Java source code structure underneath it where the package name is org.chromium.components.foo, and with subdirs after ‘foo’ to illustrate process, e.g. ‘browser’ or ‘renderer’:

  • components/foo/android/{OWNERS, DEPS}
  • components/foo/android/java/src/org/chromium/components/foo/browser/
  • components/foo/android/javatests/src/org/chromium/components/foo/browser/

Code in a component should be placed in a namespace corresponding to the name of the component; e.g. for a component living in //components/foo, code in that component should be in the foo:: namespace.