31
31
#include " base/win/pe_image.h"
32
32
#include " base/win/registry.h"
33
33
#include " base/win/win_util.h"
34
+ #include " base/files/file_path.h"
35
+ #include " base/path_service.h"
34
36
#include " breakpad/src/client/windows/handler/exception_handler.h"
35
37
#include " components/breakpad/app/breakpad_client.h"
36
38
#include " components/breakpad/app/crash_keys_win.h"
@@ -547,8 +549,13 @@ void InitCrashReporter(const std::string& process_type_switch) {
547
549
#endif
548
550
549
551
// 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);
552
559
553
560
MINIDUMP_TYPE dump_type = kSmallDumpType ;
554
561
// Capture full memory if explicitly instructed to.
@@ -557,13 +564,13 @@ void InitCrashReporter(const std::string& process_type_switch) {
557
564
else if (GetBreakpadClient ()->GetShouldDumpLargerDumps (is_per_user_install))
558
565
dump_type = kLargerDumpType ;
559
566
560
- g_breakpad = new google_breakpad::ExceptionHandler (temp_dir , &FilterCallback,
567
+ g_breakpad = new google_breakpad::ExceptionHandler (dumps_path. value () , &FilterCallback,
561
568
callback, NULL ,
562
569
google_breakpad::ExceptionHandler::HANDLER_ALL,
563
570
dump_type, pipe_name.c_str (), custom_info);
564
571
565
572
// 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 () ,
567
574
&FilterCallbackWhenNoCrash,
568
575
&DumpDoneCallbackWhenNoCrash,
569
576
NULL ,
0 commit comments