[go: nahoru, domu]

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

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

Note that the above list is meant to be exhaustive. A component should not be added just to separate it from other code in the same layer that is the only consumer; that can be done with strict DEPS or GN visibility rules.

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.).
  • The CL adding a new component should be substantial enough so that //components/OWNERS can see its basic intended structure and usage before approving the addition (e.g., it should not just be an empty shell).

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 - BUILD.gn, DEPS, DIR_METADATA, OWNERS, README.md
  • 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.