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

Unified Diff: ipc/attachment_broker_privileged.cc

Issue 1270683002: ipc: Make a common subclass for Channel and ProxyChannel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More rebase errors. Created 5 years, 4 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.h ('k') | ipc/attachment_broker_privileged_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/attachment_broker_privileged.cc
diff --git a/ipc/attachment_broker_privileged.cc b/ipc/attachment_broker_privileged.cc
index 1fe3a75e73ec2381ea4e063bab5e5925103db465..da62ac0c06e87fd5f1d7d050c021cfe039f6408f 100644
--- a/ipc/attachment_broker_privileged.cc
+++ b/ipc/attachment_broker_privileged.cc
@@ -6,7 +6,7 @@
#include <algorithm>
-#include "ipc/ipc_channel.h"
+#include "ipc/ipc_endpoint.h"
namespace IPC {
@@ -15,25 +15,24 @@ AttachmentBrokerPrivileged::AttachmentBrokerPrivileged() {}
AttachmentBrokerPrivileged::~AttachmentBrokerPrivileged() {}
void AttachmentBrokerPrivileged::RegisterCommunicationChannel(
- Channel* channel) {
- channel->set_attachment_broker_endpoint(true);
- auto it = std::find(channels_.begin(), channels_.end(), channel);
- DCHECK(channels_.end() == it);
- channels_.push_back(channel);
+ Endpoint* endpoint) {
+ endpoint->SetAttachmentBrokerEndpoint(true);
+ auto it = std::find(endpoints_.begin(), endpoints_.end(), endpoint);
+ DCHECK(endpoints_.end() == it);
+ endpoints_.push_back(endpoint);
}
void AttachmentBrokerPrivileged::DeregisterCommunicationChannel(
- Channel* channel) {
- auto it = std::find(channels_.begin(), channels_.end(), channel);
- if (it != channels_.end())
- channels_.erase(it);
+ Endpoint* endpoint) {
+ auto it = std::find(endpoints_.begin(), endpoints_.end(), endpoint);
+ if (it != endpoints_.end())
+ endpoints_.erase(it);
}
-Channel* AttachmentBrokerPrivileged::GetChannelWithProcessId(
- base::ProcessId id) {
- auto it = std::find_if(channels_.begin(), channels_.end(),
- [id](Channel* c) { return c->GetPeerPID() == id; });
- if (it == channels_.end())
+Sender* AttachmentBrokerPrivileged::GetSenderWithProcessId(base::ProcessId id) {
+ auto it = std::find_if(endpoints_.begin(), endpoints_.end(),
+ [id](Endpoint* c) { return c->GetPeerPID() == id; });
+ if (it == endpoints_.end())
return nullptr;
return *it;
}
« no previous file with comments | « ipc/attachment_broker_privileged.h ('k') | ipc/attachment_broker_privileged_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698