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

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

Issue 1752233002: Convert Pass()→std::move() on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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
« no previous file with comments | « no previous file | base/memory/scoped_ptr_unittest.cc » ('j') | 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 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 &other_handle, 263 &other_handle,
264 0, // dwDesiredAccess ignored due to SAME_ACCESS 264 0, // dwDesiredAccess ignored due to SAME_ACCESS
265 FALSE, // !bInheritHandle 265 FALSE, // !bInheritHandle
266 DUPLICATE_SAME_ACCESS)) { 266 DUPLICATE_SAME_ACCESS)) {
267 return File(OSErrorToFileError(GetLastError())); 267 return File(OSErrorToFileError(GetLastError()));
268 } 268 }
269 269
270 File other(other_handle); 270 File other(other_handle);
271 if (async()) 271 if (async())
272 other.async_ = true; 272 other.async_ = true;
273 return other.Pass(); 273 return other;
274 } 274 }
275 275
276 // Static. 276 // Static.
277 File::Error File::OSErrorToFileError(DWORD last_error) { 277 File::Error File::OSErrorToFileError(DWORD last_error) {
278 switch (last_error) { 278 switch (last_error) {
279 case ERROR_SHARING_VIOLATION: 279 case ERROR_SHARING_VIOLATION:
280 return FILE_ERROR_IN_USE; 280 return FILE_ERROR_IN_USE;
281 case ERROR_FILE_EXISTS: 281 case ERROR_FILE_EXISTS:
282 return FILE_ERROR_EXISTS; 282 return FILE_ERROR_EXISTS;
283 case ERROR_FILE_NOT_FOUND: 283 case ERROR_FILE_NOT_FOUND:
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 ThreadRestrictions::AssertIOAllowed(); 400 ThreadRestrictions::AssertIOAllowed();
401 DCHECK(IsValid()); 401 DCHECK(IsValid());
402 return ::FlushFileBuffers(file_.Get()) != FALSE; 402 return ::FlushFileBuffers(file_.Get()) != FALSE;
403 } 403 }
404 404
405 void File::SetPlatformFile(PlatformFile file) { 405 void File::SetPlatformFile(PlatformFile file) {
406 file_.Set(file); 406 file_.Set(file);
407 } 407 }
408 408
409 } // namespace base 409 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/memory/scoped_ptr_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698