| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 BASE_FILES_FILE_H_ | 5 #ifndef BASE_FILES_FILE_H_ |
| 6 #define BASE_FILES_FILE_H_ | 6 #define BASE_FILES_FILE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "base/win/scoped_handle.h" | 22 #include "base/win/scoped_handle.h" |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 #if defined(OS_POSIX) | 25 #if defined(OS_POSIX) |
| 26 #include <sys/stat.h> | 26 #include <sys/stat.h> |
| 27 #endif | 27 #endif |
| 28 | 28 |
| 29 namespace base { | 29 namespace base { |
| 30 | 30 |
| 31 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
| 32 typedef HANDLE PlatformFile; | 32 using PlatformFile = HANDLE; |
| 33 |
| 34 const PlatformFile kInvalidPlatformFile = INVALID_HANDLE_VALUE; |
| 33 #elif defined(OS_POSIX) | 35 #elif defined(OS_POSIX) |
| 34 typedef int PlatformFile; | 36 using PlatformFile = int; |
| 35 | 37 |
| 38 const PlatformFile kInvalidPlatformFile = -1; |
| 36 #if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) | 39 #if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) |
| 37 typedef struct stat stat_wrapper_t; | 40 typedef struct stat stat_wrapper_t; |
| 38 #else | 41 #else |
| 39 typedef struct stat64 stat_wrapper_t; | 42 typedef struct stat64 stat_wrapper_t; |
| 40 #endif | 43 #endif |
| 41 #endif // defined(OS_POSIX) | 44 #endif // defined(OS_POSIX) |
| 42 | 45 |
| 43 // Thin wrapper around an OS-level file. | 46 // Thin wrapper around an OS-level file. |
| 44 // Note that this class does not provide any support for asynchronous IO, other | 47 // Note that this class does not provide any support for asynchronous IO, other |
| 45 // than the ability to create asynchronous handles on Windows. | 48 // than the ability to create asynchronous handles on Windows. |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 333 |
| 331 Error error_details_; | 334 Error error_details_; |
| 332 bool created_; | 335 bool created_; |
| 333 bool async_; | 336 bool async_; |
| 334 }; | 337 }; |
| 335 | 338 |
| 336 } // namespace base | 339 } // namespace base |
| 337 | 340 |
| 338 #endif // BASE_FILES_FILE_H_ | 341 #endif // BASE_FILES_FILE_H_ |
| 339 | 342 |
| OLD | NEW |