| 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;
|
|
|