tree: eb6aec21679e734c2b060bdb711a8fec0938d5c3 [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. data_reduction_proxy/
  72. database_utils/
  73. dbus/
  74. desks_storage/
  75. device_event_log/
  76. device_reauth/
  77. digital_asset_links/
  78. discardable_memory/
  79. dom_distiller/
  80. dom_distiller_strings_grdp/
  81. domain_reliability/
  82. download/
  83. drive/
  84. embedder_support/
  85. encrypted_messages/
  86. enterprise/
  87. enterprise_strings_grdp/
  88. error_page/
  89. error_page_strings_grdp/
  90. exo/
  91. external_intents/
  92. externalauth/
  93. favicon/
  94. favicon_base/
  95. feature_engagement/
  96. feed/
  97. feedback/
  98. filename_generation/
  99. find_in_page/
  100. flags_strings_grdp/
  101. flags_ui/
  102. fullscreen_control/
  103. fullscreen_control_strings_grdp/
  104. gcm_driver/
  105. global_media_controls/
  106. global_media_controls_strings_grdp/
  107. google/
  108. grpc_support/
  109. guest_os/
  110. guest_view/
  111. gwp_asan/
  112. handoff/
  113. heap_profiling/
  114. heavy_ad_intervention/
  115. heavy_ad_intervention_strings_grdp/
  116. history/
  117. history_clusters/
  118. history_clusters_strings_grdp/
  119. history_strings_grdp/
  120. image_fetcher/
  121. infobars/
  122. installedapp/
  123. invalidation/
  124. javascript_dialogs/
  125. javascript_dialogs_strings_grdp/
  126. js_injection/
  127. keep_alive_registry/
  128. keyed_service/
  129. language/
  130. lens/
  131. leveldb_proto/
  132. link_header_util/
  133. live_caption/
  134. live_caption_strings_grdp/
  135. location/
  136. login/
  137. lookalikes/
  138. management/
  139. management_ios_strings_grdp/
  140. management_strings_grdp/
  141. media_control/
  142. media_message_center/
  143. media_message_center_strings_grdp/
  144. media_router/
  145. memory_pressure/
  146. messages/
  147. metal_util/
  148. metrics/
  149. metrics_services_manager/
  150. minidump_uploader/
  151. mirroring/
  152. ml/
  153. module_installer/
  154. nacl/
  155. navigation_interception/
  156. navigation_metrics/
  157. net_log/
  158. neterror/
  159. network_hints/
  160. network_session_configurator/
  161. network_time/
  162. new_or_sad_tab_strings_grdp/
  163. no_state_prefetch/
  164. ntp_snippets/
  165. ntp_snippets_strings_grdp/
  166. ntp_tiles/
  167. offline_items_collection/
  168. offline_pages/
  169. omnibox/
  170. omnibox_pedal_ui_strings_grdp/
  171. omnibox_strings_grdp/
  172. on_load_script_injector/
  173. onc/
  174. open_from_clipboard/
  175. openscreen_platform/
  176. optimization_guide/
  177. os_crypt/
  178. ownership/
  179. page_image_annotation/
  180. page_info/
  181. page_info_strings_grdp/
  182. page_load_metrics/
  183. paint_preview/
  184. password_manager/
  185. password_manager_strings_grdp/
  186. payments/
  187. payments_strings_grdp/
  188. pdf/
  189. pdf_strings_grdp/
  190. performance_manager/
  191. permissions/
  192. permissions_strings_grdp/
  193. plugins/
  194. policy/
  195. policy_strings_grdp/
  196. power_metrics/
  197. power_scheduler/
  198. pref_registry/
  199. prefs/
  200. previous_session_info/
  201. printing/
  202. printing_component_strings_grdp/
  203. privacy_sandbox/
  204. privacy_sandbox_strings_grdp/
  205. profile_metrics/
  206. proxy_config/
  207. pwg_encoder/
  208. qr_code_generator/
  209. query_parser/
  210. query_tiles/
  211. quirks/
  212. reading_list/
  213. remote_cocoa/
  214. renderer_context_menu/
  215. reporting/
  216. reputation/
  217. reset_password_strings_grdp/
  218. resources/
  219. rlz/
  220. safe_browsing/
  221. safe_search_api/
  222. safety_check/
  223. scheduling_metrics/
  224. schema_org/
  225. search/
  226. search_engines/
  227. search_provider_logos/
  228. security_interstitials/
  229. security_interstitials_strings_grdp/
  230. security_state/
  231. segmentation_platform/
  232. send_tab_to_self/
  233. send_tab_to_self_strings_grdp/
  234. services/
  235. session_manager/
  236. sessions/
  237. shared_highlighting/
  238. signin/
  239. site_engagement/
  240. site_isolation/
  241. site_settings_strings_grdp/
  242. sms_strings_grdp/
  243. soda/
  244. soda_strings_grdp/
  245. speech/
  246. spellcheck/
  247. sqlite_proto/
  248. ssl_errors/
  249. ssl_errors_strings_grdp/
  250. startup_metric_utils/
  251. storage_monitor/
  252. strictmode/
  253. strings/
  254. subresource_filter/
  255. subresource_filter_strings_grdp/
  256. sync/
  257. sync_bookmarks/
  258. sync_device_info/
  259. sync_preferences/
  260. sync_sessions/
  261. sync_ui_strings_grdp/
  262. sync_user_events/
  263. system_media_controls/
  264. tab_count_metrics/
  265. tab_groups/
  266. tab_groups_strings_grdp/
  267. test/
  268. thin_webview/
  269. tracing/
  270. translate/
  271. translate_strings_grdp/
  272. ui_devtools/
  273. ui_metrics/
  274. ukm/
  275. undo/
  276. undo_strings_grdp/
  277. unified_consent/
  278. update_client/
  279. upload_list/
  280. url_formatter/
  281. url_matcher/
  282. url_pattern_index/
  283. url_rewrite/
  284. user_actions_ui/
  285. user_manager/
  286. user_notes/
  287. user_prefs/
  288. value_store/
  289. variations/
  290. vector_icons/
  291. version_info/
  292. version_ui/
  293. version_ui_strings_grdp/
  294. visitedlink/
  295. viz/
  296. web_app_resources/
  297. web_cache/
  298. web_modal/
  299. web_package/
  300. web_resource/
  301. webapk/
  302. webapps/
  303. webauthn/
  304. webcrypto/
  305. webdata/
  306. webdata_services/
  307. webrtc/
  308. webrtc_logging/
  309. webxr/
  310. webxr_strings_grdp/
  311. wifi/
  312. winhttp/
  313. zoom/
  314. zucchini/
  315. .eslintrc.js
  316. android_system_error_page_strings.grdp
  317. arc_strings.grdp
  318. autofill_assistant_strings.grdp
  319. autofill_payments_strings.grdp
  320. autofill_strings.grdp
  321. blocked_content_strings.grdp
  322. bookmark_bar_strings.grdp
  323. bookmark_component_strings.grdp
  324. browsing_data_strings.grdp
  325. BUILD.gn
  326. commerce_strings.grdp
  327. components_chromium_strings.grd
  328. components_google_chrome_strings.grd
  329. components_locale_settings.grd
  330. components_settings_strings.grdp
  331. components_strings.grd
  332. content_creation_strings.grdp
  333. crash_strings.grdp
  334. DEPS
  335. dialog_strings.grdp
  336. dom_distiller_strings.grdp
  337. enterprise_strings.grdp
  338. error_page_strings.grdp
  339. find_in_page_strings.grdp
  340. flags_strings.grdp
  341. fullscreen_control_strings.grdp
  342. global_media_controls_strings.grdp
  343. heavy_ad_intervention_strings.grdp
  344. history_clusters_strings.grdp
  345. history_strings.grdp
  346. javascript_dialogs_strings.grdp
  347. live_caption_strings.grdp
  348. login_dialog_strings.grdp
  349. management_ios_strings.grdp
  350. management_strings.grdp
  351. media_message_center_strings.grdp
  352. new_or_sad_tab_strings.grdp
  353. ntp_snippets_strings.grdp
  354. omnibox_pedal_ui_strings.grdp
  355. omnibox_strings.grdp
  356. OWNERS
  357. page_info_strings.grdp
  358. paint_preview_strings.grdp
  359. password_manager_strings.grdp
  360. payments_strings.grdp
  361. pdf_strings.grdp
  362. permissions_strings.grdp
  363. policy_strings.grdp
  364. PRESUBMIT.py
  365. print_media_strings.grdp
  366. printing_component_strings.grdp
  367. privacy_sandbox_strings.grdp
  368. protocol_handler_strings.grdp
  369. README.md
  370. reset_password_strings.grdp
  371. security_interstitials_strings.grdp
  372. send_tab_to_self_strings.grdp
  373. site_settings_strings.grdp
  374. sms_strings.grdp
  375. soda_strings.grdp
  376. ssl_errors_strings.grdp
  377. subresource_filter_strings.grdp
  378. sync_ui_strings.grdp
  379. tab_groups_strings.grdp
  380. translate_strings.grdp
  381. undo_strings.grdp
  382. version_ui_strings.grdp
  383. webapps_strings.grdp
  384. 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.