Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
run content scripts on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed Feb 23, 2016
1 parent 5f9d258 commit e2ca3ec
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions atom/app/atom_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,24 @@ void AtomMainDelegate::PreSandboxStartup() {
#endif
}

#if defined(OS_LINUX)
// Some processes are started by the zygote process on linux
// This will probably not work with the linux sandbox enabled
void AtomMainDelegate::ZygoteForked() {
auto command_line = base::CommandLine::ForCurrentProcess();
std::string process_type = command_line->GetSwitchValueASCII(
::switches::kProcessType);

if (process_type == ::switches::kUtilityProcess) {
AtomContentUtilityClient::PreSandboxStartup();
}

if (process_type == ::switches::kRendererProcess) {
AtomRendererClient::PreSandboxStartup();
}
}
#endif

content::ContentBrowserClient* AtomMainDelegate::CreateContentBrowserClient() {
browser_client_.reset(new AtomBrowserClient);
return browser_client_.get();
Expand Down
2 changes: 2 additions & 0 deletions atom/app/atom_main_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class AtomMainDelegate : public brightray::MainDelegate {
#if defined(OS_MACOSX)
void OverrideChildProcessPath() override;
void OverrideFrameworkBundlePath() override;
#elif defined(OS_LINUX)
void ZygoteForked() override;
#endif

private:
Expand Down

2 comments on commit e2ca3ec

@bridiver
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

auditors: @bbondy

@bbondy
Copy link
Member

@bbondy bbondy commented on e2ca3ec Feb 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

Please sign in to comment.