| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ipc/attachment_broker_privileged.h" | 5 #include "ipc/attachment_broker_privileged.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" |
| 9 #include "ipc/ipc_endpoint.h" | 10 #include "ipc/ipc_endpoint.h" |
| 10 | 11 |
| 11 namespace IPC { | 12 namespace IPC { |
| 12 | 13 |
| 13 AttachmentBrokerPrivileged::AttachmentBrokerPrivileged() {} | 14 AttachmentBrokerPrivileged::AttachmentBrokerPrivileged() {} |
| 14 | 15 |
| 15 AttachmentBrokerPrivileged::~AttachmentBrokerPrivileged() {} | 16 AttachmentBrokerPrivileged::~AttachmentBrokerPrivileged() {} |
| 16 | 17 |
| 17 void AttachmentBrokerPrivileged::RegisterCommunicationChannel( | 18 void AttachmentBrokerPrivileged::RegisterCommunicationChannel( |
| 18 Endpoint* endpoint) { | 19 Endpoint* endpoint) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 30 } | 31 } |
| 31 | 32 |
| 32 Sender* AttachmentBrokerPrivileged::GetSenderWithProcessId(base::ProcessId id) { | 33 Sender* AttachmentBrokerPrivileged::GetSenderWithProcessId(base::ProcessId id) { |
| 33 auto it = std::find_if(endpoints_.begin(), endpoints_.end(), | 34 auto it = std::find_if(endpoints_.begin(), endpoints_.end(), |
| 34 [id](Endpoint* c) { return c->GetPeerPID() == id; }); | 35 [id](Endpoint* c) { return c->GetPeerPID() == id; }); |
| 35 if (it == endpoints_.end()) | 36 if (it == endpoints_.end()) |
| 36 return nullptr; | 37 return nullptr; |
| 37 return *it; | 38 return *it; |
| 38 } | 39 } |
| 39 | 40 |
| 41 void AttachmentBrokerPrivileged::LogError(UMAError error) { |
| 42 UMA_HISTOGRAM_ENUMERATION( |
| 43 "IPC.AttachmentBrokerPrivileged.BrokerAttachmentError", error, MAX_VALUE); |
| 44 } |
| 45 |
| 40 } // namespace IPC | 46 } // namespace IPC |
| OLD | NEW |