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

Unified Diff: base/files/file_util_win.cc

Issue 786123002: Update from https://crrev.com/307330 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/debug/proc_maps_linux_unittest.cc ('k') | base/ios/ios_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/files/file_util_win.cc
diff --git a/base/files/file_util_win.cc b/base/files/file_util_win.cc
index b511d3cc8cd4ab067319558fa6269ecde2a4bbef..e254232f66305910e0bd64d0f2c7ab71b5e3fac2 100644
--- a/base/files/file_util_win.cc
+++ b/base/files/file_util_win.cc
@@ -480,7 +480,7 @@ bool DevicePathToDriveLetterPath(const FilePath& nt_device_path,
}
// Move to the next drive letter string, which starts one
// increment after the '\0' that terminates the current string.
- while (*drive_map_ptr++);
+ while (*drive_map_ptr++) {}
}
// No drive matched. The path does not start with a device junction
@@ -496,7 +496,7 @@ bool NormalizeToNativeFilePath(const FilePath& path, FilePath* nt_path) {
// code below to a call to GetFinalPathNameByHandle(). The method this
// function uses is explained in the following msdn article:
// http://msdn.microsoft.com/en-us/library/aa366789(VS.85).aspx
- base::win::ScopedHandle file_handle(
+ win::ScopedHandle file_handle(
::CreateFile(path.value().c_str(),
GENERIC_READ,
kFileShareAll,
@@ -510,7 +510,7 @@ bool NormalizeToNativeFilePath(const FilePath& path, FilePath* nt_path) {
// Create a file mapping object. Can't easily use MemoryMappedFile, because
// we only map the first byte, and need direct access to the handle. You can
// not map an empty file, this call fails in that case.
- base::win::ScopedHandle file_map_handle(
+ win::ScopedHandle file_map_handle(
::CreateFileMapping(file_handle.Get(),
NULL,
PAGE_READONLY,
@@ -575,7 +575,7 @@ bool GetFileInfo(const FilePath& file_path, File::Info* results) {
FILE* OpenFile(const FilePath& filename, const char* mode) {
ThreadRestrictions::AssertIOAllowed();
- std::wstring w_mode = ASCIIToWide(std::string(mode));
+ string16 w_mode = ASCIIToUTF16(mode);
return _wfsopen(filename.value().c_str(), w_mode.c_str(), _SH_DENYNO);
}
@@ -595,13 +595,13 @@ FILE* FileToFILE(File file, const char* mode) {
int ReadFile(const FilePath& filename, char* data, int max_size) {
ThreadRestrictions::AssertIOAllowed();
- base::win::ScopedHandle file(CreateFile(filename.value().c_str(),
- GENERIC_READ,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL,
- OPEN_EXISTING,
- FILE_FLAG_SEQUENTIAL_SCAN,
- NULL));
+ win::ScopedHandle file(CreateFile(filename.value().c_str(),
+ GENERIC_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ OPEN_EXISTING,
+ FILE_FLAG_SEQUENTIAL_SCAN,
+ NULL));
if (!file.IsValid())
return -1;
@@ -614,13 +614,13 @@ int ReadFile(const FilePath& filename, char* data, int max_size) {
int WriteFile(const FilePath& filename, const char* data, int size) {
ThreadRestrictions::AssertIOAllowed();
- base::win::ScopedHandle file(CreateFile(filename.value().c_str(),
- GENERIC_WRITE,
- 0,
- NULL,
- CREATE_ALWAYS,
- 0,
- NULL));
+ win::ScopedHandle file(CreateFile(filename.value().c_str(),
+ GENERIC_WRITE,
+ 0,
+ NULL,
+ CREATE_ALWAYS,
+ 0,
+ NULL));
if (!file.IsValid()) {
DPLOG(WARNING) << "CreateFile failed for path "
<< UTF16ToUTF8(filename.value());
@@ -646,13 +646,13 @@ int WriteFile(const FilePath& filename, const char* data, int size) {
bool AppendToFile(const FilePath& filename, const char* data, int size) {
ThreadRestrictions::AssertIOAllowed();
- base::win::ScopedHandle file(CreateFile(filename.value().c_str(),
- FILE_APPEND_DATA,
- 0,
- NULL,
- OPEN_EXISTING,
- 0,
- NULL));
+ win::ScopedHandle file(CreateFile(filename.value().c_str(),
+ FILE_APPEND_DATA,
+ 0,
+ NULL,
+ OPEN_EXISTING,
+ 0,
+ NULL));
if (!file.IsValid()) {
VPLOG(1) << "CreateFile failed for path " << UTF16ToUTF8(filename.value());
return false;
« no previous file with comments | « base/debug/proc_maps_linux_unittest.cc ('k') | base/ios/ios_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698