Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: base/files/file.h

Issue 189393002: net: Update FileStream to use base::File instead of PlatformFile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // POSIX-specific semantics: 257 // POSIX-specific semantics:
258 // * Locks are advisory only. 258 // * Locks are advisory only.
259 // * Within a process, locking the same file (by the same or new handle) 259 // * Within a process, locking the same file (by the same or new handle)
260 // will succeed. 260 // will succeed.
261 // * Closing any descriptor on a given file releases the lock. 261 // * Closing any descriptor on a given file releases the lock.
262 Error Lock(); 262 Error Lock();
263 263
264 // Unlock a file previously locked. 264 // Unlock a file previously locked.
265 Error Unlock(); 265 Error Unlock();
266 266
267 bool async() const { return async_; }
268
267 #if defined(OS_WIN) 269 #if defined(OS_WIN)
268 static Error OSErrorToFileError(DWORD last_error); 270 static Error OSErrorToFileError(DWORD last_error);
269 #elif defined(OS_POSIX) 271 #elif defined(OS_POSIX)
270 static Error OSErrorToFileError(int saved_errno); 272 static Error OSErrorToFileError(int saved_errno);
271 #endif 273 #endif
272 274
273 private: 275 private:
274 void SetPlatformFile(PlatformFile file); 276 void SetPlatformFile(PlatformFile file);
275 277
276 #if defined(OS_WIN) 278 #if defined(OS_WIN)
277 win::ScopedHandle file_; 279 win::ScopedHandle file_;
278 #elif defined(OS_POSIX) 280 #elif defined(OS_POSIX)
279 PlatformFile file_; 281 PlatformFile file_;
280 #endif 282 #endif
281 283
282 Error error_details_; 284 Error error_details_;
283 bool created_; 285 bool created_;
284 bool async_; 286 bool async_;
285 }; 287 };
286 288
287 } // namespace base 289 } // namespace base
288 290
289 #endif // BASE_FILES_FILE_H_ 291 #endif // BASE_FILES_FILE_H_
OLDNEW
« no previous file with comments | « base/file_util_unittest.cc ('k') | base/files/file_posix.cc » ('j') | net/base/file_stream.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698