summaryrefslogtreecommitdiffstats
path: root/tools/imagediff
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-08 17:49:05 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-08 17:49:05 +0000
commit63597e4ebc117bb561b93f4d775d787120e6728a (patch)
treea4825625ef2ff06b339e56a30fa5ae80aea29160 /tools/imagediff
parentc48abb01ae7e295e283f190bd05270e835b8d37f (diff)
downloadchromium_src-63597e4ebc117bb561b93f4d775d787120e6728a.zip
chromium_src-63597e4ebc117bb561b93f4d775d787120e6728a.tar.gz
chromium_src-63597e4ebc117bb561b93f4d775d787120e6728a.tar.bz2
Deprecate most of the remaining wstring file_util functions.
These still exist on Windows due to being used by the installer, but by moving them into the Windows-only block we prevent them from being used in new code. (I am already finding new code using some of these! I am glad to be rid of them.) BUG=24672 Review URL: http://codereview.chromium.org/2850042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51862 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/imagediff')
-rw-r--r--tools/imagediff/image_diff.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/imagediff/image_diff.cc b/tools/imagediff/image_diff.cc
index 7c16dcd..e629a85 100644
--- a/tools/imagediff/image_diff.cc
+++ b/tools/imagediff/image_diff.cc
@@ -89,7 +89,8 @@ class Image {
// Creates the image from the given filename on disk, and returns true on
// success.
bool CreateFromFilename(const char* filename) {
- FILE* f = file_util::OpenFile(std::string(filename), "rb");
+ FilePath path = FilePath::FromWStringHack(ASCIIToWide(filename));
+ FILE* f = file_util::OpenFile(path, "rb");
if (!f)
return false;
@@ -311,7 +312,8 @@ int DiffImages(const char* file1, const char* file2, const char* out_file) {
gfx::PNGCodec::Encode(diff_image.data(), gfx::PNGCodec::FORMAT_RGBA,
diff_image.w(), diff_image.h(), diff_image.w() * 4,
false, &png_encoding);
- if (file_util::WriteFile(UTF8ToWide(out_file),
+ FilePath out_path = FilePath::FromWStringHack(ASCIIToWide(out_file));
+ if (file_util::WriteFile(out_path,
reinterpret_cast<char*>(&png_encoding.front()), png_encoding.size()) < 0)
return kStatusError;