[go: nahoru, domu]

[base] Use std::wstring for FilePath::StringType on Windows

This change modifies base::FilePath::StringType to be std::wstring on
Windows and updates affected code.

Bug: 911896
Change-Id: I243053a4e2117e3b4c5987a944aa8ea052c0d15f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1891192
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Robert Liao <robliao@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711766}
diff --git a/base/files/file_util.cc b/base/files/file_util.cc
index 846dec75..0ae3784 100644
--- a/base/files/file_util.cc
+++ b/base/files/file_util.cc
@@ -45,9 +45,9 @@
   // we are just comparing that bytes are exactly same in both files and not
   // doing anything smart with text formatting.
 #if defined(OS_WIN)
-  std::ifstream file1(as_wcstr(filename1.value()),
+  std::ifstream file1(filename1.value().c_str(),
                       std::ios::in | std::ios::binary);
-  std::ifstream file2(as_wcstr(filename2.value()),
+  std::ifstream file2(filename2.value().c_str(),
                       std::ios::in | std::ios::binary);
 #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
   std::ifstream file1(filename1.value(), std::ios::in | std::ios::binary);
@@ -81,8 +81,8 @@
 
 bool TextContentsEqual(const FilePath& filename1, const FilePath& filename2) {
 #if defined(OS_WIN)
-  std::ifstream file1(as_wcstr(filename1.value()), std::ios::in);
-  std::ifstream file2(as_wcstr(filename2.value()), std::ios::in);
+  std::ifstream file1(filename1.value().c_str(), std::ios::in);
+  std::ifstream file2(filename2.value().c_str(), std::ios::in);
 #elif defined(OS_POSIX) || defined(OS_FUCHSIA)
   std::ifstream file1(filename1.value(), std::ios::in);
   std::ifstream file2(filename2.value(), std::ios::in);