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