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_MAC_H_ | 5 #ifndef IPC_ATTACHMENT_BROKER_PRIVILEGED_MAC_H_ |
6 #define IPC_ATTACHMENT_BROKER_PRIVILEGED_MAC_H_ | 6 #define IPC_ATTACHMENT_BROKER_PRIVILEGED_MAC_H_ |
7 | 7 |
8 #include <mach/mach.h> | 8 #include <mach/mach.h> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // the creation of R may not be necessary. | 43 // the creation of R may not be necessary. |
44 // | 44 // |
45 // For the rest of this file, and the corresponding implementation file, R will | 45 // For the rest of this file, and the corresponding implementation file, R will |
46 // be called the "intermediate Mach port" and M3 the "final Mach port". | 46 // be called the "intermediate Mach port" and M3 the "final Mach port". |
47 class IPC_EXPORT AttachmentBrokerPrivilegedMac | 47 class IPC_EXPORT AttachmentBrokerPrivilegedMac |
48 : public AttachmentBrokerPrivileged { | 48 : public AttachmentBrokerPrivileged { |
49 public: | 49 public: |
50 AttachmentBrokerPrivilegedMac(); | 50 AttachmentBrokerPrivilegedMac(); |
51 ~AttachmentBrokerPrivilegedMac() override; | 51 ~AttachmentBrokerPrivilegedMac() override; |
52 | 52 |
53 // The port provider must live as long as the AttachmentBrokerPrivilegedMac. A | |
54 // port provider must be set before any attachment brokering occurs. | |
55 void SetPortProvider(base::PortProvider* port_provider); | |
56 | |
57 // IPC::AttachmentBroker overrides. | 53 // IPC::AttachmentBroker overrides. |
58 bool SendAttachmentToProcess(BrokerableAttachment* attachment, | 54 bool SendAttachmentToProcess(BrokerableAttachment* attachment, |
59 base::ProcessId destination_process) override; | 55 base::ProcessId destination_process) override; |
60 | 56 |
61 // IPC::Listener overrides. | 57 // IPC::Listener overrides. |
62 bool OnMessageReceived(const Message& message) override; | 58 bool OnMessageReceived(const Message& message) override; |
63 | 59 |
64 private: | 60 private: |
65 FRIEND_TEST_ALL_PREFIXES(AttachmentBrokerPrivilegedMacMultiProcessTest, | 61 FRIEND_TEST_ALL_PREFIXES(AttachmentBrokerPrivilegedMacMultiProcessTest, |
66 InsertRight); | 62 InsertRight); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // passed to the consumer of the Chrome IPC message. | 111 // passed to the consumer of the Chrome IPC message. |
116 // Makes an attachment, queues it, and notifies the observers. | 112 // Makes an attachment, queues it, and notifies the observers. |
117 void RouteWireFormatToSelf(const MachPortWireFormat& wire_format); | 113 void RouteWireFormatToSelf(const MachPortWireFormat& wire_format); |
118 | 114 |
119 // |wire_format.destination_process| must be another process. | 115 // |wire_format.destination_process| must be another process. |
120 // |wire_format.mach_port| must be the intermediate Mach port. | 116 // |wire_format.mach_port| must be the intermediate Mach port. |
121 // Ownership of |wire_format.mach_port| is implicitly passed to the process | 117 // Ownership of |wire_format.mach_port| is implicitly passed to the process |
122 // that receives the Chrome IPC message. | 118 // that receives the Chrome IPC message. |
123 void RouteWireFormatToAnother(const MachPortWireFormat& wire_format); | 119 void RouteWireFormatToAnother(const MachPortWireFormat& wire_format); |
124 | 120 |
125 base::PortProvider* port_provider_; | |
126 | |
127 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivilegedMac); | 121 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivilegedMac); |
128 }; | 122 }; |
129 | 123 |
130 } // namespace IPC | 124 } // namespace IPC |
131 | 125 |
132 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_MAC_H_ | 126 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_MAC_H_ |
OLD | NEW |