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

Issue 1003773002: CPP bindings: DCHECK when a Callback is destructed without being invoked (Closed)

Created:
5 years, 9 months ago by rudominer
Modified:
5 years, 8 months ago
Reviewers:
jamesr, sky
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

DCHECK when the Runnable associated with a Callback is destructed without being invoked, unless a connection error occurred or the pipe was manually closed first. BUG=455298 R=jamesr@chromium.org, sky@chromium.org, jamesr, sky Committed: https://chromium.googlesource.com/external/mojo/+/5f59634fbe6d12a5e31b385281525d6a9aa4e624

Patch Set 1 #

Total comments: 4

Patch Set 2 : Adds close() notification to Stub when Binding is closed or deleted. #

Total comments: 1

Patch Set 3 : Starts using SharedData<Stub*> and adds a test. #

Patch Set 4 : Fixed BUILD.gn file. #

Total comments: 14

Patch Set 5 : Responded to comments. Changed "test" to "unittest". #

Total comments: 2

Patch Set 6 : Introduces MessageReceiverWithStatus and MessageReceiverWithResponderStatus. #

Total comments: 2

Patch Set 7 : Rebased #

Patch Set 8 : Removes unneeded includes. #

Patch Set 9 : rebased again #

Unified diffs Side-by-side diffs Delta from patch set Stats (+371 lines, -25 lines) Patch
M mojo/public/cpp/bindings/lib/connector.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/lib/router.h View 1 2 3 4 5 3 chunks +5 lines, -2 lines 0 comments Download
M mojo/public/cpp/bindings/lib/router.cc View 1 2 3 4 5 3 chunks +8 lines, -2 lines 0 comments Download
M mojo/public/cpp/bindings/message.h View 1 2 3 4 5 1 chunk +33 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/tests/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
A mojo/public/cpp/bindings/tests/binding_callback_unittest.cc View 1 2 3 4 5 1 chunk +288 lines, -0 lines 0 comments Download
M mojo/public/cpp/bindings/tests/router_unittest.cc View 1 2 3 4 5 7 chunks +10 lines, -4 lines 0 comments Download
M mojo/public/interfaces/bindings/tests/BUILD.gn View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A + mojo/public/interfaces/bindings/tests/binding_callback_test_interfaces.mojom View 1 2 1 chunk +4 lines, -5 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl View 1 2 3 4 5 6 7 3 chunks +14 lines, -10 lines 0 comments Download
M mojo/public/tools/bindings/generators/cpp_templates/interface_stub_declaration.tmpl View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M services/view_manager/view_manager_service_apptest.cc View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 25 (2 generated)
rudominer
This is for discussion only--not ready to be submitted. This is a follow-up to cl ...
5 years, 9 months ago (2015-03-12 16:38:39 UTC) #2
jamesr
On 2015/03/12 16:38:39, rudominer wrote: > Consider the last stack trace here > https://build.chromium.org/p/tryserver.client.mojo/builders/Mojo%20Linux%20NaCl%20(dbg)%20Try/builds/689/steps/App%20tests/logs/stdio > ...
5 years, 9 months ago (2015-03-12 18:18:37 UTC) #3
jamesr
https://codereview.chromium.org/1003773002/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/1003773002/diff/1/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl#newcode119 mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl:119: if (owning_stub_ && !owning_stub_->connection_error_occurred()) { On 2015/03/12 16:38:39, rudominer ...
5 years, 9 months ago (2015-03-12 18:20:04 UTC) #4
rudominer
On 2015/03/12 18:18:37, jamesr wrote: > On 2015/03/12 16:38:39, rudominer wrote: > > Consider the ...
5 years, 9 months ago (2015-03-12 19:08:23 UTC) #5
jamesr
Yeah, they won't see the pipe but they will see the mojo::Binding<> and from that ...
5 years, 9 months ago (2015-03-12 19:13:15 UTC) #6
rudominer
On 2015/03/12 19:13:15, jamesr wrote: > Yeah, they won't see the pipe but they will ...
5 years, 9 months ago (2015-03-12 19:18:02 UTC) #7
rudominer
https://codereview.chromium.org/1003773002/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/1003773002/diff/1/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl#newcode119 mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl:119: if (owning_stub_ && !owning_stub_->connection_error_occurred()) { On 2015/03/12 18:20:04, jamesr ...
5 years, 9 months ago (2015-03-12 22:00:26 UTC) #8
jamesr
On 2015/03/12 22:00:26, rudominer wrote: > https://codereview.chromium.org/1003773002/diff/1/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl > File > mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl > (right): > > ...
5 years, 9 months ago (2015-03-12 22:05:43 UTC) #9
rudominer
https://codereview.chromium.org/1003773002/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/1003773002/diff/1/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl#newcode119 mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl:119: if (owning_stub_ && !owning_stub_->connection_error_occurred()) { Actually this line is ...
5 years, 9 months ago (2015-03-12 22:52:14 UTC) #10
rudominer
James: This is still not ready to submit because of the need for me to ...
5 years, 9 months ago (2015-03-13 01:06:58 UTC) #12
sky
services/view_manager/view_manager_service_apptest.cc LGTM
5 years, 9 months ago (2015-03-13 15:20:50 UTC) #13
rudominer
James, I don't know if you have looked at this since my last comment, but ...
5 years, 9 months ago (2015-03-13 23:52:36 UTC) #14
rudominer
James, this is now fully ready for your review. ptal.
5 years, 9 months ago (2015-03-15 19:50:10 UTC) #15
jamesr
Thanks - I haven't had a chance to look in detail yet (was out Friday) ...
5 years, 9 months ago (2015-03-16 19:21:39 UTC) #16
jamesr
Keeping an extra pointer around from the generated responder object seems a bit unfortunate. Is ...
5 years, 9 months ago (2015-03-16 21:05:57 UTC) #17
rudominer
PTAL. Re your comment about it being unfortunate to keep around an extra pointer: If ...
5 years, 9 months ago (2015-03-16 22:57:20 UTC) #18
jamesr
https://codereview.chromium.org/1003773002/diff/80001/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/1003773002/diff/80001/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl#newcode142 mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl:142: ::mojo::internal::SharedData<{{class_name}}Stub*> associated_stub_; sorry to get caught up on this ...
5 years, 9 months ago (2015-03-18 22:48:31 UTC) #19
rudominer
https://codereview.chromium.org/1003773002/diff/80001/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/1003773002/diff/80001/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl#newcode142 mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl:142: ::mojo::internal::SharedData<{{class_name}}Stub*> associated_stub_; On 2015/03/18 22:48:31, jamesr wrote: > sorry ...
5 years, 9 months ago (2015-03-18 23:02:19 UTC) #20
jamesr
Yeah - if you can use a more specific type here I think it'd be ...
5 years, 9 months ago (2015-03-18 23:14:06 UTC) #21
rudominer
James, PTAL. I completely changed strategies based on your most recent suggestion. I got rid ...
5 years, 9 months ago (2015-03-21 01:57:46 UTC) #22
jamesr
Thanks for all the iterations, I think this looks really nice. Naming is hard but ...
5 years, 9 months ago (2015-03-23 18:16:33 UTC) #23
rudominer
thanks for the review, submitting. https://codereview.chromium.org/1003773002/diff/100001/mojo/public/tools/bindings/generators/cpp_templates/interface_stub_declaration.tmpl File mojo/public/tools/bindings/generators/cpp_templates/interface_stub_declaration.tmpl (right): https://codereview.chromium.org/1003773002/diff/100001/mojo/public/tools/bindings/generators/cpp_templates/interface_stub_declaration.tmpl#newcode10 mojo/public/tools/bindings/generators/cpp_templates/interface_stub_declaration.tmpl:10: mojo::MessageReceiverWithStatus* responder) override; On ...
5 years, 8 months ago (2015-03-30 21:00:50 UTC) #24
rudominer
5 years, 8 months ago (2015-03-30 21:02:44 UTC) #25
Message was sent while issue was closed.
Committed patchset #9 (id:160001) manually as
5f59634fbe6d12a5e31b385281525d6a9aa4e624 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698