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

Unified Diff: ipc/attachment_broker_privileged_mac.cc

Issue 1420763002: ipc: Move methods into AttachmentBroker interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« ipc/attachment_broker.h ('K') | « ipc/attachment_broker_privileged_mac.h ('k') | no next file » | 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 29e78334cb47ce78058973cc1197ee786b04f18f..243911ff3bf2d662d0f848236b90d363425386c1 100644
--- a/ipc/attachment_broker_privileged_mac.cc
+++ b/ipc/attachment_broker_privileged_mac.cc
@@ -6,6 +6,7 @@
#include "base/mac/scoped_mach_port.h"
#include "base/memory/shared_memory.h"
+#include "base/process/port_provider_mac.h"
#include "base/process/process.h"
#include "ipc/attachment_broker_messages.h"
#include "ipc/brokerable_attachment.h"
@@ -52,17 +53,9 @@ kern_return_t SendMachPort(mach_port_t endpoint,
namespace IPC {
-AttachmentBrokerPrivilegedMac::AttachmentBrokerPrivilegedMac()
- : port_provider_(nullptr) {}
-
+AttachmentBrokerPrivilegedMac::AttachmentBrokerPrivilegedMac() {}
AttachmentBrokerPrivilegedMac::~AttachmentBrokerPrivilegedMac() {}
-void AttachmentBrokerPrivilegedMac::SetPortProvider(
- base::PortProvider* port_provider) {
- CHECK(!port_provider_);
- port_provider_ = port_provider;
-}
-
bool AttachmentBrokerPrivilegedMac::SendAttachmentToProcess(
BrokerableAttachment* attachment,
base::ProcessId destination_process) {
@@ -180,7 +173,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 = get_port_provider()->TaskForPid(pid);
if (task_port == MACH_PORT_NULL) {
// TODO(erikchen): UMA metric.
return MACH_PORT_NULL;
@@ -254,7 +247,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 = get_port_provider()->TaskForPid(pid);
return ExtractNamedRight(task_port, named_right);
}
« ipc/attachment_broker.h ('K') | « ipc/attachment_broker_privileged_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698