Chromium Code Reviews| 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 "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #if defined(OS_POSIX) | 13 #if defined(OS_POSIX) |
| 14 #include <sys/stat.h> | 14 #include <sys/stat.h> |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 #include <string> | 17 #include <string> |
| 18 | 18 |
| 19 #include "base/base_export.h" | 19 #include "base/base_export.h" |
| 20 #include "base/basictypes.h" | 20 #include "base/basictypes.h" |
| 21 #include "base/files/platform_file.h" | |
| 21 #include "base/files/scoped_file.h" | 22 #include "base/files/scoped_file.h" |
| 22 #include "base/move.h" | 23 #include "base/move.h" |
| 23 #include "base/time/time.h" | 24 #include "base/time/time.h" |
| 24 | 25 |
| 25 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
| 26 #include "base/win/scoped_handle.h" | 27 #include "base/win/scoped_handle.h" |
| 27 #endif | 28 #endif |
| 28 | 29 |
| 29 namespace base { | 30 namespace base { |
| 30 | 31 |
| 31 class FilePath; | 32 class FilePath; |
| 32 | 33 |
| 33 #if defined(OS_WIN) | |
| 34 typedef HANDLE PlatformFile; | |
| 35 #elif defined(OS_POSIX) | |
| 36 typedef int PlatformFile; | |
| 37 | |
| 38 #if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) | 34 #if defined(OS_BSD) || defined(OS_MACOSX) || defined(OS_NACL) |
|
viettrungluu
2014/09/12 00:12:45
This stuff was all inside the defined(OS_POSIX) bl
Hajime Morrita
2014/09/12 00:39:01
Acknowledged.
| |
| 39 typedef struct stat stat_wrapper_t; | 35 typedef struct stat stat_wrapper_t; |
| 40 #else | 36 #else |
| 41 typedef struct stat64 stat_wrapper_t; | 37 typedef struct stat64 stat_wrapper_t; |
|
viettrungluu
2014/09/12 00:12:45
In particular, you shouldn't define this on Window
Hajime Morrita
2014/09/12 00:39:01
Done.
| |
| 42 #endif | 38 #endif |
| 43 #endif // defined(OS_POSIX) | |
| 44 | 39 |
| 45 // Thin wrapper around an OS-level file. | 40 // Thin wrapper around an OS-level file. |
| 46 // Note that this class does not provide any support for asynchronous IO, other | 41 // Note that this class does not provide any support for asynchronous IO, other |
| 47 // than the ability to create asynchronous handles on Windows. | 42 // than the ability to create asynchronous handles on Windows. |
| 48 // | 43 // |
| 49 // Note about const: this class does not attempt to determine if the underlying | 44 // Note about const: this class does not attempt to determine if the underlying |
| 50 // file system object is affected by a particular method in order to consider | 45 // file system object is affected by a particular method in order to consider |
| 51 // that method const or not. Only methods that deal with member variables in an | 46 // that method const or not. Only methods that deal with member variables in an |
| 52 // obvious non-modifying way are marked as const. Any method that forward calls | 47 // obvious non-modifying way are marked as const. Any method that forward calls |
| 53 // to the OS is not considered const, even if there is no apparent change to | 48 // to the OS is not considered const, even if there is no apparent change to |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 304 #endif | 299 #endif |
| 305 | 300 |
| 306 Error error_details_; | 301 Error error_details_; |
| 307 bool created_; | 302 bool created_; |
| 308 bool async_; | 303 bool async_; |
| 309 }; | 304 }; |
| 310 | 305 |
| 311 } // namespace base | 306 } // namespace base |
| 312 | 307 |
| 313 #endif // BASE_FILES_FILE_H_ | 308 #endif // BASE_FILES_FILE_H_ |
| OLD | NEW |