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

Unified Diff: mojo/public/cpp/bindings/associated_binding.h

Issue 2696233002: Mojo C++ bindings: remove some usage of AssociatedGroup from user code. (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/ash/media_client.cc ('k') | mojo/public/cpp/bindings/associated_interface_ptr.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/associated_binding.h
diff --git a/mojo/public/cpp/bindings/associated_binding.h b/mojo/public/cpp/bindings/associated_binding.h
index 4a43b27d251df1e35d512576cfb646fdfb06a465..26671aa968f3c3062dd653ae5c764442b0f00c12 100644
--- a/mojo/public/cpp/bindings/associated_binding.h
+++ b/mojo/public/cpp/bindings/associated_binding.h
@@ -107,12 +107,10 @@ class AssociatedBinding : public AssociatedBindingBase {
explicit AssociatedBinding(ImplPointerType impl) { stub_.set_sink(impl); }
// Constructs a completed associated binding of |impl|. The output |ptr_info|
- // should be passed through the message pipe endpoint referred to by
- // |associated_group| to setup the corresponding asssociated interface
- // pointer. |impl| must outlive this object.
+ // should be sent by another interface. |impl| must outlive this object.
AssociatedBinding(ImplPointerType impl,
AssociatedInterfacePtrInfo<Interface>* ptr_info,
- AssociatedGroup* associated_group,
+ AssociatedGroup* associated_group = nullptr,
scoped_refptr<base::SingleThreadTaskRunner> runner =
base::ThreadTaskRunnerHandle::Get())
: AssociatedBinding(std::move(impl)) {
@@ -132,16 +130,14 @@ class AssociatedBinding : public AssociatedBindingBase {
~AssociatedBinding() {}
// Creates an associated inteface and sets up this object as the
- // implementation side. The output |ptr_info| should be passed through the
- // message pipe endpoint referred to by |associated_group| to setup the
- // corresponding asssociated interface pointer.
+ // implementation side. The output |ptr_info| should be sent by another
+ // interface.
void Bind(AssociatedInterfacePtrInfo<Interface>* ptr_info,
- AssociatedGroup* associated_group,
+ AssociatedGroup* associated_group = nullptr,
scoped_refptr<base::SingleThreadTaskRunner> runner =
base::ThreadTaskRunnerHandle::Get()) {
- AssociatedInterfaceRequest<Interface> request;
- associated_group->CreateAssociatedInterface(AssociatedGroup::WILL_PASS_PTR,
- ptr_info, &request);
+ auto request = MakeRequest(ptr_info);
+ ptr_info->set_version(Interface::Version_);
Bind(std::move(request), std::move(runner));
}
« no previous file with comments | « chrome/browser/ui/ash/media_client.cc ('k') | mojo/public/cpp/bindings/associated_interface_ptr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698