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_IPC_ENDPOINT_H_ | 5 #ifndef IPC_IPC_ENDPOINT_H_ |
6 #define IPC_IPC_ENDPOINT_H_ | 6 #define IPC_IPC_ENDPOINT_H_ |
7 | 7 |
8 #include "base/process/process_handle.h" | 8 #include "base/process/process_handle.h" |
9 #include "ipc/ipc_export.h" | 9 #include "ipc/ipc_export.h" |
10 #include "ipc/ipc_sender.h" | 10 #include "ipc/ipc_sender.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // for race conditions. You can easily get a channel to another process, but | 25 // for race conditions. You can easily get a channel to another process, but |
26 // if your process has not yet processed the "hello" message from the remote | 26 // if your process has not yet processed the "hello" message from the remote |
27 // side, this will fail. You should either make sure calling this is either | 27 // side, this will fail. You should either make sure calling this is either |
28 // in response to a message from the remote side (which guarantees that it's | 28 // in response to a message from the remote side (which guarantees that it's |
29 // been connected), or you wait for the "connected" notification on the | 29 // been connected), or you wait for the "connected" notification on the |
30 // listener. | 30 // listener. |
31 virtual base::ProcessId GetPeerPID() const = 0; | 31 virtual base::ProcessId GetPeerPID() const = 0; |
32 | 32 |
33 // A callback that indicates that is_attachment_broker_endpoint() has been | 33 // A callback that indicates that is_attachment_broker_endpoint() has been |
34 // changed. | 34 // changed. |
35 virtual void OnSetAttachmentBrokerEndpoint(){}; | 35 virtual void OnSetAttachmentBrokerEndpoint() = 0; |
36 | 36 |
37 // Whether this channel is used as an endpoint for sending and receiving | 37 // Whether this channel is used as an endpoint for sending and receiving |
38 // brokerable attachment messages to/from the broker process. | 38 // brokerable attachment messages to/from the broker process. |
39 void SetAttachmentBrokerEndpoint(bool is_endpoint); | 39 void SetAttachmentBrokerEndpoint(bool is_endpoint); |
40 | 40 |
41 protected: | 41 protected: |
42 bool is_attachment_broker_endpoint() { return attachment_broker_endpoint_; } | 42 bool is_attachment_broker_endpoint() { return attachment_broker_endpoint_; } |
43 | 43 |
44 private: | 44 private: |
45 // Whether this channel is used as an endpoint for sending and receiving | 45 // Whether this channel is used as an endpoint for sending and receiving |
46 // brokerable attachment messages to/from the broker process. | 46 // brokerable attachment messages to/from the broker process. |
47 bool attachment_broker_endpoint_; | 47 bool attachment_broker_endpoint_; |
48 }; | 48 }; |
49 | 49 |
50 } // namespace IPC | 50 } // namespace IPC |
51 | 51 |
52 #endif // IPC_IPC_ENDPOINT_H_ | 52 #endif // IPC_IPC_ENDPOINT_H_ |
OLD | NEW |