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