• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1This directory is for features that are intended for reuse across multiple
2embedders (e.g., Android WebView and Chrome).
3
4By default, components can depend only on the lower layers of the Chromium
5codebase(e.g. base/, net/, etc.). Individual components may additionally allow
6dependencies on the content API and IPC; however, if such a component is used
7by Chrome for iOS (which does not use the content API or IPC), the component
8will have to be in the form of a layered component
9(http://www.chromium.org/developers/design-documents/layered-components-design).
10
11Components that have bits of code that need to live in different
12processes (e.g. some code in the browser process, some in the renderer
13process, etc.) should separate the code into different subdirectories.
14Hence for a component named 'foo' you might end up with a structure
15like the following (assuming that foo is not used by iOS and thus does not
16need to be a layered component):
17
18components/foo          - DEPS, OWNERS, foo.gypi
19components/foo/browser  - code that needs the browser process
20components/foo/common   - for e.g. IPC constants and such
21components/foo/renderer - code that needs renderer process
22
23These subdirectories should have DEPS files with the relevant
24restrictions in place, i.e. only components/*/browser should
25be allowed to #include from content/public/browser.
26
27Note that there may also be an 'android' subdir, with a Java source
28code structure underneath it where the package name is
29org.chromium.components.foo, and with subdirs after 'foo'
30to illustrate process, e.g. 'browser' or 'renderer':
31
32components/foo/android/OWNERS, DEPS
33components/foo/android/java/src/org/chromium/components/foo/browser/
34components/foo/android/javatests/src/org/chromium/components/foo/browser/
35
36Code in a component should be placed in a namespace corresponding to
37the name of the component; e.g. for a component living in
38//components/foo, code in that component should be in the foo::
39namespace.
40