Chromium Code Reviews| Index: tools/crashpad_database_util.cc |
| diff --git a/tools/crashpad_database_util.cc b/tools/crashpad_database_util.cc |
| index 12b37d65853831b1e4fe5129c6573847968c4185..26f633645f15a1aa00c22a1188bb3b82b1e1e815 100644 |
| --- a/tools/crashpad_database_util.cc |
| +++ b/tools/crashpad_database_util.cc |
| @@ -42,16 +42,6 @@ |
| #include <libgen.h> |
| #endif // OS_MACOSX |
| -#if defined(OS_POSIX) |
| -base::FilePath::StringType UTF8ToFilePathStringType(const char* path) { |
| - return path; |
| -} |
| -#elif defined(OS_WIN) |
| -base::FilePath::StringType UTF8ToFilePathStringType(const char* path) { |
| - return base::UTF8ToUTF16(path); |
| -} |
| -#endif |
| - |
| namespace crashpad { |
| namespace { |
| @@ -265,8 +255,8 @@ void ShowReports(const std::vector<CrashReportDatabase::Report>& reports, |
| } |
| int DatabaseUtilMain(int argc, char* argv[]) { |
| - const base::FilePath me( |
| - base::FilePath(UTF8ToFilePathStringType(argv[0])).BaseName()); |
| + const base::FilePath me(base::FilePath(ToolSupport::UTF8ToFilePathStringType( |
| + argv[0])).BaseName()); |
| enum OptionFlags { |
| // “Short” (single-character) options. |
| @@ -378,7 +368,7 @@ int DatabaseUtilMain(int argc, char* argv[]) { |
| } |
| case kOptionNewReport: { |
| options.new_report_paths.push_back( |
| - base::FilePath(UTF8ToFilePathStringType(optarg))); |
| + base::FilePath(ToolSupport::UTF8ToFilePathStringType(optarg))); |
| break; |
| } |
| case kOptionUTC: { |
| @@ -438,7 +428,7 @@ int DatabaseUtilMain(int argc, char* argv[]) { |
| } |
| scoped_ptr<CrashReportDatabase> database(CrashReportDatabase::Initialize( |
| - base::FilePath(UTF8ToFilePathStringType(options.database)))); |
| + base::FilePath(ToolSupport::UTF8ToFilePathStringType(options.database)))); |
| if (!database) { |
| return EXIT_FAILURE; |
| } |
| @@ -598,13 +588,6 @@ int main(int argc, char* argv[]) { |
| } |
| #elif defined(OS_WIN) |
| int wmain(int argc, wchar_t* argv[]) { |
| - scoped_ptr<char*[]> argv_as_utf8(new char*[argc]); |
| - std::vector<std::string> storage; |
| - storage.reserve(argc); |
| - for (int i = 0; i < argc; ++i) { |
| - storage.push_back(base::UTF16ToUTF8(argv[i])); |
| - argv_as_utf8[i] = &storage[i][0]; |
| - } |
| - return crashpad::DatabaseUtilMain(argc, argv_as_utf8.get()); |
| + return crashpad::ToolSupport::Wmain(argc, argv, &crashpad::DatabaseUtilMain); |
|
Mark Mentovai
2015/05/05 22:41:35
Ah, yup, you did it. :) I think you can skip the &
scottmg
2015/05/05 23:23:52
Done.
|
| } |
| #endif // OS_POSIX |