tree: c3f48fe97c777e764b13ea530b40796ae62818e8 [path history] [tgz]
  1. about_ui/
  2. account_id/
  3. account_manager_core/
  4. accuracy_tips/
  5. android_autofill/
  6. android_system_error_page/
  7. apdu/
  8. arc/
  9. arc_strings_grdp/
  10. assist_ranker/
  11. autofill/
  12. autofill_assistant/
  13. autofill_assistant_strings_grdp/
  14. autofill_payments_strings_grdp/
  15. autofill_strings_grdp/
  16. back_forward_cache/
  17. background_fetch/
  18. background_sync/
  19. background_task_scheduler/
  20. base32/
  21. blocked_content/
  22. blocklist/
  23. bookmark_bar_strings_grdp/
  24. bookmarks/
  25. breadcrumbs/
  26. browser_sync/
  27. browser_ui/
  28. browser_watcher/
  29. browsing_data/
  30. browsing_data_strings_grdp/
  31. captive_portal/
  32. cast/
  33. cast_certificate/
  34. cast_channel/
  35. cast_streaming/
  36. cbor/
  37. cdm/
  38. certificate_matching/
  39. certificate_transparency/
  40. chrome_cleaner/
  41. chromeos_camera/
  42. client_hints/
  43. client_update_protocol/
  44. cloud_devices/
  45. component_updater/
  46. components_chromium_strings_grd/
  47. components_google_chrome_strings_grd/
  48. components_strings_grd/
  49. consent_auditor/
  50. constrained_window/
  51. content_capture/
  52. content_creation/
  53. content_creation_strings_grdp/
  54. content_settings/
  55. contextual_search/
  56. continuous_search/
  57. cookie_config/
  58. country_codes/
  59. crash/
  60. crash_strings_grdp/
  61. cronet/
  62. crx_file/
  63. data_reduction_proxy/
  64. data_use_measurement/
  65. database_utils/
  66. dbus/
  67. desks_storage/
  68. device_event_log/
  69. digital_asset_links/
  70. discardable_memory/
  71. dom_distiller/
  72. dom_distiller_strings_grdp/
  73. domain_reliability/
  74. download/
  75. drive/
  76. embedder_support/
  77. encrypted_messages/
  78. enterprise/
  79. error_page/
  80. error_page_strings_grdp/
  81. exo/
  82. external_intents/
  83. externalauth/
  84. favicon/
  85. favicon_base/
  86. feature_engagement/
  87. federated_learning/
  88. feed/
  89. feedback/
  90. filename_generation/
  91. find_in_page/
  92. flags_ui/
  93. full_restore/
  94. fullscreen_control/
  95. fullscreen_control_strings_grdp/
  96. gcm_driver/
  97. google/
  98. grpc_support/
  99. guest_os/
  100. guest_view/
  101. gwp_asan/
  102. handoff/
  103. heap_profiling/
  104. heavy_ad_intervention/
  105. heavy_ad_intervention_strings_grdp/
  106. history/
  107. history_clusters/
  108. history_clusters_strings_grdp/
  109. history_strings_grdp/
  110. image_fetcher/
  111. infobars/
  112. installedapp/
  113. invalidation/
  114. javascript_dialogs/
  115. javascript_dialogs_strings_grdp/
  116. js_injection/
  117. keep_alive_registry/
  118. keyed_service/
  119. language/
  120. lens/
  121. leveldb_proto/
  122. link_header_util/
  123. live_caption/
  124. live_caption_strings_grdp/
  125. location/
  126. login/
  127. lookalikes/
  128. management/
  129. management_ios_strings_grdp/
  130. management_strings_grdp/
  131. media_control/
  132. media_message_center/
  133. media_router/
  134. messages/
  135. metal_util/
  136. metrics/
  137. metrics_services_manager/
  138. minidump_uploader/
  139. mirroring/
  140. module_installer/
  141. nacl/
  142. navigation_interception/
  143. navigation_metrics/
  144. net_log/
  145. neterror/
  146. network_hints/
  147. network_session_configurator/
  148. network_time/
  149. new_or_sad_tab_strings_grdp/
  150. no_state_prefetch/
  151. ntp_snippets/
  152. ntp_snippets_strings_grdp/
  153. ntp_tiles/
  154. offline_items_collection/
  155. offline_pages/
  156. omnibox/
  157. omnibox_strings_grdp/
  158. on_load_script_injector/
  159. onc/
  160. open_from_clipboard/
  161. openscreen_platform/
  162. optimization_guide/
  163. os_crypt/
  164. ownership/
  165. page_image_annotation/
  166. page_info/
  167. page_info_strings_grdp/
  168. page_load_metrics/
  169. paint_preview/
  170. password_manager/
  171. password_manager_strings_grdp/
  172. payments/
  173. payments_strings_grdp/
  174. pdf/
  175. pdf_strings_grdp/
  176. performance_manager/
  177. permissions/
  178. permissions_strings_grdp/
  179. plugins/
  180. policy/
  181. policy_strings_grdp/
  182. power_scheduler/
  183. pref_registry/
  184. prefs/
  185. previous_session_info/
  186. printing/
  187. printing_component_strings_grdp/
  188. privacy_sandbox/
  189. privacy_sandbox_strings_grdp/
  190. profile_metrics/
  191. proxy_config/
  192. pwg_encoder/
  193. qr_code_generator/
  194. query_parser/
  195. query_tiles/
  196. quirks/
  197. reading_list/
  198. remote_cocoa/
  199. renderer_context_menu/
  200. reporting/
  201. reputation/
  202. reset_password_strings_grdp/
  203. resources/
  204. rlz/
  205. safe_browsing/
  206. safe_search_api/
  207. safety_check/
  208. scheduling_metrics/
  209. schema_org/
  210. search/
  211. search_engines/
  212. search_provider_logos/
  213. security_interstitials/
  214. security_interstitials_strings_grdp/
  215. security_state/
  216. security_state_strings_grdp/
  217. segmentation_platform/
  218. send_tab_to_self/
  219. send_tab_to_self_strings_grdp/
  220. services/
  221. session_manager/
  222. sessions/
  223. shared_highlighting/
  224. signin/
  225. site_engagement/
  226. site_isolation/
  227. sms_strings_grdp/
  228. soda/
  229. soda_strings_grdp/
  230. speech/
  231. spellcheck/
  232. sqlite_proto/
  233. ssl_errors/
  234. ssl_errors_strings_grdp/
  235. startup_metric_utils/
  236. storage_monitor/
  237. strictmode/
  238. strings/
  239. subresource_filter/
  240. subresource_redirect/
  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, //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.

How does this differ from //base/util?

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