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

Unified Diff: tools/imagediff/image_diff.cc

Issue 12217101: Replace FilePath with base::FilePath in some more top level directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/generate_library_loader/generate_library_loader.py ('k') | tools/memory_watcher/memory_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/imagediff/image_diff.cc
diff --git a/tools/imagediff/image_diff.cc b/tools/imagediff/image_diff.cc
index 19d5df9deef1920befe6f4d1ac895525f3ac1868..99d6282fc5a5a838329256e6debc72f10d6209a3 100644
--- a/tools/imagediff/image_diff.cc
+++ b/tools/imagediff/image_diff.cc
@@ -91,7 +91,7 @@ class Image {
// Creates the image from the given filename on disk, and returns true on
// success.
- bool CreateFromFilename(const FilePath& path) {
+ bool CreateFromFilename(const base::FilePath& path) {
FILE* f = file_util::OpenFile(path, "rb");
if (!f)
return false;
@@ -193,7 +193,7 @@ void PrintHelp() {
*/
}
-int CompareImages(const FilePath& file1, const FilePath& file2) {
+int CompareImages(const base::FilePath& file1, const base::FilePath& file2) {
Image actual_image;
Image baseline_image;
@@ -294,8 +294,8 @@ bool CreateImageDiff(const Image& image1, const Image& image2, Image* out) {
return same;
}
-int DiffImages(const FilePath& file1, const FilePath& file2,
- const FilePath& out_file) {
+int DiffImages(const base::FilePath& file1, const base::FilePath& file2,
+ const base::FilePath& out_file) {
Image actual_image;
Image baseline_image;
@@ -330,11 +330,11 @@ int DiffImages(const FilePath& file1, const FilePath& file2,
// It isn't strictly correct to only support ASCII paths, but this
// program reads paths on stdin and the program that spawns it outputs
// paths as non-wide strings anyway.
-FilePath FilePathFromASCII(const std::string& str) {
+base::FilePath FilePathFromASCII(const std::string& str) {
#if defined(OS_WIN)
- return FilePath(ASCIIToWide(str));
+ return base::FilePath(ASCIIToWide(str));
#else
- return FilePath(str);
+ return base::FilePath(str);
#endif
}
@@ -345,18 +345,18 @@ int main(int argc, const char* argv[]) {
if (parsed_command_line.HasSwitch(kOptionPollStdin)) {
// Watch stdin for filenames.
std::string stdin_buffer;
- FilePath filename1;
+ base::FilePath filename1;
while (std::getline(std::cin, stdin_buffer)) {
if (stdin_buffer.empty())
continue;
if (!filename1.empty()) {
// CompareImages writes results to stdout unless an error occurred.
- FilePath filename2 = FilePathFromASCII(stdin_buffer);
+ base::FilePath filename2 = FilePathFromASCII(stdin_buffer);
if (CompareImages(filename1, filename2) == kStatusError)
printf("error\n");
fflush(stdout);
- filename1 = FilePath();
+ filename1 = base::FilePath();
} else {
// Save the first filename in another buffer and wait for the second
// filename to arrive via stdin.
@@ -369,12 +369,12 @@ int main(int argc, const char* argv[]) {
const CommandLine::StringVector& args = parsed_command_line.GetArgs();
if (parsed_command_line.HasSwitch(kOptionGenerateDiff)) {
if (args.size() == 3) {
- return DiffImages(FilePath(args[0]),
- FilePath(args[1]),
- FilePath(args[2]));
+ return DiffImages(base::FilePath(args[0]),
+ base::FilePath(args[1]),
+ base::FilePath(args[2]));
}
} else if (args.size() == 2) {
- return CompareImages(FilePath(args[0]), FilePath(args[1]));
+ return CompareImages(base::FilePath(args[0]), base::FilePath(args[1]));
}
PrintHelp();
« no previous file with comments | « tools/generate_library_loader/generate_library_loader.py ('k') | tools/memory_watcher/memory_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698