blob: 720132029681b18ce174082451f935882d60f5c6 [file] [log] [blame]
[email protected]f5321782014-03-11 11:47:171This directory is for features that are intended for reuse across multiple
2embedders (e.g., Android WebView and Chrome).
3
4By default, subdirectories have the Content Module as the uppermost layer they
5depend on, i.e., they may depend only on the Content API (content/public) and
6on lower layers (e.g. base/, net/, ipc/ etc.). Individual subdirectories may
7further restrict their dependencies, e.g., a component that is used by Chrome
8for iOS (which does not use the content API) will either disallow usage of
9content/public or be in the form of a layered component
10(http://www.chromium.org/developers/design-documents/layered-components-design).
[email protected]5ec3ed82012-12-27 11:44:0011
12Components that have bits of code that need to live in different
13processes (e.g. some code in the browser process, some in the renderer
14process, etc.) should separate the code into different subdirectories.
15Hence for a component named 'foo' you might end up with a structure
16like the following:
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
[email protected]a70edd22013-04-09 09:23:0436Code 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. Note that it used to be the rule that all code under
40//components should be in the components:: namespace; this is being
41phased out.