[go: nahoru, domu]

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