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_channel.h"
13 AttachmentBrokerPrivileged::AttachmentBrokerPrivileged() {}
15 AttachmentBrokerPrivileged::~AttachmentBrokerPrivileged() {}
17 void AttachmentBrokerPrivileged::RegisterCommunicationChannel(
19 channel
->set_attachment_broker_endpoint(true);
20 auto it
= std::find(channels_
.begin(), channels_
.end(), channel
);
21 DCHECK(channels_
.end() == it
);
22 channels_
.push_back(channel
);
25 void AttachmentBrokerPrivileged::DeregisterCommunicationChannel(
27 auto it
= std::find(channels_
.begin(), channels_
.end(), channel
);
28 if (it
!= channels_
.end())
32 Channel
* AttachmentBrokerPrivileged::GetChannelWithProcessId(
34 auto it
= std::find_if(channels_
.begin(), channels_
.end(),
35 [id
](Channel
* c
) { return c
->GetPeerPID() == id
; });
36 if (it
== channels_
.end())