|
|
Add mojo::Binding<Interface> for more flexible pipe<->impl binding
This provides a mojo::Binding<Interface> class that takes a pointer to an
interface implementation and binds it to a pipe. This type can be composed into
the interface implementation or managed separately, depending on the needs of
the implementation. This is in contrast to InterfaceImpl<Interface> which uses
implementation inheritance to store the binding with the pipe and thus forces
the implementation into having a rigid relationship with the pipe.
Binding<Interface> maps messages on the pipe to the interface and allows
registering an error handler to be notified of connection errors but does not
implement an error handling strategy itself. Deleting a Binding closes the pipe.
StrongBinding<Interface> additionally deletes the interface on receiving a pipe
error.
InterfaceImpl<Interface> is rewritten in this patch to use a Binding<Interface>
internally. I intend to transition all code away from using
InterfaceImpl<Interface> to using Binding<Interface> directly, or if it's useful
adding other helper classes for common patterns. I have a few examples of how
this transition looks here: https://codereview.chromium.org/713313002 and here:
https://codereview.chromium.org/718623004.
BUG= 431963
R=davemoore@chromium.org
Committed: https://chromium.googlesource.com/external/mojo/+/43fd6836c314a82308f2d158a1ddc6588d6005bc
Total comments: 15
Total comments: 1
Total comments: 3
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+511 lines, -235 lines) |
Patch |
 |
M |
mojo/application_manager/application_manager.cc
|
View
|
1
2
3
4
5
6
|
7 chunks |
+38 lines, -14 lines |
0 comments
|
Download
|
 |
M |
mojo/application_manager/application_manager_unittest.cc
|
View
|
1
2
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
M |
mojo/public/cpp/bindings/BUILD.gn
|
View
|
1
2
3
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
A |
mojo/public/cpp/bindings/binding.h
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+136 lines, -0 lines |
0 comments
|
Download
|
 |
M |
mojo/public/cpp/bindings/interface_impl.h
|
View
|
1
2
3
4
5
6
7
|
7 chunks |
+51 lines, -28 lines |
1 comment
|
Download
|
 |
D |
mojo/public/cpp/bindings/lib/interface_impl_internal.h
|
View
|
1
2
3
|
1 chunk |
+0 lines, -128 lines |
1 comment
|
Download
|
 |
A |
mojo/public/cpp/bindings/strong_binding.h
|
View
|
1
2
3
4
5
6
|
1 chunk |
+86 lines, -0 lines |
1 comment
|
Download
|
 |
M |
mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc
|
View
|
1
2
3
4
5
6
7
|
11 chunks |
+149 lines, -19 lines |
0 comments
|
Download
|
 |
M |
mojo/public/cpp/bindings/tests/validation_unittest.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
mojo/public/mojo_public.gyp
|
View
|
1
2
3
|
3 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
mojo/services/public/cpp/view_manager/lib/view_manager_client_factory.cc
|
View
|
1
2
3
4
5
|
2 chunks |
+4 lines, -1 line |
0 comments
|
Download
|
 |
M |
mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h
|
View
|
1
2
|
2 chunks |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
mojo/services/test_service/test_request_tracker_application.h
|
View
|
1
2
|
2 chunks |
+8 lines, -6 lines |
0 comments
|
Download
|
 |
M |
mojo/services/test_service/test_request_tracker_application.cc
|
View
|
1
2
3
4
5
6
|
2 chunks |
+12 lines, -5 lines |
0 comments
|
Download
|
 |
M |
mojo/services/test_service/test_request_tracker_impl.h
|
View
|
1
2
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
mojo/services/test_service/test_service_application.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
mojo/services/test_service/test_service_impl.h
|
View
|
1
2
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
mojo/services/test_service/test_service_impl.cc
|
View
|
1
2
|
1 chunk |
+0 lines, -4 lines |
0 comments
|
Download
|
 |
M |
mojo/services/test_service/test_time_service_impl.h
|
View
|
1
2
3
4
5
6
|
3 chunks |
+6 lines, -2 lines |
0 comments
|
Download
|
 |
M |
mojo/services/test_service/test_time_service_impl.cc
|
View
|
1
2
3
4
5
6
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
mojo/services/view_manager/view_manager_server_apptest.cc
|
View
|
1
2
|
1 chunk |
+0 lines, -3 lines |
0 comments
|
Download
|
 |
M |
mojo/services/view_manager/view_manager_unittest.cc
|
View
|
1
2
3
4
5
6
7
|
3 chunks |
+6 lines, -8 lines |
0 comments
|
Download
|
 |
M |
mojo/services/window_manager/window_manager_impl.h
|
View
|
1
2
|
1 chunk |
+0 lines, -3 lines |
0 comments
|
Download
|
 |
M |
mojo/services/window_manager/window_manager_impl.cc
|
View
|
1
2
|
1 chunk |
+0 lines, -3 lines |
0 comments
|
Download
|
Total messages: 13 (1 generated)
|