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 "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 43 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
44 | 44 |
45 // Similar to CreateBrokerIfNeeded(), but useful for single process unit tests | 45 // Similar to CreateBrokerIfNeeded(), but useful for single process unit tests |
46 // that don't need real attachment brokering, and don't want to deal with | 46 // that don't need real attachment brokering, and don't want to deal with |
47 // setting up a fake PortProvider. | 47 // setting up a fake PortProvider. |
48 static void CreateBrokerForSingleProcessTests(); | 48 static void CreateBrokerForSingleProcessTests(); |
49 | 49 |
50 // AttachmentBroker overrides. | 50 // AttachmentBroker overrides. |
51 void RegisterCommunicationChannel(Endpoint* endpoint) override; | 51 void RegisterCommunicationChannel(Endpoint* endpoint) override; |
52 void DeregisterCommunicationChannel(Endpoint* endpoint) override; | 52 void DeregisterCommunicationChannel(Endpoint* endpoint) override; |
| 53 bool IsPrivilegedBroker() override; |
53 | 54 |
54 protected: | 55 protected: |
55 // Returns the sender whose peer's process id is |id|. | 56 // Returns the sender whose peer's process id is |id|. |
56 // Returns nullptr if no sender is found. | 57 // Returns nullptr if no sender is found. |
57 // The lock returned by get_lock() must already be acquired before calling | 58 // The lock returned by get_lock() must already be acquired before calling |
58 // this method. The return value is only guaranteed to be valid while the lock | 59 // this method. The return value is only guaranteed to be valid while the lock |
59 // is held. | 60 // is held. |
60 Sender* GetSenderWithProcessId(base::ProcessId id); | 61 Sender* GetSenderWithProcessId(base::ProcessId id); |
61 | 62 |
62 // Errors that can be reported by subclasses. | 63 // Errors that can be reported by subclasses. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 void LogError(UMAError error); | 105 void LogError(UMAError error); |
105 | 106 |
106 private: | 107 private: |
107 std::vector<Endpoint*> endpoints_; | 108 std::vector<Endpoint*> endpoints_; |
108 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivileged); | 109 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivileged); |
109 }; | 110 }; |
110 | 111 |
111 } // namespace IPC | 112 } // namespace IPC |
112 | 113 |
113 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ | 114 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ |
OLD | NEW |