Skip to content

Commit 05a2391

Browse files
committed
Mac: support setting crash dump path
1 parent a36dede commit 05a2391

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/api/dispatcher_bindings.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,10 @@ void DispatcherBindings::CrashRenderer(
388388
// static
389389
void DispatcherBindings::SetCrashDumpDir(
390390
const v8::FunctionCallbackInfo<v8::Value>& args) {
391-
#if defined(OS_WIN)
391+
#if defined(OS_WIN) || defined(OS_MACOSX)
392392
std::string path = *v8::String::Utf8Value(args[0]);
393393
SetCrashDumpPath(path.c_str());
394-
#endif
394+
#endif
395395
}
396396

397397
// static

src/breakpad_mac.mm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,3 +281,10 @@ void InitCrashProcessInfo() {
281281
// Store process type in crash dump.
282282
SetCrashKeyValue(@"ptype", process_type);
283283
}
284+
285+
bool SetCrashDumpPath(const char* path) {
286+
if (!gBreakpadRef)
287+
return false;
288+
BreakpadSetKeyValue(gBreakpadRef, @BREAKPAD_DUMP_DIRECTORY, base::SysUTF8ToNSString(path));
289+
return true;
290+
}

0 commit comments

Comments
 (0)