1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_QUEUE_H_
6 #define MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_QUEUE_H_
10 #include "mojo/public/cpp/system/macros.h"
17 // A queue for Message objects.
26 // This method transfers ownership of |message->data| and |message->handles|
27 // to the message queue, resetting |message| in the process.
28 void Push(Message* message);
30 // Removes the next message from the queue, transferring ownership of its
31 // data and handles to the given |message|.
32 void Pop(Message* message);
34 // Removes the next message from the queue, discarding its data and handles.
35 // This is meant to be used in conjunction with |Peek|.
39 std::queue<Message*> queue_;
41 MOJO_DISALLOW_COPY_AND_ASSIGN(MessageQueue);
44 } // namespace internal
47 #endif // MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_QUEUE_H_