Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1567)

Unified Diff: content/browser/utility_process_host_impl.cc

Issue 19737002: Enable sandbox in local discovery utility process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/utility_process_host_impl.cc
diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc
index bf656748f02447ab591f1a242f71204a4ea9e669..6e9dfa725d75f3d6f98e0fecadef85e91dc6efba 100644
--- a/content/browser/utility_process_host_impl.cc
+++ b/content/browser/utility_process_host_impl.cc
@@ -111,6 +111,7 @@ UtilityProcessHostImpl::UtilityProcessHostImpl(
: client_(client),
client_task_runner_(client_task_runner),
is_batch_mode_(false),
+ is_mdns_enabled_(false),
no_sandbox_(false),
#if defined(OS_LINUX)
child_flags_(ChildProcessHost::CHILD_ALLOW_SELF),
@@ -123,7 +124,8 @@ UtilityProcessHostImpl::UtilityProcessHostImpl(
UtilityProcessHostImpl::~UtilityProcessHostImpl() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- DCHECK(!is_batch_mode_);
+ if (is_batch_mode_)
+ EndBatchMode();
}
bool UtilityProcessHostImpl::Send(IPC::Message* message) {
@@ -150,6 +152,10 @@ void UtilityProcessHostImpl::SetExposedDir(const base::FilePath& dir) {
exposed_dir_ = dir;
}
+void UtilityProcessHostImpl::EnableMDns() {
+ is_mdns_enabled_ = true;
+}
+
void UtilityProcessHostImpl::DisableSandbox() {
no_sandbox_ = true;
}
@@ -244,6 +250,9 @@ bool UtilityProcessHostImpl::StartProcess() {
cmd_line->AppendSwitchPath(switches::kUtilityProcessAllowedDir, exposed_dir_);
#endif
+ if (is_mdns_enabled_)
+ cmd_line->AppendSwitch(switches::kUtilityProcessEnableMDns);
+
bool use_zygote = false;
#if defined(OS_LINUX)

Powered by Google App Engine
This is Rietveld 408576698