#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "mojo/public/system/core.h"
+#include "mojo/system/dispatcher.h"
#include "mojo/system/message_in_transit.h"
#include "mojo/system/system_impl_export.h"
namespace system {
class Channel;
-class Dispatcher;
class Waiter;
// This is an interface to one of the ends of a message pipe, and is used by
// All implementations must implement these.
virtual void Close() = 0;
virtual void OnPeerClose() = 0;
- // Checks if |EnqueueMessage()| will be able to enqueue the given message
- // (with the given set of dispatchers). |dispatchers| should be non-null only
- // if it's nonempty. Returns |MOJO_RESULT_OK| if it will and an appropriate
- // error code if it won't.
- virtual MojoResult CanEnqueueMessage(
- const MessageInTransit* message,
- const std::vector<Dispatcher*>* dispatchers) = 0;
- // Takes ownership of |message| and the contents of |dispatchers| (leaving
- // it empty). This should only be called after |CanEnqueueMessage()| has
- // indicated success. (Unlike |CanEnqueueMessage()|, |dispatchers| may be
- // non-null but empty.)
- virtual void EnqueueMessage(
+ // Implements |MessagePipe::EnqueueMessage()| (see its description for
+ // details).
+ virtual MojoResult EnqueueMessage(
MessageInTransit* message,
- std::vector<scoped_refptr<Dispatcher> >* dispatchers) = 0;
+ std::vector<DispatcherTransport>* transports) = 0;
// Implementations must override these if they represent a local endpoint,
// i.e., one for which there's a |MessagePipeDispatcher| (and thus a handle).