mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: Expose missing Add/RemoveExtraParameter methods to macOS node child processes (#15790)
* Expose missing crash reporter methods in mac node processes * Crashpad migration
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "shell/app/node_main.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/command_line.h"
|
||||
@@ -31,6 +32,16 @@
|
||||
|
||||
namespace electron {
|
||||
|
||||
#if !defined(OS_LINUX)
|
||||
void AddExtraParameter(const std::string& key, const std::string& value) {
|
||||
crash_reporter::CrashReporter::GetInstance()->AddExtraParameter(key, value);
|
||||
}
|
||||
|
||||
void RemoveExtraParameter(const std::string& key) {
|
||||
crash_reporter::CrashReporter::GetInstance()->RemoveExtraParameter(key);
|
||||
}
|
||||
#endif
|
||||
|
||||
int NodeMain(int argc, char* argv[]) {
|
||||
base::CommandLine::Init(argc, argv);
|
||||
|
||||
@@ -87,6 +98,12 @@ int NodeMain(int argc, char* argv[]) {
|
||||
// Setup process.crashReporter.start in child node processes
|
||||
auto reporter = mate::Dictionary::CreateEmpty(gin_env.isolate());
|
||||
reporter.SetMethod("start", &crash_reporter::CrashReporter::StartInstance);
|
||||
|
||||
#if !defined(OS_LINUX)
|
||||
reporter.SetMethod("addExtraParameter", &AddExtraParameter);
|
||||
reporter.SetMethod("removeExtraParameter", &RemoveExtraParameter);
|
||||
#endif
|
||||
|
||||
process.Set("crashReporter", reporter);
|
||||
|
||||
mate::Dictionary versions;
|
||||
|
||||
Reference in New Issue
Block a user