From 7092fa31a4dd02905327b6babb97586a994502f6 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Fri, 14 Sep 2018 17:07:49 -0700 Subject: [PATCH] kNoSandbox moved into service_manager --- atom/app/atom_main_delegate.cc | 4 ++-- atom/browser/api/atom_api_app.cc | 3 ++- atom/browser/web_contents_preferences.cc | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/atom/app/atom_main_delegate.cc b/atom/app/atom_main_delegate.cc index 31f548dbb64..8109291dc58 100644 --- a/atom/app/atom_main_delegate.cc +++ b/atom/app/atom_main_delegate.cc @@ -145,7 +145,7 @@ void AtomMainDelegate::PreSandboxStartup() { service_manager::switches::kDisableSetuidSandbox); } else { // Disable renderer sandbox for most of node's functions. - command_line->AppendSwitch(::switches::kNoSandbox); + command_line->AppendSwitch(service_manager::switches::kNoSandbox); } } @@ -168,7 +168,7 @@ AtomMainDelegate::CreateContentRendererClient() { if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableSandbox) || !base::CommandLine::ForCurrentProcess()->HasSwitch( - ::switches::kNoSandbox)) { + service_manager::switches::kNoSandbox)) { renderer_client_.reset(new AtomSandboxedRendererClient); } else { renderer_client_.reset(new AtomRendererClient); diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 220b6a14ea2..dd9e15c44bd 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -50,6 +50,7 @@ #include "net/ssl/client_cert_identity.h" #include "net/ssl/ssl_cert_request_info.h" #include "services/network/public/cpp/network_switches.h" +#include "services/service_manager/sandbox/switches.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/image/image.h" @@ -1188,7 +1189,7 @@ void App::EnableMixedSandbox(mate::Arguments* args) { } auto* command_line = base::CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(::switches::kNoSandbox)) { + if (command_line->HasSwitch(service_manager::switches::kNoSandbox)) { #if defined(OS_WIN) const base::CommandLine::CharType* noSandboxArg = L"--no-sandbox"; #else diff --git a/atom/browser/web_contents_preferences.cc b/atom/browser/web_contents_preferences.cc index 6a0e3dacdcd..da06856f059 100644 --- a/atom/browser/web_contents_preferences.cc +++ b/atom/browser/web_contents_preferences.cc @@ -24,6 +24,7 @@ #include "content/public/common/web_preferences.h" #include "native_mate/dictionary.h" #include "net/base/filename_util.h" +#include "services/service_manager/sandbox/switches.h" #if defined(OS_WIN) #include "ui/gfx/switches.h" @@ -245,7 +246,7 @@ void WebContentsPreferences::AppendCommandLineSwitches( if (IsEnabled(options::kSandbox)) command_line->AppendSwitch(switches::kEnableSandbox); else if (!command_line->HasSwitch(switches::kEnableSandbox)) - command_line->AppendSwitch(::switches::kNoSandbox); + command_line->AppendSwitch(service_manager::switches::kNoSandbox); // Check if nativeWindowOpen is enabled. if (IsEnabled(options::kNativeWindowOpen))