OLD | NEW |
| (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_SHELL_SCOPED_MESSAGE_PIPE_H_ | |
6 #define MOJO_SHELL_SCOPED_MESSAGE_PIPE_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "mojo/public/system/core.h" | |
10 | |
11 namespace mojo { | |
12 namespace shell { | |
13 | |
14 // Simple scoper that creates a message pipe in constructor and closes it in | |
15 // destructor. Test for success by comparing handles with MOJO_HANDLE_INVALID. | |
16 class ScopedMessagePipe { | |
17 public: | |
18 ScopedMessagePipe(); | |
19 ~ScopedMessagePipe(); | |
20 | |
21 MojoHandle handle_0() const { return handle_0_; } | |
22 MojoHandle handle_1() const { return handle_1_; } | |
23 | |
24 private: | |
25 MojoHandle handle_0_; | |
26 MojoHandle handle_1_; | |
27 | |
28 DISALLOW_COPY_AND_ASSIGN(ScopedMessagePipe); | |
29 }; | |
30 | |
31 } // namespace shell | |
32 } // namespace mojo | |
33 | |
34 #endif // MOJO_SHELL_SCOPED_MESSAGE_PIPE_H_ | |
OLD | NEW |