|
[Extensions] Add extension feature generation code
Extension features files are json files that contain information about
which APIs or extension features can be used in which contexts.
Currently, these files are parsed at runtime during both browser
startup and renderer process startup, causing a significant delay.
This patch implements the bulk of the functionality to move towards
generating feature files rather than parsing them from the json, which
should hopefully result in a significant speed improvement.
This introduces the feature_compiler.py, which generates the .h and .cc
files for a given set of features.json files, as well as the build rules
to invoke it automatically and tests for it. This does not add generated
files to the production build of chrome yet.
Sample api_feature_provider.h and .cc:
https://gist.github.com/anonymous/9bb094a90810b6050556761c87c204ac
BUG= 280286
Committed: https://crrev.com/88155eb86d2b8b8493eb80d09feb639d34dfdcc4
Cr-Commit-Position: refs/heads/master@{#406575}
Total comments: 13
Total comments: 21
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+1227 lines, -134 lines) |
Patch |
 |
M |
chrome/chrome_tests_unit.gypi
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
chrome/common/extensions/api/common_extension_api_unittest.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/test/BUILD.gn
|
View
|
1
2
3
4
5
6
7
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
extensions/common/features/api_feature.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
extensions/common/features/base_feature_provider_unittest.cc
|
View
|
1
2
3
4
5
|
2 chunks |
+13 lines, -15 lines |
0 comments
|
Download
|
 |
M |
extensions/common/features/complex_feature.h
|
View
|
|
2 chunks |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
extensions/common/features/manifest_feature.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
extensions/common/features/permission_feature.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
extensions/common/features/simple_feature.h
|
View
|
1
2
3
4
5
6
|
5 chunks |
+56 lines, -26 lines |
0 comments
|
Download
|
 |
M |
extensions/common/features/simple_feature.cc
|
View
|
1
2
3
4
5
6
|
4 chunks |
+9 lines, -3 lines |
0 comments
|
Download
|
 |
M |
extensions/common/features/simple_feature_unittest.cc
|
View
|
1
2
3
4
5
6
|
21 chunks |
+70 lines, -79 lines |
0 comments
|
Download
|
 |
A |
tools/json_schema_compiler/feature_compiler.py
|
View
|
1
2
3
4
5
6
|
1 chunk |
+536 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/json_schema_compiler/feature_compiler_test.py
|
View
|
1
|
1 chunk |
+81 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/json_schema_compiler/json_features.gni
|
View
|
1
2
3
4
|
1 chunk |
+53 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/json_schema_compiler/json_features.gypi
|
View
|
1
2
3
|
1 chunk |
+63 lines, -0 lines |
0 comments
|
Download
|
 |
M |
tools/json_schema_compiler/test/BUILD.gn
|
View
|
1
2
3
4
5
6
7
8
|
3 chunks |
+23 lines, -1 line |
0 comments
|
Download
|
 |
A |
tools/json_schema_compiler/test/DEPS
|
View
|
1
2
|
1 chunk |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/json_schema_compiler/test/features_generation_unittest.cc
|
View
|
1
|
1 chunk |
+226 lines, -0 lines |
0 comments
|
Download
|
 |
A |
tools/json_schema_compiler/test/features_test.json
|
View
|
|
1 chunk |
+56 lines, -0 lines |
0 comments
|
Download
|
 |
A + |
tools/json_schema_compiler/test/features_test2.json
|
View
|
|
1 chunk |
+6 lines, -1 line |
0 comments
|
Download
|
 |
M |
tools/json_schema_compiler/test/json_schema_compiler_tests.gyp
|
View
|
1
2
3
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
Total messages: 56 (34 generated)
|