|
Mojo JS bindings: simplify mojo.connectToService() usage - Part 1
This is an incremental step towards the goals listed in crbug.com/419160
The Mojo JS bindings now export an object for each interface. The object itemizes the interface values needed at runtime. Here's an example:
exports.Service = {
name: 'sample::Service',
proxyClass: ServiceProxy,
stubClass: ServiceStub,
validateRequest: validateServiceRequest,
validateResponse: null,
};
I've removed the individual exports of the proxy and stub class names as well as the interface "NAME_" property that was added to proxy and stub classes.
When possible, the object for an interface's client is added. For example:
exports.Service.client = exports.ServiceClient;
The next step (next patch) will automatically create a stub client object that delegates to a user supplied object.
BUG= 419160
Committed: https://crrev.com/39b01de0b16d731ce3fe33d0f7f5a0973d98729f
Cr-Commit-Position: refs/heads/master@{#298509}
Total comments: 4
Total comments: 1
Total comments: 1
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+139 lines, -74 lines) |
Patch |
|
M |
chrome/browser/resources/omnibox/omnibox.js
|
View
|
|
2 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
content/test/data/web_ui_mojo.js
|
View
|
|
2 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/resources/data_receiver.js
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/resources/data_sender.js
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
extensions/renderer/resources/serial_service.js
|
View
|
1
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
|
M |
extensions/test/data/data_receiver_unittest.js
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
extensions/test/data/data_sender_unittest.js
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
mojo/apps/js/bindings/connection_unittests.js
|
View
|
|
6 chunks |
+16 lines, -11 lines |
0 comments
|
Download
|
|
M |
mojo/apps/js/bindings/sample_service_unittests.js
|
View
|
1
|
3 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
mojo/apps/js/main.js
|
View
|
|
1 chunk |
+13 lines, -8 lines |
0 comments
|
Download
|
|
M |
mojo/apps/js/test/js_to_cpp_unittest.js
|
View
|
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
mojo/public/interfaces/bindings/tests/test_structs.mojom
|
View
|
1
|
1 chunk |
+26 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/js/bindings/connection.js
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/js/bindings/struct_unittests.js
|
View
|
1
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
|
M |
mojo/public/js/bindings/validation_unittests.js
|
View
|
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
mojo/public/tools/bindings/generators/js_templates/enum_definition.tmpl
|
View
|
1
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl
|
View
|
1
2
3
|
4 chunks |
+21 lines, -19 lines |
0 comments
|
Download
|
|
M |
mojo/public/tools/bindings/generators/js_templates/module.js.tmpl
|
View
|
1
2
|
2 chunks |
+7 lines, -3 lines |
0 comments
|
Download
|
|
M |
mojo/public/tools/bindings/generators/js_templates/struct_definition.tmpl
|
View
|
1
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
ui/keyboard/resources/keyboard_mojo.js
|
View
|
|
2 chunks |
+4 lines, -3 lines |
0 comments
|
Download
|
Total messages: 21 (7 generated)
|