| 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_EDK_EMBEDDER_PLATFORM_HANDLE_H_ | |
| 6 #define MOJO_EDK_EMBEDDER_PLATFORM_HANDLE_H_ | |
| 7 | |
| 8 namespace mojo { | |
| 9 namespace embedder { | |
| 10 | |
| 11 // A |PlatformHandle| is just a file descriptor on POSIX. | |
| 12 struct PlatformHandle { | |
| 13 PlatformHandle() : fd(-1) {} | |
| 14 explicit PlatformHandle(int fd) : fd(fd) {} | |
| 15 | |
| 16 void CloseIfNecessary(); | |
| 17 | |
| 18 bool is_valid() const { return fd != -1; } | |
| 19 | |
| 20 int fd; | |
| 21 }; | |
| 22 | |
| 23 } // namespace embedder | |
| 24 } // namespace mojo | |
| 25 | |
| 26 #endif // MOJO_EDK_EMBEDDER_PLATFORM_HANDLE_H_ | |
| OLD | NEW |