From 93a5c88a3dee7e27794bff3d8d92357495c7dfe7 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 5 Dec 2013 10:52:54 +0100 Subject: [PATCH] Bug 944913 - toolkit/crashreporter part r=ehsan --- toolkit/crashreporter/nsExceptionHandler.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index 4d1ba55013e9..16d46b3577ea 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -106,7 +106,6 @@ namespace CrashReporter { #ifdef XP_WIN32 typedef wchar_t XP_CHAR; typedef std::wstring xpstring; -#define CONVERT_UTF16_TO_XP_CHAR(x) x #define CONVERT_XP_CHAR_TO_UTF16(x) x #define XP_STRLEN(x) wcslen(x) #define my_strlen strlen @@ -126,7 +125,6 @@ typedef std::wstring xpstring; #else typedef char XP_CHAR; typedef std::string xpstring; -#define CONVERT_UTF16_TO_XP_CHAR(x) NS_ConvertUTF16toUTF8(x) #define CONVERT_XP_CHAR_TO_UTF16(x) NS_ConvertUTF8toUTF16(x) #define CRASH_REPORTER_FILENAME "crashreporter" #define PATH_SEPARATOR "/" @@ -871,7 +869,7 @@ nsresult SetExceptionHandler(nsIFile* aXREDirectory, nsString crashReporterPath_temp; exePath->GetPath(crashReporterPath_temp); - crashReporterPath = ToNewUnicode(crashReporterPath_temp); + crashReporterPath = reinterpret_cast(ToNewUnicode(crashReporterPath_temp)); #elif !defined(__ANDROID__) nsCString crashReporterPath_temp; @@ -1096,12 +1094,13 @@ nsresult SetMinidumpPath(const nsAString& aPath) if (!gExceptionHandler) return NS_ERROR_NOT_INITIALIZED; -#ifndef XP_LINUX - gExceptionHandler->set_dump_path( - CONVERT_UTF16_TO_XP_CHAR(aPath).BeginReading()); -#else +#ifdef XP_WIN32 + gExceptionHandler->set_dump_path(char16ptr_t(aPath.BeginReading())); +#elif defined(XP_LINUX) gExceptionHandler->set_minidump_descriptor( - MinidumpDescriptor(CONVERT_UTF16_TO_XP_CHAR(aPath).BeginReading())); + MinidumpDescriptor(NS_ConvertUTF16toUTF8(aPath).BeginReading())); +#else + gExceptionHandler->set_dump_path(NS_ConvertUTF16toUTF8(aPath).BeginReading()); #endif return NS_OK; } @@ -1922,7 +1921,7 @@ FindPendingDir() #ifdef XP_WIN nsString path; pendingDir->GetPath(path); - pendingDirectory = ToNewUnicode(path); + pendingDirectory = reinterpret_cast(ToNewUnicode(path)); #else nsCString path; pendingDir->GetNativePath(path); @@ -2503,7 +2502,7 @@ SetRemoteExceptionHandler(const nsACString& crashPipe) nullptr, // no callback context google_breakpad::ExceptionHandler::HANDLER_ALL, MiniDumpNormal, - NS_ConvertASCIItoUTF16(crashPipe).BeginReading(), + NS_ConvertASCIItoUTF16(crashPipe).get(), nullptr); #ifdef XP_WIN gExceptionHandler->set_handle_debug_exceptions(true);