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

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 - DEPS, OWNERS, BUILD.gn
  • 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.