Only call UTF8ToUTF16 on Windows

This commit is contained in:
Kevin Sawicki 2016-10-06 09:14:16 -07:00
parent 84b7bb29f0
commit 30c6ca6751
2 changed files with 8 additions and 3 deletions

View file

@ -601,7 +601,7 @@ base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) {
if (key >= 0) if (key >= 0)
succeed = PathService::Get(key, &path); succeed = PathService::Get(key, &path);
if (!succeed) if (!succeed)
args->ThrowError("Failed to get path"); args->ThrowError("Failed to get '" + name + "' path");
return path; return path;
} }
@ -609,7 +609,7 @@ void App::SetPath(mate::Arguments* args,
const std::string& name, const std::string& name,
const base::FilePath& path) { const base::FilePath& path) {
if (!path.IsAbsolute()) { if (!path.IsAbsolute()) {
args->ThrowError("path must be absolute"); args->ThrowError("Path must be absolute");
return; return;
} }

View file

@ -38,7 +38,12 @@ void CrashReporter::Start(const std::string& product_name,
base::FilePath CrashReporter::GetCrashesDirectory( base::FilePath CrashReporter::GetCrashesDirectory(
const std::string& product_name, const base::FilePath& temp_path) { const std::string& product_name, const base::FilePath& temp_path) {
return temp_path.Append(base::UTF8ToUTF16(product_name + " Crashes")); std::string folder_name = product_name + " Crashes";
#if defined(OS_WIN)
return temp_path.Append(base::UTF8ToUTF16(folder_name));
#else
return temp_path.Append(folder_name);
#endif
} }
void CrashReporter::SetUploadParameters(const StringMap& parameters) { void CrashReporter::SetUploadParameters(const StringMap& parameters) {