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; | |
54 | 53 |
55 protected: | 54 protected: |
56 // Returns the sender whose peer's process id is |id|. | 55 // Returns the sender whose peer's process id is |id|. |
57 // Returns nullptr if no sender is found. | 56 // Returns nullptr if no sender is found. |
58 // The lock returned by get_lock() must already be acquired before calling | 57 // The lock returned by get_lock() must already be acquired before calling |
59 // this method. The return value is only guaranteed to be valid while the lock | 58 // this method. The return value is only guaranteed to be valid while the lock |
60 // is held. | 59 // is held. |
61 Sender* GetSenderWithProcessId(base::ProcessId id); | 60 Sender* GetSenderWithProcessId(base::ProcessId id); |
62 | 61 |
63 // Errors that can be reported by subclasses. | 62 // Errors that can be reported by subclasses. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 void LogError(UMAError error); | 104 void LogError(UMAError error); |
106 | 105 |
107 private: | 106 private: |
108 std::vector<Endpoint*> endpoints_; | 107 std::vector<Endpoint*> endpoints_; |
109 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivileged); | 108 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivileged); |
110 }; | 109 }; |
111 | 110 |
112 } // namespace IPC | 111 } // namespace IPC |
113 | 112 |
114 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ | 113 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_H_ |
OLD | NEW |