OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_EDK_EMBEDDER_PLATFORM_HANDLE_H_ | 5 #ifndef MOJO_EDK_EMBEDDER_PLATFORM_HANDLE_H_ |
6 #define MOJO_EDK_EMBEDDER_PLATFORM_HANDLE_H_ | 6 #define MOJO_EDK_EMBEDDER_PLATFORM_HANDLE_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "mojo/edk/system/system_impl_export.h" | 9 #include "mojo/edk/system/system_impl_export.h" |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // be resolved to a real port later. This distinction is needed so that the | 46 // be resolved to a real port later. This distinction is needed so that the |
47 // "port" doesn't try to be closed if CloseIfNecessary() is called. Having | 47 // "port" doesn't try to be closed if CloseIfNecessary() is called. Having |
48 // this also allows us to do checks in other places. | 48 // this also allows us to do checks in other places. |
49 MACH_NAME, | 49 MACH_NAME, |
50 #endif | 50 #endif |
51 }; | 51 }; |
52 Type type = Type::POSIX; | 52 Type type = Type::POSIX; |
53 | 53 |
54 int handle = -1; | 54 int handle = -1; |
55 | 55 |
| 56 // A POSIX handle may be a listen handle that can accept a connection. |
| 57 bool needs_connection = false; |
| 58 |
56 #if defined(OS_MACOSX) && !defined(OS_IOS) | 59 #if defined(OS_MACOSX) && !defined(OS_IOS) |
57 mach_port_t port = MACH_PORT_NULL; | 60 mach_port_t port = MACH_PORT_NULL; |
58 #endif | 61 #endif |
59 }; | 62 }; |
60 #elif defined(OS_WIN) | 63 #elif defined(OS_WIN) |
61 struct MOJO_SYSTEM_IMPL_EXPORT PlatformHandle { | 64 struct MOJO_SYSTEM_IMPL_EXPORT PlatformHandle { |
62 PlatformHandle() : PlatformHandle(INVALID_HANDLE_VALUE) {} | 65 PlatformHandle() : PlatformHandle(INVALID_HANDLE_VALUE) {} |
63 explicit PlatformHandle(HANDLE handle) | 66 explicit PlatformHandle(HANDLE handle) |
64 : handle(handle), owning_process(base::GetCurrentProcessHandle()) {} | 67 : handle(handle), owning_process(base::GetCurrentProcessHandle()) {} |
65 | 68 |
(...skipping 12 matching lines...) Expand all Loading... |
78 bool needs_connection = false; | 81 bool needs_connection = false; |
79 }; | 82 }; |
80 #else | 83 #else |
81 #error "Platform not yet supported." | 84 #error "Platform not yet supported." |
82 #endif | 85 #endif |
83 | 86 |
84 } // namespace edk | 87 } // namespace edk |
85 } // namespace mojo | 88 } // namespace mojo |
86 | 89 |
87 #endif // MOJO_EDK_EMBEDDER_PLATFORM_HANDLE_H_ | 90 #endif // MOJO_EDK_EMBEDDER_PLATFORM_HANDLE_H_ |
OLD | NEW |