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

Side by Side Diff: mojo/public/cpp/bindings/tests/message_queue.h

Issue 2250183003: Make the fuchsia mojo/public repo the source of truth. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 4 months 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 unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_QUEUE_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_QUEUE_H_
7
8 #include <queue>
9
10 #include "mojo/public/cpp/system/macros.h"
11
12 namespace mojo {
13 class Message;
14
15 namespace test {
16
17 // A queue for Message objects.
18 class MessageQueue {
19 public:
20 MessageQueue();
21 ~MessageQueue();
22
23 bool IsEmpty() const;
24
25 // This method copies the message data and steals ownership of its handles.
26 void Push(Message* message);
27
28 // Removes the next message from the queue, copying its data and transferring
29 // ownership of its handles to the given |message|.
30 void Pop(Message* message);
31
32 private:
33 void Pop();
34
35 std::queue<Message*> queue_;
36
37 MOJO_DISALLOW_COPY_AND_ASSIGN(MessageQueue);
38 };
39
40 } // namespace test
41 } // namespace mojo
42
43 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MESSAGE_QUEUE_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/tests/message_builder_unittest.cc ('k') | mojo/public/cpp/bindings/tests/message_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698