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

Side by Side Diff: trunk/src/base/files/file_win.cc

Issue 202493007: Revert 257577 "Revert 257562 "Base: Make base::File use ScopedFD..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
« no previous file with comments | « trunk/src/base/files/file_posix.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "base/files/file.h" 5 #include "base/files/file.h"
6 6
7 #include <io.h> 7 #include <io.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 else if (flags & (FLAG_CREATE_ALWAYS | FLAG_CREATE)) 92 else if (flags & (FLAG_CREATE_ALWAYS | FLAG_CREATE))
93 created_ = true; 93 created_ = true;
94 } else { 94 } else {
95 error_details_ = OSErrorToFileError(GetLastError()); 95 error_details_ = OSErrorToFileError(GetLastError());
96 } 96 }
97 } 97 }
98 98
99 bool File::IsValid() const { 99 bool File::IsValid() const {
100 return file_.IsValid(); 100 return file_.IsValid();
101 } 101 }
102
103 PlatformFile File::GetPlatformFile() const {
104 return file_;
105 }
106
102 PlatformFile File::TakePlatformFile() { 107 PlatformFile File::TakePlatformFile() {
103 return file_.Take(); 108 return file_.Take();
104 } 109 }
105 110
106 void File::Close() { 111 void File::Close() {
107 if (file_.IsValid()) { 112 if (file_.IsValid()) {
108 base::ThreadRestrictions::AssertIOAllowed(); 113 base::ThreadRestrictions::AssertIOAllowed();
109 file_.Close(); 114 file_.Close();
110 } 115 }
111 } 116 }
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 last_error); 339 last_error);
335 return FILE_ERROR_FAILED; 340 return FILE_ERROR_FAILED;
336 } 341 }
337 } 342 }
338 343
339 void File::SetPlatformFile(PlatformFile file) { 344 void File::SetPlatformFile(PlatformFile file) {
340 file_.Set(file); 345 file_.Set(file);
341 } 346 }
342 347
343 } // namespace base 348 } // namespace base
OLDNEW
« no previous file with comments | « trunk/src/base/files/file_posix.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698