Bug 944913 - toolkit/crashreporter part r=ehsan

This commit is contained in:
Jacek Caban 2013-12-05 10:52:54 +01:00
Родитель 91a4efcefe
Коммит 93a5c88a3d
1 изменённых файлов: 9 добавлений и 10 удалений

Просмотреть файл

@ -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<wchar_t*>(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<wchar_t*>(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);