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

Issue 2676443005: Add interface versioning. Methods queryVersion and requireVersion. (Closed)

Created:
3 years, 10 months ago by wangjimmy
Modified:
3 years, 10 months ago
CC:
Aaron Boodman, abarth-chromium, chromium-apps-reviews_chromium.org, chromium-reviews, darin (slow to review), darin-cc_chromium.org, Eugene But (OOO till 7-30), extensions-reviews_chromium.org, jam, mlamouri+watch-content_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add interface versioning for javascript. Methods queryVersion and requireVersion are added to InterfacePtrController. Support sending and handling control messages by creating control_message_proxy and control_message_handler. control_message_proxy uses promises as opposed to callbacks which is what our original cpp code does. BUG=684879 R=yzshen@chromium.org Review-Url: https://codereview.chromium.org/2676443005 Cr-Commit-Position: refs/heads/master@{#450488} Committed: https://chromium.googlesource.com/chromium/src/+/43ca78b29ea7366bbbc35e28a272fb145771181f

Patch Set 1 #

Total comments: 4

Patch Set 2 : Add control_message_handler and write tests. #

Patch Set 3 : Close the connection when requireVersion is higher than the interface version. Modify tests. Format… #

Patch Set 4 : Add interface_control_messages.mojom.js to build resources #

Total comments: 74

Patch Set 5 : Fix build issues. #

Patch Set 6 : Address codereview concerns. #

Patch Set 7 : Validate payload. #

Total comments: 12

Patch Set 8 : Expect the result inside the error handler for test. Code formatting and address codereview comment… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+438 lines, -32 lines) Patch
M content/BUILD.gn View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M content/content_resources.grd View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/mojo_context_state.cc View 1 2 3 4 5 6 7 1 chunk +13 lines, -8 lines 0 comments Download
M extensions/renderer/dispatcher.cc View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M ios/web/BUILD.gn View 1 2 3 4 5 1 chunk +7 lines, -0 lines 0 comments Download
M ios/web/ios_web_resources.grd View 1 2 3 4 5 1 chunk +9 lines, -6 lines 0 comments Download
M ios/web/webui/crw_web_ui_manager.mm View 1 2 3 4 5 6 7 1 chunk +9 lines, -4 lines 0 comments Download
M mojo/public/js/BUILD.gn View 1 2 3 4 5 3 chunks +10 lines, -3 lines 0 comments Download
M mojo/public/js/bindings.js View 1 2 3 4 5 6 7 4 chunks +27 lines, -5 lines 0 comments Download
M mojo/public/js/constants.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M mojo/public/js/constants.cc View 1 2 3 4 5 1 chunk +6 lines, -1 line 0 comments Download
A mojo/public/js/lib/control_message_handler.js View 1 2 3 4 5 6 1 chunk +111 lines, -0 lines 0 comments Download
A mojo/public/js/lib/control_message_proxy.js View 1 2 3 4 5 6 7 1 chunk +102 lines, -0 lines 0 comments Download
M mojo/public/js/router.js View 1 2 3 4 5 4 chunks +24 lines, -4 lines 0 comments Download
M mojo/public/js/tests/interface_ptr_unittest.js View 1 2 3 4 5 6 7 4 chunks +80 lines, -0 lines 0 comments Download
M mojo/public/js/validator.js View 1 5 6 7 1 chunk +21 lines, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/js_templates/interface_definition.tmpl View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M mojo/public/tools/bindings/generators/js_templates/module.amd.tmpl View 1 2 3 4 5 1 chunk +6 lines, -1 line 0 comments Download

Messages

Total messages: 53 (37 generated)
wangjimmy
https://codereview.chromium.org/2676443005/diff/1/mojo/public/js/lib/control_message_proxy.js File mojo/public/js/lib/control_message_proxy.js (right): https://codereview.chromium.org/2676443005/diff/1/mojo/public/js/lib/control_message_proxy.js#newcode59 mojo/public/js/lib/control_message_proxy.js:59: return receiver.acceptAndExpectResponse(message).then( Router.js 's acceptAndExpectResponse never resolves. Run mojo_js_unittests, ...
3 years, 10 months ago (2017-02-04 01:32:42 UTC) #1
yzshen1
https://codereview.chromium.org/2676443005/diff/1/mojo/public/js/tests/interface_ptr_unittest.js File mojo/public/js/tests/interface_ptr_unittest.js (right): https://codereview.chromium.org/2676443005/diff/1/mojo/public/js/tests/interface_ptr_unittest.js#newcode165 mojo/public/js/tests/interface_ptr_unittest.js:165: var integerAccessorImpl = new sampleInterfaces.IntegerAccessorPtr(); This is not an ...
3 years, 10 months ago (2017-02-06 06:57:26 UTC) #2
yzshen1
https://codereview.chromium.org/2676443005/diff/1/mojo/public/js/tests/interface_ptr_unittest.js File mojo/public/js/tests/interface_ptr_unittest.js (right): https://codereview.chromium.org/2676443005/diff/1/mojo/public/js/tests/interface_ptr_unittest.js#newcode165 mojo/public/js/tests/interface_ptr_unittest.js:165: var integerAccessorImpl = new sampleInterfaces.IntegerAccessorPtr(); On 2017/02/06 06:57:26, yzshen1 ...
3 years, 10 months ago (2017-02-06 07:04:19 UTC) #3
yzshen1
Sorry if I seem to be picky. :) It is normal that first few CLs ...
3 years, 10 months ago (2017-02-11 01:11:30 UTC) #17
wangjimmy
https://codereview.chromium.org/2676443005/diff/60001/content/content_resources.grd File content/content_resources.grd (right): https://codereview.chromium.org/2676443005/diff/60001/content/content_resources.grd#newcode60 content/content_resources.grd:60: <include name="IDR_MOJO_CONTROL_MESSAGE_PROXY_JS" file="../mojo/public/js/lib/control_message_proxy.js" flattenhtml="true" type="BINDATA" /> On 2017/02/11 01:11:28, ...
3 years, 10 months ago (2017-02-13 20:43:08 UTC) #26
yzshen1
https://codereview.chromium.org/2676443005/diff/120001/mojo/public/js/lib/control_message_handler.js File mojo/public/js/lib/control_message_handler.js (right): https://codereview.chromium.org/2676443005/diff/120001/mojo/public/js/lib/control_message_handler.js#newcode20 mojo/public/js/lib/control_message_handler.js:20: if (message.getName() != controlMessages.kRunMessageId) { By the way, I ...
3 years, 10 months ago (2017-02-13 23:44:23 UTC) #29
wangjimmy
https://codereview.chromium.org/2676443005/diff/120001/mojo/public/js/lib/control_message_handler.js File mojo/public/js/lib/control_message_handler.js (right): https://codereview.chromium.org/2676443005/diff/120001/mojo/public/js/lib/control_message_handler.js#newcode20 mojo/public/js/lib/control_message_handler.js:20: if (message.getName() != controlMessages.kRunMessageId) { On 2017/02/13 23:44:23, yzshen1 ...
3 years, 10 months ago (2017-02-14 00:06:06 UTC) #31
yzshen1
LGTM Please also add owners for files outside of mojo/ You could use "git cl ...
3 years, 10 months ago (2017-02-14 00:36:09 UTC) #33
wangjimmy
Hi Eugune, I saw you were the owner for ios/web. Would you mind reviewing my ...
3 years, 10 months ago (2017-02-14 01:02:45 UTC) #36
wangjimmy
Hi Ken, Could you review extensions/renderer/dispatcher.cc?
3 years, 10 months ago (2017-02-14 01:19:58 UTC) #38
wangjimmy
Hi John, do you mind reviewing: content/renderer/mojo_context_state.cc content/content_resources.grd content/BUILD.gn Thank you in advance.
3 years, 10 months ago (2017-02-14 01:26:49 UTC) #41
Eugene But (OOO till 7-30)
ios lgtm
3 years, 10 months ago (2017-02-14 01:30:26 UTC) #43
jam
lgtm
3 years, 10 months ago (2017-02-14 17:51:22 UTC) #46
Ken Rockot(use gerrit already)
lgtm
3 years, 10 months ago (2017-02-14 17:55:17 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2676443005/140001
3 years, 10 months ago (2017-02-14 22:00:35 UTC) #50
commit-bot: I haz the power
3 years, 10 months ago (2017-02-14 22:09:06 UTC) #53
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/43ca78b29ea7366bbbc35e28a272...

Powered by Google App Engine
This is Rietveld 408576698