diff --git a/app/atom_main_delegate.cc b/app/atom_main_delegate.cc index 3bf4249923..0867aa9b95 100644 --- a/app/atom_main_delegate.cc +++ b/app/atom_main_delegate.cc @@ -4,7 +4,9 @@ #include "app/atom_main_delegate.h" +#include "base/command_line.h" #include "browser/atom_browser_client.h" +#include "content/public/common/content_switches.h" #include "renderer/atom_renderer_client.h" namespace atom { @@ -15,6 +17,14 @@ AtomMainDelegate::AtomMainDelegate() { AtomMainDelegate::~AtomMainDelegate() { } +void AtomMainDelegate::PreSandboxStartup() { + brightray::MainDelegate::PreSandboxStartup(); + + // Disable renderer sandbox for most of node's functions. + CommandLine* command_line = CommandLine::ForCurrentProcess(); + command_line->AppendSwitch(switches::kNoSandbox); +} + content::ContentBrowserClient* AtomMainDelegate::CreateContentBrowserClient() { browser_client_.reset(new AtomBrowserClient); return browser_client_.get(); diff --git a/app/atom_main_delegate.h b/app/atom_main_delegate.h index 7ca7932588..2ff8af6a1d 100644 --- a/app/atom_main_delegate.h +++ b/app/atom_main_delegate.h @@ -14,6 +14,9 @@ class AtomMainDelegate : public brightray::MainDelegate { AtomMainDelegate(); ~AtomMainDelegate(); +protected: + virtual void PreSandboxStartup() OVERRIDE; + private: virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; virtual content::ContentRendererClient*