[go: nahoru, domu]

tree: 3c79882b154a7ef052637537bbd048680ce96958 [path history] [tgz]
  1. about_handler/
  2. about_ui/
  3. account_id/
  4. apdu/
  5. app_modal/
  6. app_modal_strings_grdp/
  7. arc/
  8. assist_ranker/
  9. autofill/
  10. autofill_assistant/
  11. autofill_payments_strings_grdp/
  12. autofill_strings_grdp/
  13. background_task_scheduler/
  14. base32/
  15. blacklist/
  16. bookmark_bar_strings_grdp/
  17. bookmarks/
  18. browser_sync/
  19. browser_watcher/
  20. browsing_data/
  21. browsing_data_strings_grdp/
  22. bubble/
  23. captive_portal/
  24. cast_certificate/
  25. cast_channel/
  26. cbor/
  27. cdm/
  28. certificate_matching/
  29. certificate_transparency/
  30. chrome_cleaner/
  31. chromeos_camera/
  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. error_page/
  60. error_page_strings_grdp/
  61. exo/
  62. favicon/
  63. favicon_base/
  64. feature_engagement/
  65. feed/
  66. feedback/
  67. filename_generation/
  68. flags_ui/
  69. gcm_driver/
  70. google/
  71. grpc_support/
  72. guest_view/
  73. gwp_asan/
  74. handoff/
  75. heap_profiling/
  76. history/
  77. image_fetcher/
  78. infobars/
  79. invalidation/
  80. journey/
  81. keep_alive_registry/
  82. keyed_service/
  83. language/
  84. language_usage_metrics/
  85. leveldb_proto/
  86. link_header_util/
  87. location/
  88. login/
  89. media_message_center/
  90. metrics/
  91. metrics_services_manager/
  92. minidump_uploader/
  93. mirroring/
  94. module_installer/
  95. nacl/
  96. navigation_interception/
  97. navigation_metrics/
  98. net_log/
  99. neterror/
  100. network_hints/
  101. network_session_configurator/
  102. network_time/
  103. ntp_snippets/
  104. ntp_snippets_strings_grdp/
  105. ntp_tiles/
  106. offline_items_collection/
  107. offline_pages/
  108. omnibox/
  109. omnibox_strings_grdp/
  110. onc/
  111. open_from_clipboard/
  112. optimization_guide/
  113. os_crypt/
  114. ownership/
  115. page_image_annotation/
  116. page_info_strings_grdp/
  117. password_manager/
  118. payments/
  119. payments_strings_grdp/
  120. pdf/
  121. pdf_strings_grdp/
  122. plugins/
  123. policy/
  124. policy_strings_grdp/
  125. pref_registry/
  126. prefs/
  127. previews/
  128. printing/
  129. printing_component_strings_grdp/
  130. profile_metrics/
  131. proxy_config/
  132. pwg_encoder/
  133. query_parser/
  134. quirks/
  135. rappor/
  136. reading_list/
  137. remote_cocoa/
  138. renderer_context_menu/
  139. reset_password_strings_grdp/
  140. resources/
  141. rlz/
  142. safe_browsing/
  143. safe_search_api/
  144. scheduling_metrics/
  145. search/
  146. search_engines/
  147. search_provider_logos/
  148. security_interstitials/
  149. security_interstitials_strings_grdp/
  150. security_state/
  151. security_state_strings_grdp/
  152. send_tab_to_self/
  153. services/
  154. session_manager/
  155. sessions/
  156. signin/
  157. spellcheck/
  158. ssl_errors/
  159. ssl_errors_strings_grdp/
  160. startup_metric_utils/
  161. storage_monitor/
  162. strings/
  163. subresource_filter/
  164. suggestions/
  165. supervised_user_error_page/
  166. supervised_user_error_page_strings_grdp/
  167. sync/
  168. sync_bookmarks/
  169. sync_device_info/
  170. sync_preferences/
  171. sync_sessions/
  172. sync_ui_strings_grdp/
  173. sync_user_events/
  174. tab_count_metrics/
  175. test/
  176. timers/
  177. tracing/
  178. translate/
  179. translate_strings_grdp/
  180. ui_devtools/
  181. ui_metrics/
  182. ukm/
  183. undo/
  184. undo_strings_grdp/
  185. unified_consent/
  186. update_client/
  187. upload_list/
  188. url_formatter/
  189. url_matcher/
  190. url_pattern_index/
  191. user_actions_ui/
  192. user_manager/
  193. user_prefs/
  194. variations/
  195. vector_icons/
  196. version_info/
  197. version_ui/
  198. version_ui_strings_grdp/
  199. visitedlink/
  200. viz/
  201. web_cache/
  202. web_modal/
  203. web_resource/
  204. webcrypto/
  205. webdata/
  206. webdata_services/
  207. webrtc_logging/
  208. wifi/
  209. zoom/
  210. zucchini/
  211. app_modal_strings.grdp
  212. autofill_assistant_strings.grdp
  213. autofill_payments_strings.grdp
  214. autofill_strings.grdp
  215. bookmark_bar_strings.grdp
  216. bookmark_component_strings.grdp
  217. browsing_data_strings.grdp
  218. BUILD.gn
  219. components_chromium_strings.grd
  220. components_google_chrome_strings.grd
  221. components_locale_settings.grd
  222. components_settings_strings.grdp
  223. components_strings.grd
  224. crash_strings.grdp
  225. DEPS
  226. dialog_strings.grdp
  227. dom_distiller_strings.grdp
  228. error_page_strings.grdp
  229. find_in_page_strings.grdp
  230. history_strings.grdp
  231. login_dialog_strings.grdp
  232. management_strings.grdp
  233. media_message_center_strings.grdp
  234. new_or_sad_tab_strings.grdp
  235. ntp_snippets_strings.grdp
  236. ntp_tiles_strings.grdp
  237. omnibox_strings.grdp
  238. OWNERS
  239. page_info_strings.grdp
  240. password_manager_strings.grdp
  241. payments_strings.grdp
  242. pdf_strings.grdp
  243. policy_strings.grdp
  244. print_media_strings.grdp
  245. printing_component_strings.grdp
  246. README.md
  247. reset_password_strings.grdp
  248. safe_browsing_strings.grdp
  249. security_interstitials_strings.grdp
  250. security_state_strings.grdp
  251. ssl_errors_strings.grdp
  252. supervised_user_error_page_strings.grdp
  253. sync_ui_strings.grdp
  254. translate_strings.grdp
  255. typemaps.gni
  256. undo_strings.grdp
  257. 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.