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

Issue 628763002: Mojo JS bindings: simplify mojo.connectToService() usage - Part 1 (Closed)

Created:
6 years, 2 months ago by hansmuller
Modified:
6 years, 2 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, jam, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, arv+watch_chromium.org, chromium-apps-reviews_chromium.org, darin (slow to review), ben+mojo_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

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}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Refactored scoped enums and constants, moved interface def #

Total comments: 1

Patch Set 3 : Moved interface scoped const and enum template defs #

Total comments: 1

Patch Set 4 : Fixed template indentation #

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

Messages

Total messages: 21 (7 generated)
hansmuller
This is logically a pretty small change however the blast area is big enough that ...
6 years, 2 months ago (2014-10-03 22:16:30 UTC) #2
Matt Perry
Awesome, so glad you're cleaning this up. https://codereview.chromium.org/628763002/diff/1/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl File mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl (right): https://codereview.chromium.org/628763002/diff/1/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl#newcode162 mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl:162: {#--- Enums ...
6 years, 2 months ago (2014-10-03 22:57:49 UTC) #4
hansmuller
I've made the the changes you suggested. I added a small struct test for scoped ...
6 years, 2 months ago (2014-10-06 19:05:19 UTC) #5
hansmuller
On 2014/10/06 19:05:19, hansmuller wrote: > I've made the the changes you suggested. I added ...
6 years, 2 months ago (2014-10-06 19:09:07 UTC) #6
Matt Perry
https://codereview.chromium.org/628763002/diff/20001/mojo/public/tools/bindings/generators/js_templates/module.js.tmpl File mojo/public/tools/bindings/generators/js_templates/module.js.tmpl (right): https://codereview.chromium.org/628763002/diff/20001/mojo/public/tools/bindings/generators/js_templates/module.js.tmpl#newcode50 mojo/public/tools/bindings/generators/js_templates/module.js.tmpl:50: {#--- Interface Enums #} I think these enum and ...
6 years, 2 months ago (2014-10-06 19:13:27 UTC) #7
hansmuller
I believe everything is in order now. PTAL.
6 years, 2 months ago (2014-10-06 19:32:58 UTC) #8
Matt Perry
LGTM https://codereview.chromium.org/628763002/diff/40001/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl File mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl (right): https://codereview.chromium.org/628763002/diff/40001/mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl#newcode160 mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl:160: {%- if interface|has_callbacks %} nit: this and other ...
6 years, 2 months ago (2014-10-06 19:35:41 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/628763002/60001
6 years, 2 months ago (2014-10-06 19:46:08 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/15760)
6 years, 2 months ago (2014-10-06 20:10:58 UTC) #13
sky
ui and chrome LGTM
6 years, 2 months ago (2014-10-06 22:58:55 UTC) #15
Ken Rockot(use gerrit already)
extensions/renderer lgtm
6 years, 2 months ago (2014-10-07 15:57:56 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/628763002/60001
6 years, 2 months ago (2014-10-07 16:01:22 UTC) #19
commit-bot: I haz the power
Committed patchset #4 (id:60001) as 7a30f2d702d76fa2521f835d6259c92a1766a8a9
6 years, 2 months ago (2014-10-07 17:04:02 UTC) #20
commit-bot: I haz the power
6 years, 2 months ago (2014-10-07 17:04:51 UTC) #21
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/39b01de0b16d731ce3fe33d0f7f5a0973d98729f
Cr-Commit-Position: refs/heads/master@{#298509}

Powered by Google App Engine
This is Rietveld 408576698