Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: components/README

Issue 2166093002: Clarify components/README about when to create a component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clarify comment Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 This directory is for features that are intended for reuse across multiple 1 This directory is for features that are intended for reuse. Example use cases:
2 embedders (e.g., Android WebView and Chrome). 2 -code that is shared by Chrome on iOS and other Chrome platforms (since the iOS
3 port doesn't use src/chrome)
4 -code that is shared between multiple embedders of content (e.g., Android
5 WebView and Chrome)
6 -code that is shared between Blink and the browser process (since code in the
7 browser doesn't use Blink, while Blink doesn't include content or chrome to
8 avoid circular dependencies)
9
10 In general, if some code is used by a directory "foo" and things above "foo" in
11 the dependency tree, the code should probably live in "foo".
3 12
4 By default, components can depend only on the lower layers of the Chromium 13 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 14 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 15 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 16 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 17 will have to be in the form of a layered component
9 (http://www.chromium.org/developers/design-documents/layered-components-design). 18 (http://www.chromium.org/developers/design-documents/layered-components-design).
10 19
11 Components that have bits of code that need to live in different 20 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 21 processes (e.g. some code in the browser process, some in the renderer
13 process, etc.) should separate the code into different subdirectories. 22 process, etc.) should separate the code into different subdirectories.
14 Hence for a component named 'foo' you might end up with a structure 23 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 24 like the following (assuming that foo is not used by iOS and thus does not
(...skipping 14 matching lines...) Expand all
30 to illustrate process, e.g. 'browser' or 'renderer': 39 to illustrate process, e.g. 'browser' or 'renderer':
31 40
32 components/foo/android/OWNERS, DEPS 41 components/foo/android/OWNERS, DEPS
33 components/foo/android/java/src/org/chromium/components/foo/browser/ 42 components/foo/android/java/src/org/chromium/components/foo/browser/
34 components/foo/android/javatests/src/org/chromium/components/foo/browser/ 43 components/foo/android/javatests/src/org/chromium/components/foo/browser/
35 44
36 Code in a component should be placed in a namespace corresponding to 45 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 46 the name of the component; e.g. for a component living in
38 //components/foo, code in that component should be in the foo:: 47 //components/foo, code in that component should be in the foo::
39 namespace. 48 namespace.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698