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