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

Unified Diff: content/browser/mach_broker_mac.mm

Issue 341073005: Define a bootstrap sandbox policy for renderer processes and enable it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allow com.apple.windowserver.active Created 6 years, 6 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
« no previous file with comments | « content/browser/mach_broker_mac.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/mach_broker_mac.mm
diff --git a/content/browser/mach_broker_mac.mm b/content/browser/mach_broker_mac.mm
index e4ee38e09b2f4cc7c5886f4e62c29c293ddee94a..1c9e6e55bd85674e7f83c45be7a13857fda5d9c2 100644
--- a/content/browser/mach_broker_mac.mm
+++ b/content/browser/mach_broker_mac.mm
@@ -132,6 +132,7 @@ class MachListenerThreadDelegate : public base::PlatformThread::Delegate {
DISALLOW_COPY_AND_ASSIGN(MachListenerThreadDelegate);
};
+// static
bool MachBroker::ChildSendTaskPortToParent() {
// Look up the named MachBroker port that's been registered with the
// bootstrap server.
@@ -167,6 +168,17 @@ bool MachBroker::ChildSendTaskPortToParent() {
return true;
}
+// static
+std::string MachBroker::GetMachPortName() {
+ const CommandLine* command_line = CommandLine::ForCurrentProcess();
+ const bool is_child = command_line->HasSwitch(switches::kProcessType);
+
+ // In non-browser (child) processes, use the parent's pid.
+ const pid_t pid = is_child ? getppid() : getpid();
+ return base::StringPrintf("%s.rohitfork.%d", base::mac::BaseBundleID(), pid);
+}
+
+// static
MachBroker* MachBroker::GetInstance() {
return Singleton<MachBroker, LeakySingletonTraits<MachBroker> >::get();
}
@@ -274,16 +286,6 @@ void MachBroker::InvalidatePid(base::ProcessHandle pid) {
mach_map_.erase(it);
}
-// static
-std::string MachBroker::GetMachPortName() {
- const CommandLine* command_line = CommandLine::ForCurrentProcess();
- const bool is_child = command_line->HasSwitch(switches::kProcessType);
-
- // In non-browser (child) processes, use the parent's pid.
- const pid_t pid = is_child ? getppid() : getpid();
- return base::StringPrintf("%s.rohitfork.%d", base::mac::BaseBundleID(), pid);
-}
-
void MachBroker::RegisterNotifications() {
registrar_.Add(this, NOTIFICATION_RENDERER_PROCESS_CLOSED,
NotificationService::AllBrowserContextsAndSources());
« no previous file with comments | « content/browser/mach_broker_mac.h ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698