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

Issue 921223002: Cpp bindings: Return false from Validator::Accept() on unrecognized message or invalid flags (Closed)

Created:
5 years, 10 months ago by rudominer
Modified:
5 years, 8 months ago
CC:
mojo-reviews_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org
Base URL:
https://github.com/domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Cpp bindings: Modifies template to return false from Validator::Accept() on unrecognized message or invalid flags. In RequestValidator::Accept() and ResponseValidatorAccept() we now check two additional things about the message header: (i) That the flags are correct (ii) That the method index is in range. BUG=455295 TEST=None R=hansmuller@google.com, yzshen@chromium.org, hansmuller@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/81563bfe14ea7ccff637e51df9d05ebf96e01365

Patch Set 1 #

Total comments: 2

Patch Set 2 : Adding ValidationTest case #

Patch Set 3 : Fix test #

Total comments: 6

Patch Set 4 : Renames enum, validates flags, skips javascript tests #

Patch Set 5 : Removes accidentally added file #

Patch Set 6 : Fixes spelling error. #

Total comments: 10

Patch Set 7 : Adds additional tests #

Patch Set 8 : Rebased. Fixes spelling of UNKOWN. #

Total comments: 2

Patch Set 9 : Fix comments in JS test. #

Total comments: 9

Patch Set 10 : Renamed validation test files. #

Patch Set 11 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -25 lines) Patch
M mojo/public/cpp/bindings/lib/validation_errors.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/lib/validation_errors.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/tests/validation_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -0 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_msghdr_invalid_flag_combo.data View 1 2 3 4 5 6 7 8 9 10 0 chunks +-1 lines, --1 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_msghdr_invalid_flag_combo.expected View 1 2 3 4 5 6 0 chunks +-1 lines, --1 lines 0 comments Download
D mojo/public/interfaces/bindings/tests/data/validation/conformance_msghdr_invalid_flags.data View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -6 lines 0 comments Download
D mojo/public/interfaces/bindings/tests/data/validation/conformance_msghdr_invalid_flags.expected View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validation/conformance_msghdr_no_such_method.data View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validation/conformance_msghdr_no_such_method.expected View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd0_invalid_request_flags.data View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd0_invalid_request_flags.expected View 1 2 3 4 5 6 7 8 9 0 chunks +-1 lines, --1 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd0_invalid_request_flags2.data View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -0 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd0_invalid_request_flags2.expected View 1 2 3 4 5 6 7 8 9 0 chunks +-1 lines, --1 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd12_invalid_request_flags.data View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -0 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd12_invalid_request_flags.expected View 1 2 3 4 5 6 7 8 9 0 chunks +-1 lines, --1 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/resp_conformance_msghdr_invalid_response_flags1.data View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/resp_conformance_msghdr_invalid_response_flags1.expected View 1 2 3 4 5 6 7 8 9 0 chunks +-1 lines, --1 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/resp_conformance_msghdr_invalid_response_flags2.data View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/resp_conformance_msghdr_invalid_response_flags2.expected View 1 2 3 4 5 6 7 8 9 0 chunks +-1 lines, --1 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/data/validation/resp_conformance_msghdr_no_such_method.data View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
A mojo/public/interfaces/bindings/tests/data/validation/resp_conformance_msghdr_no_such_method.expected View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M mojo/public/js/validation_unittests.js View 1 2 3 4 5 6 7 8 9 2 chunks +12 lines, -10 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl View 1 2 3 4 5 6 7 8 9 10 4 chunks +31 lines, -7 lines 0 comments Download

Messages

Total messages: 23 (2 generated)
rudominer
Would you like separate CLs for each language or a single one containing all languages? ...
5 years, 10 months ago (2015-02-13 17:38:15 UTC) #1
qsr
I think the validation tests might do what you want: mojo/public/cpp/bindings/tests/validation_unittest.cc
5 years, 10 months ago (2015-02-16 16:34:53 UTC) #2
yzshen1
On 2015/02/16 16:34:53, qsr wrote: > I think the validation tests might do what you ...
5 years, 10 months ago (2015-02-17 19:38:18 UTC) #3
yzshen1
https://codereview.chromium.org/921223002/diff/1/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl File mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl (right): https://codereview.chromium.org/921223002/diff/1/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl#newcode278 mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl:278: return false; You also need to do the same ...
5 years, 10 months ago (2015-02-17 19:39:35 UTC) #4
rudominer
On 2015/02/16 16:34:53, qsr wrote: > I think the validation tests might do what you ...
5 years, 10 months ago (2015-02-23 19:02:41 UTC) #5
yzshen1
https://codereview.chromium.org/921223002/diff/40001/mojo/public/cpp/bindings/lib/validation_errors.h File mojo/public/cpp/bindings/lib/validation_errors.h (right): https://codereview.chromium.org/921223002/diff/40001/mojo/public/cpp/bindings/lib/validation_errors.h#newcode52 mojo/public/cpp/bindings/lib/validation_errors.h:52: VALIDATION_ERROR_UNKOWN_METHOD Please add comments. https://codereview.chromium.org/921223002/diff/40001/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd11_nosuch.data File mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd11_nosuch.data (right): https://codereview.chromium.org/921223002/diff/40001/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd11_nosuch.data#newcode3 ...
5 years, 10 months ago (2015-02-23 19:08:02 UTC) #6
rudominer
PTAL. It looks like you have already reviewed the latest patch set before I was ...
5 years, 10 months ago (2015-02-23 19:12:23 UTC) #7
rudominer
ptal I know you are on paternity leave so take your time and if you ...
5 years, 9 months ago (2015-03-03 01:54:36 UTC) #8
viettrungluu
On 2015/03/03 01:54:36, rudominer wrote: > ptal > > I know you are on paternity ...
5 years, 9 months ago (2015-03-03 02:02:32 UTC) #9
rudominer
On 2015/03/03 02:02:32, viettrungluu wrote: > On 2015/03/03 01:54:36, rudominer wrote: > > ptal > ...
5 years, 9 months ago (2015-03-03 02:59:34 UTC) #10
yzshen1
https://codereview.chromium.org/921223002/diff/100001/mojo/public/cpp/bindings/lib/validation_errors.cc File mojo/public/cpp/bindings/lib/validation_errors.cc (right): https://codereview.chromium.org/921223002/diff/100001/mojo/public/cpp/bindings/lib/validation_errors.cc#newcode43 mojo/public/cpp/bindings/lib/validation_errors.cc:43: case VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD: Please use the exact same order as ...
5 years, 9 months ago (2015-03-03 18:05:37 UTC) #12
rudominer
ptal https://codereview.chromium.org/921223002/diff/100001/mojo/public/cpp/bindings/lib/validation_errors.cc File mojo/public/cpp/bindings/lib/validation_errors.cc (right): https://codereview.chromium.org/921223002/diff/100001/mojo/public/cpp/bindings/lib/validation_errors.cc#newcode43 mojo/public/cpp/bindings/lib/validation_errors.cc:43: case VALIDATION_ERROR_MESSAGE_HEADER_UNKNOWN_METHOD: On 2015/03/03 18:05:37, yzshen1 (OOO Mar ...
5 years, 9 months ago (2015-03-04 00:12:01 UTC) #13
hansmuller1
https://codereview.chromium.org/921223002/diff/140001/mojo/public/js/validation_unittests.js File mojo/public/js/validation_unittests.js (right): https://codereview.chromium.org/921223002/diff/140001/mojo/public/js/validation_unittests.js#newcode235 mojo/public/js/validation_unittests.js:235: testFiles[i].indexOf("invalid_request_flags") != -1) { The comment no longer covers ...
5 years, 9 months ago (2015-03-04 21:55:20 UTC) #15
rudominer
Hans I updated the comment in the js test. ptal. https://codereview.chromium.org/921223002/diff/140001/mojo/public/js/validation_unittests.js File mojo/public/js/validation_unittests.js (right): https://codereview.chromium.org/921223002/diff/140001/mojo/public/js/validation_unittests.js#newcode235 ...
5 years, 9 months ago (2015-03-04 23:05:48 UTC) #16
rudominer
Yuzhu and Hans, ping.
5 years, 9 months ago (2015-03-06 19:40:27 UTC) #17
hansmuller1
On 2015/03/04 23:05:48, rudominer wrote: > Hans I updated the comment in the js test. ...
5 years, 9 months ago (2015-03-06 20:20:44 UTC) #18
yzshen1
Sorry for the delay. I was sick for a few days. https://codereview.chromium.org/921223002/diff/160001/mojo/public/cpp/bindings/tests/validation_unittest.cc File mojo/public/cpp/bindings/tests/validation_unittest.cc (right): ...
5 years, 9 months ago (2015-03-13 22:55:03 UTC) #19
rudominer
ptal. I believe I addressed all the comments except for the discussion initiated by Trung ...
5 years, 9 months ago (2015-03-16 21:24:32 UTC) #20
yzshen1
LGTM Thanks!
5 years, 9 months ago (2015-03-23 17:21:30 UTC) #21
rudominer
On 2015/03/23 17:21:30, yzshen1 wrote: > LGTM > > Thanks! Thanks for the review. I ...
5 years, 8 months ago (2015-03-30 18:24:04 UTC) #22
rudominer
5 years, 8 months ago (2015-03-30 19:23:46 UTC) #23
Message was sent while issue was closed.
Committed patchset #11 (id:200001) manually as
81563bfe14ea7ccff637e51df9d05ebf96e01365 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698