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 #ifdef XP_WIN32
typedef wchar_t XP_CHAR; typedef wchar_t XP_CHAR;
typedef std::wstring xpstring; typedef std::wstring xpstring;
#define CONVERT_UTF16_TO_XP_CHAR(x) x
#define CONVERT_XP_CHAR_TO_UTF16(x) x #define CONVERT_XP_CHAR_TO_UTF16(x) x
#define XP_STRLEN(x) wcslen(x) #define XP_STRLEN(x) wcslen(x)
#define my_strlen strlen #define my_strlen strlen
@ -126,7 +125,6 @@ typedef std::wstring xpstring;
#else #else
typedef char XP_CHAR; typedef char XP_CHAR;
typedef std::string xpstring; 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 CONVERT_XP_CHAR_TO_UTF16(x) NS_ConvertUTF8toUTF16(x)
#define CRASH_REPORTER_FILENAME "crashreporter" #define CRASH_REPORTER_FILENAME "crashreporter"
#define PATH_SEPARATOR "/" #define PATH_SEPARATOR "/"
@ -871,7 +869,7 @@ nsresult SetExceptionHandler(nsIFile* aXREDirectory,
nsString crashReporterPath_temp; nsString crashReporterPath_temp;
exePath->GetPath(crashReporterPath_temp); exePath->GetPath(crashReporterPath_temp);
crashReporterPath = ToNewUnicode(crashReporterPath_temp); crashReporterPath = reinterpret_cast<wchar_t*>(ToNewUnicode(crashReporterPath_temp));
#elif !defined(__ANDROID__) #elif !defined(__ANDROID__)
nsCString crashReporterPath_temp; nsCString crashReporterPath_temp;
@ -1096,12 +1094,13 @@ nsresult SetMinidumpPath(const nsAString& aPath)
if (!gExceptionHandler) if (!gExceptionHandler)
return NS_ERROR_NOT_INITIALIZED; return NS_ERROR_NOT_INITIALIZED;
#ifndef XP_LINUX #ifdef XP_WIN32
gExceptionHandler->set_dump_path( gExceptionHandler->set_dump_path(char16ptr_t(aPath.BeginReading()));
CONVERT_UTF16_TO_XP_CHAR(aPath).BeginReading()); #elif defined(XP_LINUX)
#else
gExceptionHandler->set_minidump_descriptor( 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 #endif
return NS_OK; return NS_OK;
} }
@ -1922,7 +1921,7 @@ FindPendingDir()
#ifdef XP_WIN #ifdef XP_WIN
nsString path; nsString path;
pendingDir->GetPath(path); pendingDir->GetPath(path);
pendingDirectory = ToNewUnicode(path); pendingDirectory = reinterpret_cast<wchar_t*>(ToNewUnicode(path));
#else #else
nsCString path; nsCString path;
pendingDir->GetNativePath(path); pendingDir->GetNativePath(path);
@ -2503,7 +2502,7 @@ SetRemoteExceptionHandler(const nsACString& crashPipe)
nullptr, // no callback context nullptr, // no callback context
google_breakpad::ExceptionHandler::HANDLER_ALL, google_breakpad::ExceptionHandler::HANDLER_ALL,
MiniDumpNormal, MiniDumpNormal,
NS_ConvertASCIItoUTF16(crashPipe).BeginReading(), NS_ConvertASCIItoUTF16(crashPipe).get(),
nullptr); nullptr);
#ifdef XP_WIN #ifdef XP_WIN
gExceptionHandler->set_handle_debug_exceptions(true); gExceptionHandler->set_handle_debug_exceptions(true);