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

Unified Diff: ipc/attachment_broker_privileged_mac.cc

Issue 1739203004: Add support for Attachment Brokering of IPC::Channels on multiple threads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows comiple error. Created 4 years, 10 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: ipc/attachment_broker_privileged_mac.cc
diff --git a/ipc/attachment_broker_privileged_mac.cc b/ipc/attachment_broker_privileged_mac.cc
index c5bed27c68df42db1a48998bdfb970da606c35bb..f900f1c229e075d27dd18deeb7184041c4308afa 100644
--- a/ipc/attachment_broker_privileged_mac.cc
+++ b/ipc/attachment_broker_privileged_mac.cc
@@ -214,8 +214,9 @@ bool AttachmentBrokerPrivilegedMac::RouteWireFormatToAnother(
// Another process is the destination.
base::ProcessId dest = wire_format.destination_process;
base::AutoLock auto_lock(*get_lock());
- Sender* sender = GetSenderWithProcessId(dest);
- if (!sender) {
+ AttachmentBrokerPrivileged::EndpointRunnerPair pair =
+ GetSenderWithProcessId(dest);
+ if (!pair.first) {
// Assuming that this message was not sent from a malicious process, the
// channel endpoint that would have received this message will block
// forever.
@@ -226,7 +227,8 @@ bool AttachmentBrokerPrivilegedMac::RouteWireFormatToAnother(
}
LogError(DESTINATION_FOUND);
- sender->Send(new AttachmentBrokerMsg_MachPortHasBeenDuplicated(wire_format));
+ SendMessageToEndpoint(
+ pair, new AttachmentBrokerMsg_MachPortHasBeenDuplicated(wire_format));
return true;
}
@@ -324,7 +326,9 @@ void AttachmentBrokerPrivilegedMac::SendPrecursorsForProcess(
if (!to_self) {
base::AutoLock auto_lock(*get_lock());
- if (!GetSenderWithProcessId(pid)) {
+ AttachmentBrokerPrivileged::EndpointRunnerPair pair =
+ GetSenderWithProcessId(pid);
+ if (!pair.first) {
// If there is no sender, then the destination process is no longer
// running, or never existed to begin with.
LogError(DESTINATION_NOT_FOUND);
@@ -394,7 +398,9 @@ void AttachmentBrokerPrivilegedMac::ProcessExtractorsForProcess(
{
base::AutoLock auto_lock(*get_lock());
- if (!GetSenderWithProcessId(pid)) {
+ AttachmentBrokerPrivileged::EndpointRunnerPair pair =
+ GetSenderWithProcessId(pid);
+ if (!pair.first) {
// If there is no sender, then the source process is no longer running.
LogError(ERROR_SOURCE_NOT_FOUND);
delete it->second;

Powered by Google App Engine
This is Rietveld 408576698