OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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_SYSTEM_TOKEN_SERIALIZER_WIN_H_ | |
6 #define MOJO_EDK_SYSTEM_TOKEN_SERIALIZER_WIN_H_ | |
7 | |
8 #include <stdint.h> | |
9 #include <vector> | |
10 | |
11 #include "mojo/edk/embedder/scoped_platform_handle.h" | |
12 | |
13 namespace mojo { | |
14 namespace edk { | |
15 | |
16 // An interface for serializing a Mojo handle to memory. A child process will | |
yzshen1
2015/11/20 20:39:55
nit: This interface deals with platform handles in
| |
17 // have to make sync calls to the parent process. | |
18 class MOJO_SYSTEM_IMPL_EXPORT TokenSerializer { | |
19 public: | |
20 virtual ~TokenSerializer() {} | |
21 | |
22 // Create a PlatformChannelPair. | |
23 virtual void CreatePlatformChannelPair(ScopedPlatformHandle* server, | |
24 ScopedPlatformHandle* client) = 0; | |
25 | |
26 // Converts the given platform handles to tokens. | |
27 // |tokens| should point to memory that is sizeof(uint64_t) * count; | |
28 virtual void HandleToToken(const PlatformHandle* platform_handles, | |
29 size_t count, | |
30 uint64_t* tokens) = 0; | |
31 | |
32 // Converts the given tokens to platformhandles. | |
33 // |handles| should point to memory that is sizeof(HANDLE) * count; | |
34 virtual void TokenToHandle(const uint64_t* tokens, | |
35 size_t count, | |
36 PlatformHandle* handles) = 0; | |
37 }; | |
38 | |
39 } // namespace edk | |
40 } // namespace mojo | |
41 | |
42 #endif // MOJO_EDK_SYSTEM_TOKEN_SERIALIZER_WIN_H_ | |
OLD | NEW |