Chromium Code Reviews| 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 #ifndef IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ | 5 #ifndef IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ |
| 6 #define IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ | 6 #define IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ipc/attachment_broker.h" | 10 #include "ipc/attachment_broker.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 // process, these channels must be registered and deregistered with the | 29 // process, these channels must be registered and deregistered with the |
| 30 // Attachment Broker as they are created and destroyed. | 30 // Attachment Broker as they are created and destroyed. |
| 31 void RegisterCommunicationChannel(Endpoint* endpoint); | 31 void RegisterCommunicationChannel(Endpoint* endpoint); |
| 32 void DeregisterCommunicationChannel(Endpoint* endpoint); | 32 void DeregisterCommunicationChannel(Endpoint* endpoint); |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 // Returns the sender whose peer's process id is |id|. | 35 // Returns the sender whose peer's process id is |id|. |
| 36 // Returns nullptr if no sender is found. | 36 // Returns nullptr if no sender is found. |
| 37 Sender* GetSenderWithProcessId(base::ProcessId id); | 37 Sender* GetSenderWithProcessId(base::ProcessId id); |
| 38 | 38 |
| 39 // Errors that can be reported by subclasses. | |
| 40 // These match tools/metrics/histograms.xml | |
|
Ilya Sherman
2015/08/11 21:22:16
nit: Please document that this enum should be trea
erikchen
2015/09/19 01:21:56
Done.
| |
| 41 enum UMAError { | |
| 42 // The brokerable attachment did not have a destination process. | |
| 43 NO_DESTINATION = 0, | |
| 44 // The brokerable attachment had a destination, but the broker did not have | |
| 45 // a channel of communication with that process. | |
| 46 DESTINATION_NOT_FOUND, | |
| 47 MAX_VALUE | |
|
Ilya Sherman
2015/08/11 21:22:16
nit: "MAX_VALUE" is a little unclear out of contex
erikchen
2015/09/19 01:21:55
Done.
| |
| 48 }; | |
| 49 | |
| 50 // Emits an UMA metric. | |
| 51 void LogError(UMAError error); | |
| 52 | |
| 39 private: | 53 private: |
| 40 std::vector<Endpoint*> endpoints_; | 54 std::vector<Endpoint*> endpoints_; |
| 41 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivileged); | 55 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivileged); |
| 42 }; | 56 }; |
| 43 | 57 |
| 44 } // namespace IPC | 58 } // namespace IPC |
| 45 | 59 |
| 46 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ | 60 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ |
| OLD | NEW |