Skip to content

Commit a582661

Browse files
author
Cong Liu
committed
Merge branch 'pull-34' into custom
2 parents ea75db7 + 330c53d commit a582661

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

components/breakpad/app/breakpad_win.cc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include "base/win/pe_image.h"
3232
#include "base/win/registry.h"
3333
#include "base/win/win_util.h"
34+
#include "base/files/file_path.h"
35+
#include "base/path_service.h"
3436
#include "breakpad/src/client/windows/handler/exception_handler.h"
3537
#include "components/breakpad/app/breakpad_client.h"
3638
#include "components/breakpad/app/crash_keys_win.h"
@@ -547,8 +549,13 @@ void InitCrashReporter(const std::string& process_type_switch) {
547549
#endif
548550

549551
// Get the alternate dump directory. We use the temp path.
550-
wchar_t temp_dir[MAX_PATH] = {0};
551-
::GetTempPathW(MAX_PATH, temp_dir);
552+
// wchar_t temp_dir[MAX_PATH] = {0};
553+
// ::GetTempPathW(MAX_PATH, temp_dir);
554+
base::FilePath tmp_path(L"");
555+
PathService::Get(base::DIR_TEMP, &tmp_path);
556+
557+
base::FilePath dumps_path(tmp_path);
558+
GetBreakpadClient()->GetCrashDumpLocation(&dumps_path);
552559

553560
MINIDUMP_TYPE dump_type = kSmallDumpType;
554561
// Capture full memory if explicitly instructed to.
@@ -557,13 +564,13 @@ void InitCrashReporter(const std::string& process_type_switch) {
557564
else if (GetBreakpadClient()->GetShouldDumpLargerDumps(is_per_user_install))
558565
dump_type = kLargerDumpType;
559566

560-
g_breakpad = new google_breakpad::ExceptionHandler(temp_dir, &FilterCallback,
567+
g_breakpad = new google_breakpad::ExceptionHandler(dumps_path.value(), &FilterCallback,
561568
callback, NULL,
562569
google_breakpad::ExceptionHandler::HANDLER_ALL,
563570
dump_type, pipe_name.c_str(), custom_info);
564571

565572
// Now initialize the non crash dump handler.
566-
g_dumphandler_no_crash = new google_breakpad::ExceptionHandler(temp_dir,
573+
g_dumphandler_no_crash = new google_breakpad::ExceptionHandler(dumps_path.value(),
567574
&FilterCallbackWhenNoCrash,
568575
&DumpDoneCallbackWhenNoCrash,
569576
NULL,

0 commit comments

Comments
 (0)