Skip to content

Commit

Permalink
Add deprecation notes to old Mojo types
Browse files Browse the repository at this point in the history
Bug: 955171
Change-Id: I8d157312f8f063093d95e534868ffdfe27d34fee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067458
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743251}
  • Loading branch information
krockot authored and Commit Bot committed Feb 20, 2020
1 parent e139b42 commit 8c4563b
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mojo/public/cpp/bindings/associated_binding.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) AssociatedBindingBase {
std::unique_ptr<InterfaceEndpointClient> endpoint_client_;
};

// DEPRECATED: Do not introduce new uses of this type. Instead use the
// AssociatedReceiver type defined in associated_receiver.h.
//
// Represents the implementation side of an associated interface. It is similar
// to Binding, except that it doesn't own a message pipe handle.
//
Expand Down
2 changes: 2 additions & 0 deletions mojo/public/cpp/bindings/associated_binding_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ struct BindingSetTraits<AssociatedBinding<Interface, ImplRefTraits>> {
using ImplPointerType = typename BindingType::ImplPointerType;
};

// DEPRECATED: Do not introduce new uses of this type. Instead use the
// AssociatedReceiverSet type defined in associated_receiver_set.h.
template <typename Interface, typename ContextType = void>
using AssociatedBindingSet =
BindingSetBase<Interface, AssociatedBinding<Interface>, ContextType>;
Expand Down
3 changes: 3 additions & 0 deletions mojo/public/cpp/bindings/associated_interface_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

namespace mojo {

// DEPRECATED: Do not introduce new uses of this type. Instead use the
// AssociatedRemote type defined in associated_remote.h.
//
// Represents the client side of an associated interface. It is similar to
// InterfacePtr, except that it doesn't own a message pipe handle.
template <typename Interface>
Expand Down
6 changes: 6 additions & 0 deletions mojo/public/cpp/bindings/associated_interface_ptr_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@

namespace mojo {

// DEPRECATED: Do not introduce new uses of this type. Instead use the
// AssociatedPendingRemote type defined in associated_pending_remote.h. Mojom
// files which pass associated interface endpoints
// (i.e. "associated Interface" syntax) should be updated to instead pass
// a "pending_associated_remote<Interface>".
//
// AssociatedInterfacePtrInfo stores necessary information to construct an
// associated interface pointer. It is similar to InterfacePtrInfo except that
// it doesn't own a message pipe handle.
Expand Down
6 changes: 6 additions & 0 deletions mojo/public/cpp/bindings/associated_interface_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@

namespace mojo {

// DEPRECATED: Do not introduce new uses of this type. Instead use the
// AssociatedPendingReceiver type defined in associated_pending_receiver.h.
// Mojom files which pass associated interface requests (i.e.,
// "associated Interface&" syntax) should be updated to instead pass a
// "pending_associated_receiver<Interface>".
//
// AssociatedInterfaceRequest represents an associated interface request. It is
// similar to InterfaceRequest except that it doesn't own a message pipe handle.
template <typename Interface>
Expand Down
3 changes: 3 additions & 0 deletions mojo/public/cpp/bindings/binding.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ namespace mojo {

class MessageFilter;

// DEPRECATED: Do not introduce new uses of this type. Instead use the
// Receiver type defined in receiver.h.
//
// Represents the binding of an interface implementation to a message pipe.
// When the |Binding| object is destroyed, the binding between the message pipe
// and the interface is torn down and the message pipe is closed, leaving the
Expand Down
2 changes: 2 additions & 0 deletions mojo/public/cpp/bindings/binding_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ class BindingSetBase {
DISALLOW_COPY_AND_ASSIGN(BindingSetBase);
};

// DEPRECATED: Do not introduce new uses of this type. Instead use the
// ReceiverSet type defined in receiver_set.h.
template <typename Interface, typename ContextType = void>
using BindingSet = BindingSetBase<Interface, Binding<Interface>, ContextType>;

Expand Down
3 changes: 3 additions & 0 deletions mojo/public/cpp/bindings/interface_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@

namespace mojo {

// DEPRECATED: Do not introduce new uses of this type. Instead use the
// Remote type defined in remote.h.
//
// A pointer to a local proxy of a remote Interface implementation. Uses a
// message pipe to communicate with the remote implementation, and automatically
// closes the pipe and deletes the proxy on destruction. The pointer must be
Expand Down
5 changes: 5 additions & 0 deletions mojo/public/cpp/bindings/interface_ptr_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@

namespace mojo {

// DEPRECATED: Do not introduce new uses of this type. Instead use the
// PendingRemote type defined in pending_remote.h. Mojom files which pass
// interface endpoints (i.e. raw "Interface" types) should be updated to instead
// pass a "pending_remote<Interface>".
//
// InterfacePtrInfo stores necessary information to communicate with a remote
// interface implementation, which could be used to construct an InterfacePtr.
template <typename Interface>
Expand Down
4 changes: 4 additions & 0 deletions mojo/public/cpp/bindings/interface_ptr_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,13 @@ class PtrSet {

} // namespace internal

// DEPRECATED: Do not introduce new uses of this type. Instead use the
// RemoteSet type defined in remote_set.h.
template <typename Interface>
using InterfacePtrSet = internal::PtrSet<Interface, InterfacePtr>;

// DEPRECATED: Do not introduce new uses of this type. Instead use the
// AssociatedRemoteSet type defined in remote_set.h.
template <typename Interface>
using AssociatedInterfacePtrSet =
internal::PtrSet<Interface, AssociatedInterfacePtr>;
Expand Down
5 changes: 5 additions & 0 deletions mojo/public/cpp/bindings/interface_request.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@

namespace mojo {

// DEPRECATED: Do not introduce new uses of this type. Instead use the
// PendingReceiver type defined in pending_receiver.h. Mojom files which pass
// interface requests (i.e. "Interface&" syntax) should be updated to pass
// a "pending_receiver<Interface>" instead.
//
// Represents a request from a remote client for an implementation of Interface
// over a specified message pipe. The implementor of the interface should
// remove the message pipe by calling PassMessagePipe() and bind it to the
Expand Down
3 changes: 3 additions & 0 deletions mojo/public/cpp/bindings/strong_associated_binding.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ class StrongAssociatedBinding {
DISALLOW_COPY_AND_ASSIGN(StrongAssociatedBinding);
};

// DEPRECATED: Do not introduce new uses of this API. Instead use the
// MakeSelfOwnedAssociatedReceiver API defined in
// self_owned_associated_receiver.h.
template <typename Interface, typename Impl>
StrongAssociatedBindingPtr<Interface> MakeStrongAssociatedBinding(
std::unique_ptr<Impl> impl,
Expand Down
2 changes: 2 additions & 0 deletions mojo/public/cpp/bindings/strong_binding.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ class StrongBinding {
DISALLOW_COPY_AND_ASSIGN(StrongBinding);
};

// DEPRECATED: Do not introduce new uses of this API. Instead use the
// MakeSelfOwnedReceiver API defined in self_owned_receiver.h.
template <typename Interface, typename Impl>
StrongBindingPtr<Interface> MakeStrongBinding(
std::unique_ptr<Impl> impl,
Expand Down
3 changes: 3 additions & 0 deletions mojo/public/cpp/bindings/strong_binding_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

namespace mojo {

// DEPRECATED: Do not introduce new uses of this type. Instead use the
// UniqueReceiverSet type defined in unique_receiver_set.h.
//
// This class manages a set of bindings. When the pipe a binding is bound to is
// disconnected, the binding is automatically destroyed and removed from the
// set, and the interface implementation is deleted. When the StrongBindingSet
Expand Down
5 changes: 4 additions & 1 deletion mojo/public/cpp/bindings/thread_safe_interface_ptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
#include "mojo/public/cpp/bindings/sync_call_restrictions.h"
#include "mojo/public/cpp/bindings/thread_safe_forwarder_base.h"

// DEPRECATED: Do not introduce new uses of ThreadSafeInterfacePtr. Instead use
// the SharedRemote type defined in shared_remote.h.
//
// ThreadSafeInterfacePtr wraps a non-thread-safe InterfacePtr and proxies
// messages to it. Async calls are posted to the sequence that the InteracePtr
// messages to it. Async calls are posted to the sequence that the InterfacePtr
// is bound to, and the responses are posted back. Sync calls are dispatched
// directly if the call is made on the sequence that the wrapped InterfacePtr is
// bound to, or posted otherwise. It's important to be aware that sync calls
Expand Down

0 comments on commit 8c4563b

Please sign in to comment.