Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BIN_FILE_H_ | 5 #ifndef BIN_FILE_H_ |
| 6 #define BIN_FILE_H_ | 6 #define BIN_FILE_H_ |
| 7 | 7 |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 kLockUnlock = 0, | 81 kLockUnlock = 0, |
| 82 kLockShared = 1, | 82 kLockShared = 1, |
| 83 kLockExclusive = 2, | 83 kLockExclusive = 2, |
| 84 kLockBlockingShared = 3, | 84 kLockBlockingShared = 3, |
| 85 kLockBlockingExclusive = 4, | 85 kLockBlockingExclusive = 4, |
| 86 kLockMax = 4 | 86 kLockMax = 4 |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 intptr_t GetFD(); | 89 intptr_t GetFD(); |
| 90 | 90 |
| 91 void* MapExecutable(intptr_t* num_bytes); | 91 void* MapReadOnly(int64_t position, int64_t length); |
| 92 void* MapReadExecute(int64_t position, int64_t length); | |
|
siva
2016/10/12 20:37:33
Instead of having two entry points would it make s
rmacnak
2016/10/13 01:08:16
Done.
| |
| 92 | 93 |
| 93 // Read/Write attempt to transfer num_bytes to/from buffer. It returns | 94 // Read/Write attempt to transfer num_bytes to/from buffer. It returns |
| 94 // the number of bytes read/written. | 95 // the number of bytes read/written. |
| 95 int64_t Read(void* buffer, int64_t num_bytes); | 96 int64_t Read(void* buffer, int64_t num_bytes); |
| 96 int64_t Write(const void* buffer, int64_t num_bytes); | 97 int64_t Write(const void* buffer, int64_t num_bytes); |
| 97 | 98 |
| 98 // ReadFully and WriteFully do attempt to transfer num_bytes to/from | 99 // ReadFully and WriteFully do attempt to transfer num_bytes to/from |
| 99 // the buffer. In the event of short accesses they will loop internally until | 100 // the buffer. In the event of short accesses they will loop internally until |
| 100 // the whole buffer has been transferred or an error occurs. If an error | 101 // the whole buffer has been transferred or an error occurs. If an error |
| 101 // occurred the result will be set to false. | 102 // occurred the result will be set to false. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 234 Dart_WeakPersistentHandle weak_handle_; | 235 Dart_WeakPersistentHandle weak_handle_; |
| 235 | 236 |
| 236 friend class ReferenceCounted<File>; | 237 friend class ReferenceCounted<File>; |
| 237 DISALLOW_COPY_AND_ASSIGN(File); | 238 DISALLOW_COPY_AND_ASSIGN(File); |
| 238 }; | 239 }; |
| 239 | 240 |
| 240 } // namespace bin | 241 } // namespace bin |
| 241 } // namespace dart | 242 } // namespace dart |
| 242 | 243 |
| 243 #endif // BIN_FILE_H_ | 244 #endif // BIN_FILE_H_ |
| OLD | NEW |