mojo::ReportBadMessageCallback is a base::Callback, but the documentation for GetBadMessageCallback() allows it to be called at most once. Change it to be a base::OnceCallback so the type system enforces this requirement.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/9658f84d9e68fc3d1c986d844172110238da6529 commit 9658f84d9e68fc3d1c986d844172110238da6529 Author: Austin Tankiang <austinct@google.com> Date: Tue Nov 28 04:35:58 2017 Change mojo::ReportBadMessageCallback to be a base::OnceCallback mojo::ReportBadMessageCallback is documented in mojo::GetBadMessageCallback() to only be allowed to be called at most once. Change it from the legacy base::Callback to be a base::OnceCallback to enforce this. Bug: 787653 Change-Id: I674c364bcbd523f31829f48754971e2d624f9348 Reviewed-on: https://chromium-review.googlesource.com/786592 Reviewed-by: Ken Rockot <rockot@chromium.org> Reviewed-by: Sam McNally <sammc@chromium.org> Reviewed-by: Noel Gordon <noel@chromium.org> Commit-Queue: Austin Tankiang <austinct@google.com> Cr-Commit-Position: refs/heads/master@{#519569} [modify] https://crrev.com/9658f84d9e68fc3d1c986d844172110238da6529/mojo/public/cpp/bindings/binding_set.h [modify] https://crrev.com/9658f84d9e68fc3d1c986d844172110238da6529/mojo/public/cpp/bindings/lib/binding_state.cc [modify] https://crrev.com/9658f84d9e68fc3d1c986d844172110238da6529/mojo/public/cpp/bindings/lib/message.cc [modify] https://crrev.com/9658f84d9e68fc3d1c986d844172110238da6529/mojo/public/cpp/bindings/lib/message_internal.h [modify] https://crrev.com/9658f84d9e68fc3d1c986d844172110238da6529/mojo/public/cpp/bindings/message.h [modify] https://crrev.com/9658f84d9e68fc3d1c986d844172110238da6529/mojo/public/cpp/bindings/tests/binding_set_unittest.cc [modify] https://crrev.com/9658f84d9e68fc3d1c986d844172110238da6529/mojo/public/cpp/bindings/tests/binding_unittest.cc [modify] https://crrev.com/9658f84d9e68fc3d1c986d844172110238da6529/mojo/public/cpp/bindings/tests/report_bad_message_unittest.cc
Comment 1 by austi...@google.com
, Nov 23 2017Status: Started (was: Available)