blob: b20ca499c36fd419a62d303c1f14a7698a9cf8fa [file] [log] [blame]
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +00001This directory is for components that have the Content Module as the
2uppermost layer they depend on. They may depend only on the Content
3API (content/public) and on lower layers (e.g. base/, net/, ipc/
4etc.).
5
6Components that have bits of code that need to live in different
7processes (e.g. some code in the browser process, some in the renderer
8process, etc.) should separate the code into different subdirectories.
9Hence for a component named 'foo' you might end up with a structure
10like the following:
11
12components/foo - DEPS, OWNERS, foo.gypi
13components/foo/browser - code that needs the browser process
14components/foo/common - for e.g. IPC constants and such
15components/foo/renderer - code that needs renderer process
16
17These subdirectories should have DEPS files with the relevant
18restrictions in place, i.e. only components/*/browser should
19be allowed to #include from content/public/browser.
20
21Note that there may also be an 'android' subdir, with a Java source
22code structure underneath it where the package name is
23org.chromium.components.foo, and with subdirs after 'foo'
24to illustrate process, e.g. 'browser' or 'renderer':
25
26components/foo/android/OWNERS, DEPS
27components/foo/android/java/src/org/chromium/components/foo/browser/
28components/foo/android/javatests/src/org/chromium/components/foo/browser/
29
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +010030Code in a component should be placed in a namespace corresponding to
31the name of the component; e.g. for a component living in
32//components/foo, code in that component should be in the foo::
33namespace. Note that it used to be the rule that all code under
34//components should be in the components:: namespace; this is being
35phased out.