DescriptionMojo: add javascript bindings for request/response
If a mojom interface method specifies response parameters, then we'll generate javascript bindings that provide an additional callback parameter used to pass the response parameters. This mirrors the C++ implementation.
A future improvement will likely be to use promises instead, especially now that they are enabled on trunk.
As part of this CL, connector.js was also made consistent with connector.cc. It starts reading the message pipe immediately, handles write failures in a similar fashion, etc.
The Connection type from connector.js is factored out into a separate file as it now holds a Router object. router.js mirrors router.cc. The Connection type is really the mirror of the C++ RemotePtr<S> type.
Some basic request/response tests were added to connection_unittests.js. We'll probably want more testing.
R=abarth@chromium.org, mpcomplete@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=259932
Patch Set 1 #Patch Set 2 : add missing files #Patch Set 3 : bring connector.js up to par with connector.cc #Patch Set 4 : more generated code #Patch Set 5 : with tests (and bug fixes) #Patch Set 6 : --similarity=20 #
Total comments: 2
Patch Set 7 : fix style #
Total comments: 8
Patch Set 8 : fix per review feedback #Patch Set 9 : --similarity=15 #Messages
Total messages: 22 (0 generated)
|