summaryrefslogtreecommitdiffstats
path: root/mojo/public/cpp/bindings/associated_interface_ptr.h
diff options
context:
space:
mode:
authoryzshen <yzshen@chromium.org>2016-03-08 15:48:49 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-08 23:50:50 +0000
commitb92c3dd75843e7603892e997a80dcdba5102ce07 (patch)
tree07fb889c003760df4da61fdd4bde82107fa128ea /mojo/public/cpp/bindings/associated_interface_ptr.h
parentbd736b069b320a18476b30aea47639fb25f50110 (diff)
downloadchromium_src-b92c3dd75843e7603892e997a80dcdba5102ce07.zip
chromium_src-b92c3dd75843e7603892e997a80dcdba5102ce07.tar.gz
chromium_src-b92c3dd75843e7603892e997a80dcdba5102ce07.tar.bz2
Mojo C++ bindings: remove the concept of "GenericInterface".
Previously, if a variant Foo1 was generated for mojom interface Foo. Foo1::GenericInterface was defined as a typedef of the non-variant version Foo. This required the non-variant version to be generated and depended on by all variants. The purpose was to make different variants use the same [Associated]Interface{PtrInfo,Request} types. In fact, this is not very useful in real-world use cases. It should be very rare that users need to deal with multiple variants of the same mojom interface in a single same app. This change removes GenericInterface and makes [Associated]Interface{PtrInfo, Request} directly use Foo1 instead of Foo1::GenericInterface. BUG=590329 Review URL: https://codereview.chromium.org/1775613003 Cr-Commit-Position: refs/heads/master@{#379970}
Diffstat (limited to 'mojo/public/cpp/bindings/associated_interface_ptr.h')
-rw-r--r--mojo/public/cpp/bindings/associated_interface_ptr.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/mojo/public/cpp/bindings/associated_interface_ptr.h b/mojo/public/cpp/bindings/associated_interface_ptr.h
index f683637..d3a848a 100644
--- a/mojo/public/cpp/bindings/associated_interface_ptr.h
+++ b/mojo/public/cpp/bindings/associated_interface_ptr.h
@@ -25,8 +25,6 @@ class AssociatedInterfacePtr {
DISALLOW_COPY_AND_ASSIGN_WITH_MOVE_FOR_BIND(AssociatedInterfacePtr)
public:
- using GenericInterface = typename Interface::GenericInterface;
-
// Constructs an unbound AssociatedInterfacePtr.
AssociatedInterfacePtr() {}
AssociatedInterfacePtr(decltype(nullptr)) {}
@@ -57,7 +55,7 @@ class AssociatedInterfacePtr {
// NOTE: Please see the comments of
// AssociatedGroup.CreateAssociatedInterface() about when you can use this
// object to make calls.
- void Bind(AssociatedInterfacePtrInfo<GenericInterface> info) {
+ void Bind(AssociatedInterfacePtrInfo<Interface> info) {
reset();
bool is_local =
@@ -125,7 +123,7 @@ class AssociatedInterfacePtr {
// It is an error to call PassInterface() while there are pending responses.
// TODO: fix this restriction, it's not always obvious when there is a
// pending response.
- AssociatedInterfacePtrInfo<GenericInterface> PassInterface() {
+ AssociatedInterfacePtrInfo<Interface> PassInterface() {
DCHECK(!internal_state_.has_pending_callbacks());
State state;
internal_state_.Swap(&state);
@@ -178,16 +176,16 @@ class AssociatedInterfacePtr {
// as soon as the request is sent, |ptr| is usable. There is no need to wait
// until the request is bound to an implementation at the remote side.
template <typename Interface>
-AssociatedInterfaceRequest<typename Interface::GenericInterface> GetProxy(
+AssociatedInterfaceRequest<Interface> GetProxy(
AssociatedInterfacePtr<Interface>* ptr,
AssociatedGroup* group) {
- AssociatedInterfaceRequest<typename Interface::GenericInterface> request;
- AssociatedInterfacePtrInfo<typename Interface::GenericInterface> ptr_info;
+ AssociatedInterfaceRequest<Interface> request;
+ AssociatedInterfacePtrInfo<Interface> ptr_info;
group->CreateAssociatedInterface(AssociatedGroup::WILL_PASS_REQUEST,
&ptr_info, &request);
ptr->Bind(std::move(ptr_info));
- return std::move(request);
+ return request;
}
} // namespace mojo