OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2013 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_REVERSE_SERVICE_NACL_FILE_INFO_H_ | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_NACL_FILE_INFO_H_ |
8 #define NATIVE_CLIENT_SRC_TRUSTED_REVERSE_SERVICE_NACL_FILE_INFO_H_ | 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_NACL_FILE_INFO_H_ |
9 | 9 |
10 #include "native_client/src/include/nacl_base.h" | 10 #include "native_client/src/include/nacl_base.h" |
11 #include "native_client/src/include/portability.h" | 11 #include "native_client/src/include/portability.h" |
12 | 12 |
13 /* | |
14 * TODO(jvoung): Moving this to src/public/nacl_file_info.h. | |
15 * This copy is left here to avoid a complicated NaCl -> Chrome | |
Mark Seaborn
2014/05/02 20:50:40
You shouldn't leave this as a duplicate. Instead,
jvoung (off chromium)
2014/05/14 23:42:47
Done.
| |
16 * DEPS roll. Remove this copy once DEPS'ed in a Chrome users | |
17 * refer to the src/public copy instead of this copy. | |
18 */ | |
19 | |
13 EXTERN_C_BEGIN | 20 EXTERN_C_BEGIN |
14 | 21 |
15 /* | 22 /* |
16 * NaClFileToken is a single-use nonce that the NaCl process can use to query | 23 * NaClFileToken is a single-use nonce that the NaCl process can use to query |
17 * the browser process for trusted information about a file. lo == 0 && hi == 0 | 24 * the browser process for trusted information about a file. lo == 0 && hi == 0 |
18 * indicates the token is invalid and no additional information is available. | 25 * indicates the token is invalid and no additional information is available. |
19 */ | 26 */ |
20 struct NaClFileToken { | 27 struct NaClFileToken { |
21 uint64_t lo; | 28 uint64_t lo; |
22 uint64_t hi; | 29 uint64_t hi; |
23 }; | 30 }; |
24 | 31 |
32 static inline int NaClFileTokenIsValid(struct NaClFileToken *file_token) { | |
33 return !(file_token->lo == 0 && file_token->hi == 0); | |
34 } | |
35 | |
25 struct NaClFileInfo { | 36 struct NaClFileInfo { |
26 /* desc is either a Unix file descriptor or a Windows file handle. */ | 37 /* desc is either a Unix file descriptor or a Windows file handle. */ |
27 int32_t desc; | 38 int32_t desc; |
28 struct NaClFileToken file_token; | 39 struct NaClFileToken file_token; |
29 }; | 40 }; |
30 | 41 |
31 EXTERN_C_END | 42 EXTERN_C_END |
32 | 43 |
33 #endif /* NATIVE_CLIENT_SRC_TRUSTED_REVERSE_SERVICE_NACL_FILE_INFO_H_ */ | 44 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_NACL_FILE_INFO_H_ */ |
OLD | NEW |