Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: ipc/ipc_endpoint.h

Issue 1270683002: ipc: Make a common subclass for Channel and ProxyChannel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More rebase errors. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/ipc_channel_proxy.cc ('k') | ipc/ipc_endpoint.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef IPC_IPC_ENDPOINT_H_
6 #define IPC_IPC_ENDPOINT_H_
7
8 #include "base/process/process_handle.h"
9 #include "ipc/ipc_export.h"
10 #include "ipc/ipc_sender.h"
11
12 namespace IPC {
13
14 // An Endpoint is an abstract base class whose interface provides sending
15 // functionality, and some receiving functionality. It mostly exists to provide
16 // a common interface to Channel and ProxyChannel.
17 class IPC_EXPORT Endpoint : public Sender {
18 public:
19 Endpoint();
20 ~Endpoint() override {}
21
22 // Get the process ID for the connected peer.
23 //
24 // Returns base::kNullProcessId if the peer is not connected yet. Watch out
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
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
29 // been connected), or you wait for the "connected" notification on the
30 // listener.
31 virtual base::ProcessId GetPeerPID() const = 0;
32
33 // A callback that indicates that is_attachment_broker_endpoint() has been
34 // changed.
35 virtual void OnSetAttachmentBrokerEndpoint(){};
36
37 // Whether this channel is used as an endpoint for sending and receiving
38 // brokerable attachment messages to/from the broker process.
39 void SetAttachmentBrokerEndpoint(bool is_endpoint);
40
41 protected:
42 bool is_attachment_broker_endpoint() { return attachment_broker_endpoint_; }
43
44 private:
45 // Whether this channel is used as an endpoint for sending and receiving
46 // brokerable attachment messages to/from the broker process.
47 bool attachment_broker_endpoint_;
48 };
49
50 } // namespace IPC
51
52 #endif // IPC_IPC_ENDPOINT_H_
OLDNEW
« no previous file with comments | « ipc/ipc_channel_proxy.cc ('k') | ipc/ipc_endpoint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698