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

Unified Diff: tools/crashpad_database_util.cc

Issue 1120383003: Get generate_dump compiling on Windows (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@tools
Patch Set: fix mac; no implicit conversion to std::string for StringPiece Created 5 years, 7 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 | « minidump/minidump_system_info_writer.cc ('k') | tools/generate_dump.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/crashpad_database_util.cc
diff --git a/tools/crashpad_database_util.cc b/tools/crashpad_database_util.cc
index bcb742c9f9c651837ed5384e1ea6086265ccc492..c06cb5768c5cdafd119f2de8d5c7c48a058b65ef 100644
--- a/tools/crashpad_database_util.cc
+++ b/tools/crashpad_database_util.cc
@@ -38,16 +38,6 @@
#include "util/file/file_reader.h"
#include "util/misc/uuid.h"
-#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 {
@@ -253,8 +243,9 @@ 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 argv0(
+ ToolSupport::CommandLineArgumentToFilePathStringType(argv[0]));
+ const base::FilePath me(argv0.BaseName());
enum OptionFlags {
// “Short” (single-character) options.
@@ -364,8 +355,8 @@ int DatabaseUtilMain(int argc, char* argv[]) {
break;
}
case kOptionNewReport: {
- options.new_report_paths.push_back(
- base::FilePath(UTF8ToFilePathStringType(optarg)));
+ options.new_report_paths.push_back(base::FilePath(
+ ToolSupport::CommandLineArgumentToFilePathStringType(optarg)));
break;
}
case kOptionUTC: {
@@ -425,7 +416,8 @@ int DatabaseUtilMain(int argc, char* argv[]) {
}
scoped_ptr<CrashReportDatabase> database(CrashReportDatabase::Initialize(
- base::FilePath(UTF8ToFilePathStringType(options.database))));
+ base::FilePath(ToolSupport::CommandLineArgumentToFilePathStringType(
+ options.database))));
if (!database) {
return EXIT_FAILURE;
}
@@ -585,13 +577,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);
}
#endif // OS_POSIX
« no previous file with comments | « minidump/minidump_system_info_writer.cc ('k') | tools/generate_dump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698