Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 This file describes steps and files needed when adding a new API to Chrome. | |
| 2 Before you start coding your new API, though, make sure you follow the process | |
| 3 described at: | |
| 4 http://www.chromium.org/developers/design-documents/extensions/proposed-change s/apis-under-development | |
| 5 | |
| 6 This describes the new mechanism for defining API using IDL files. Some old APIs | |
| 7 are still described using a JSON format. Don't rely on these. For inspiration, | |
| 8 you can look at the "alarms" API. | |
| 9 | |
| 10 Supposing your API is called "Foo" and is currently experimental, here are the | |
| 11 steps to add it: | |
| 12 | |
| 13 1) Write your API specification. | |
|
Aaron Boodman
2012/05/15 00:07:43
We shouldn't recommend that people use IDL, becaus
beaudoin
2012/05/16 16:56:16
Done.
| |
| 14 Create "chrome/common/extensions/api/experimental_foo.idl". This file should | |
| 15 contain your complete API description. Look at alarms.idl for inspiration. | |
| 16 | |
| 17 2) Add your API to the project | |
| 18 Add "experimental_foo.idl" to the "idl_schema_files" in | |
| 19 "chrome/common/extensions/api/api.gyp". | |
| 20 | |
| 21 3) Write the API function handlers. | |
| 22 Create foo_api.cc and foo_api.h under "chrome/browser/extensions/api/foo". | |
|
Aaron Boodman
2012/05/15 00:07:43
Can you add a statement recommending use of JSON S
beaudoin
2012/05/16 16:56:16
Done.
| |
| 23 | |
| 24 4) Write support classes for your API. | |
| 25 If your API needs any support classes add them to | |
| 26 "chrome/browser/extensions/api/foo". Some old APIs added their support classes | |
| 27 directly to chrome/browser/extensions. Don't do that. | |
|
Aaron Boodman
2012/05/15 00:07:43
Insert a step about testing here?
| |
| 28 | |
| 29 5) Update the project with your new files. | |
| 30 The files you created in (3) and (4) should be added to | |
| 31 "chrome/chrome_browser_extensions.gypi". | |
| OLD | NEW |