fix: trace-startup crashing child process on macOS (#44257)
This commit is contained in:
parent
df45474b58
commit
af6e2fb257
4 changed files with 44 additions and 13 deletions
|
@ -23,6 +23,13 @@ int ElectronMain(int argc, char* argv[]) {
|
|||
params.argc = argc;
|
||||
params.argv = const_cast<const char**>(argv);
|
||||
electron::ElectronCommandLine::Init(argc, argv);
|
||||
|
||||
// Ensure that Bundle Id is set before ContentMain.
|
||||
// Refs https://chromium-review.googlesource.com/c/chromium/src/+/5581006
|
||||
delegate.OverrideChildProcessPath();
|
||||
delegate.OverrideFrameworkBundlePath();
|
||||
delegate.SetUpBundleOverrides();
|
||||
|
||||
return content::ContentMain(std::move(params));
|
||||
}
|
||||
|
||||
|
|
|
@ -271,12 +271,6 @@ std::optional<int> ElectronMainDelegate::BasicStartupComplete() {
|
|||
kNonWildcardDomainNonPortSchemes, kNonWildcardDomainNonPortSchemesSize);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
OverrideChildProcessPath();
|
||||
OverrideFrameworkBundlePath();
|
||||
SetUpBundleOverrides();
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Ignore invalid parameter errors.
|
||||
_set_invalid_parameter_handler(InvalidParameterHandler);
|
||||
|
|
|
@ -34,6 +34,12 @@ class ElectronMainDelegate : public content::ContentMainDelegate {
|
|||
ElectronMainDelegate(const ElectronMainDelegate&) = delete;
|
||||
ElectronMainDelegate& operator=(const ElectronMainDelegate&) = delete;
|
||||
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
void OverrideChildProcessPath();
|
||||
void OverrideFrameworkBundlePath();
|
||||
void SetUpBundleOverrides();
|
||||
#endif
|
||||
|
||||
protected:
|
||||
// content::ContentMainDelegate:
|
||||
std::string_view GetBrowserV8SnapshotFilename() override;
|
||||
|
@ -57,12 +63,6 @@ class ElectronMainDelegate : public content::ContentMainDelegate {
|
|||
#endif
|
||||
|
||||
private:
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
void OverrideChildProcessPath();
|
||||
void OverrideFrameworkBundlePath();
|
||||
void SetUpBundleOverrides();
|
||||
#endif
|
||||
|
||||
std::unique_ptr<content::ContentBrowserClient> browser_client_;
|
||||
std::unique_ptr<content::ContentClient> content_client_;
|
||||
std::unique_ptr<content::ContentGpuClient> gpu_client_;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue