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

Unified Diff: ipc/attachment_broker_privileged_mac.cc

Issue 1414603003: ipc: Move AttachmentBrokerPrivileged singleton logic into ipc/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor formatting. Created 5 years, 2 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 | « ipc/attachment_broker_privileged_mac.h ('k') | ipc/attachment_broker_privileged_mac_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/attachment_broker_privileged_mac.cc
diff --git a/ipc/attachment_broker_privileged_mac.cc b/ipc/attachment_broker_privileged_mac.cc
index e1cec933a7ba3360d0b1c422b44643de58e5a5bf..0492d2cf592b81653734cd2c219baf1396db1198 100644
--- a/ipc/attachment_broker_privileged_mac.cc
+++ b/ipc/attachment_broker_privileged_mac.cc
@@ -53,7 +53,10 @@ kern_return_t SendMachPort(mach_port_t endpoint,
namespace IPC {
-AttachmentBrokerPrivilegedMac::AttachmentBrokerPrivilegedMac() {}
+AttachmentBrokerPrivilegedMac::AttachmentBrokerPrivilegedMac(
+ base::PortProvider* port_provider)
+ : port_provider_(port_provider) {}
+
AttachmentBrokerPrivilegedMac::~AttachmentBrokerPrivilegedMac() {}
bool AttachmentBrokerPrivilegedMac::SendAttachmentToProcess(
@@ -173,7 +176,7 @@ mach_port_name_t AttachmentBrokerPrivilegedMac::CreateIntermediateMachPort(
base::ProcessId pid,
base::mac::ScopedMachSendRight port_to_insert) {
DCHECK_NE(pid, base::GetCurrentProcId());
- mach_port_t task_port = port_provider()->TaskForPid(pid);
+ mach_port_t task_port = port_provider_->TaskForPid(pid);
if (task_port == MACH_PORT_NULL) {
// TODO(erikchen): UMA metric.
return MACH_PORT_NULL;
@@ -248,7 +251,7 @@ base::mac::ScopedMachSendRight AttachmentBrokerPrivilegedMac::AcquireSendRight(
return base::mac::ScopedMachSendRight(named_right);
}
- mach_port_t task_port = port_provider()->TaskForPid(pid);
+ mach_port_t task_port = port_provider_->TaskForPid(pid);
return ExtractNamedRight(task_port, named_right);
}
« no previous file with comments | « ipc/attachment_broker_privileged_mac.h ('k') | ipc/attachment_broker_privileged_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698