// |MessagePipeEndpoint| implementation:
virtual void Close() OVERRIDE;
virtual void OnPeerClose() OVERRIDE;
- virtual MojoResult CanEnqueueMessage(
- const MessageInTransit* message,
- const std::vector<Dispatcher*>* dispatchers) OVERRIDE;
- virtual void EnqueueMessage(
+ virtual MojoResult EnqueueMessage(
MessageInTransit* message,
- std::vector<scoped_refptr<Dispatcher> >* dispatchers) OVERRIDE;
+ std::vector<DispatcherTransport>* transports) OVERRIDE;
// There's a dispatcher for |LocalMessagePipeEndpoint|s, so we have to
// implement/override these:
virtual void RemoveWaiter(Waiter* waiter) OVERRIDE;
private:
- struct MessageQueueEntry {
+ class MessageQueueEntry {
+ public:
MessageQueueEntry();
// Provide an explicit copy constructor, so that we can use this directly in
// a (C++03) STL container. However, we only allow the case where |other| is
MessageQueueEntry(const MessageQueueEntry& other);
~MessageQueueEntry();
- MessageInTransit* message;
- std::vector<scoped_refptr<Dispatcher> > dispatchers;
+ // Initialize, taking ownership of |message| and creating equivalent
+ // "duplicate" dispatchers. |transports| should be non-null only if
+ // nonempty.
+ // TODO(vtl): This would simply be a constructor, but we don't have C++11's
+ // emplace operations yet, and I don't want to copy |dispatchers_|.
+ void Init(MessageInTransit* message,
+ std::vector<DispatcherTransport>* transports);
+
+ MessageInTransit* message() {
+ return message_;
+ }
+ std::vector<scoped_refptr<Dispatcher> >* dispatchers() {
+ return &dispatchers_;
+ }
private:
+ MessageInTransit* message_;
+ std::vector<scoped_refptr<Dispatcher> > dispatchers_;
+
// We don't need assignment, however.
DISALLOW_ASSIGN(MessageQueueEntry);
};