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

Unified Diff: mojo/system/local_message_pipe_endpoint.h

Issue 68303007: Mojo: More plumbing required to transfer handles over MessagePipes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | « no previous file | mojo/system/local_message_pipe_endpoint.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/local_message_pipe_endpoint.h
diff --git a/mojo/system/local_message_pipe_endpoint.h b/mojo/system/local_message_pipe_endpoint.h
index 99ebec25c63506eae14134ff495813f1613bdb2f..6961827fd917eb3c5595b5cc30c7c51a9403139c 100644
--- a/mojo/system/local_message_pipe_endpoint.h
+++ b/mojo/system/local_message_pipe_endpoint.h
@@ -6,6 +6,7 @@
#define MOJO_SYSTEM_LOCAL_MESSAGE_PIPE_ENDPOINT_H_
#include <deque>
+#include <vector>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@@ -25,9 +26,12 @@ class MOJO_SYSTEM_EXPORT LocalMessagePipeEndpoint : public MessagePipeEndpoint {
// |MessagePipeEndpoint| implementation:
virtual void Close() OVERRIDE;
virtual bool OnPeerClose() OVERRIDE;
- virtual MojoResult EnqueueMessage(
- MessageInTransit* message,
+ virtual MojoResult CanEnqueueMessage(
+ const MessageInTransit* message,
const std::vector<Dispatcher*>* dispatchers) OVERRIDE;
+ virtual void EnqueueMessage(
+ MessageInTransit* message,
+ std::vector<scoped_refptr<Dispatcher> >* dispatchers) OVERRIDE;
// There's a dispatcher for |LocalMessagePipeEndpoint|s, so we have to
// implement/override these:
@@ -43,13 +47,30 @@ class MOJO_SYSTEM_EXPORT LocalMessagePipeEndpoint : public MessagePipeEndpoint {
virtual void RemoveWaiter(Waiter* waiter) OVERRIDE;
private:
+ struct MessageQueueEntry {
+ 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
+ // empty. (We don't provide a nontrivial constructor, because it wouldn't be
+ // useful with these constraints. This will change with C++11.)
+ MessageQueueEntry(const MessageQueueEntry& other);
+ ~MessageQueueEntry();
+
+ MessageInTransit* message;
+ std::vector<scoped_refptr<Dispatcher> > dispatchers;
+
+ private:
+ // We don't need assignment, however.
+ DISALLOW_ASSIGN(MessageQueueEntry);
+ };
+
MojoWaitFlags SatisfiedFlags();
MojoWaitFlags SatisfiableFlags();
bool is_open_;
bool is_peer_open_;
- std::deque<MessageInTransit*> message_queue_;
+ std::deque<MessageQueueEntry> message_queue_;
WaiterList waiter_list_;
DISALLOW_COPY_AND_ASSIGN(LocalMessagePipeEndpoint);
« no previous file with comments | « no previous file | mojo/system/local_message_pipe_endpoint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698