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

Example 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).

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 and //ipc. 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 or //ipc 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 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.

How does this differ from //base/util?

See the explanation in //base/util/README.md.