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> |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 explicit File(PlatformFile platform_file); | 169 explicit File(PlatformFile platform_file); |
| 170 | 170 |
| 171 // Creates an object with a specific error_details code. | 171 // Creates an object with a specific error_details code. |
| 172 explicit File(Error error_details); | 172 explicit File(Error error_details); |
| 173 | 173 |
| 174 // Move constructor for C++03 move emulation of this type. | 174 // Move constructor for C++03 move emulation of this type. |
| 175 File(RValue other); | 175 File(RValue other); |
| 176 | 176 |
| 177 ~File(); | 177 ~File(); |
| 178 | 178 |
| 179 static File CreateForAsyncHandle(PlatformFile platform_file); | |
|
Lei Zhang
2015/05/26 23:58:06
You need to mention this takes ownership of |platf
| |
| 180 | |
| 179 // Move operator= for C++03 move emulation of this type. | 181 // Move operator= for C++03 move emulation of this type. |
| 180 File& operator=(RValue other); | 182 File& operator=(RValue other); |
| 181 | 183 |
| 182 // Creates or opens the given file. | 184 // Creates or opens the given file. |
| 183 void Initialize(const FilePath& path, uint32 flags); | 185 void Initialize(const FilePath& path, uint32 flags); |
| 184 | 186 |
| 185 bool IsValid() const; | 187 bool IsValid() const; |
| 186 | 188 |
| 187 // Returns true if a new file was created (or an old one truncated to zero | 189 // Returns true if a new file was created (or an old one truncated to zero |
| 188 // length to simulate a new file, which can happen with | 190 // length to simulate a new file, which can happen with |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 375 FileTracing::ScopedEnabler trace_enabler_; | 377 FileTracing::ScopedEnabler trace_enabler_; |
| 376 | 378 |
| 377 Error error_details_; | 379 Error error_details_; |
| 378 bool created_; | 380 bool created_; |
| 379 bool async_; | 381 bool async_; |
| 380 }; | 382 }; |
| 381 | 383 |
| 382 } // namespace base | 384 } // namespace base |
| 383 | 385 |
| 384 #endif // BASE_FILES_FILE_H_ | 386 #endif // BASE_FILES_FILE_H_ |
| OLD | NEW |