1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ipc/attachment_broker_privileged.h"
9 #include "ipc/ipc_endpoint.h"
13 AttachmentBrokerPrivileged::AttachmentBrokerPrivileged() {}
15 AttachmentBrokerPrivileged::~AttachmentBrokerPrivileged() {}
17 void AttachmentBrokerPrivileged::RegisterCommunicationChannel(
19 endpoint
->SetAttachmentBrokerEndpoint(true);
20 auto it
= std::find(endpoints_
.begin(), endpoints_
.end(), endpoint
);
21 DCHECK(endpoints_
.end() == it
);
22 endpoints_
.push_back(endpoint
);
25 void AttachmentBrokerPrivileged::DeregisterCommunicationChannel(
27 auto it
= std::find(endpoints_
.begin(), endpoints_
.end(), endpoint
);
28 if (it
!= endpoints_
.end())
32 Sender
* AttachmentBrokerPrivileged::GetSenderWithProcessId(base::ProcessId id
) {
33 auto it
= std::find_if(endpoints_
.begin(), endpoints_
.end(),
34 [id
](Endpoint
* c
) { return c
->GetPeerPID() == id
; });
35 if (it
== endpoints_
.end())