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

Side by Side Diff: ipc/ipc_endpoint.h

Issue 1903663004: IPC: Fix attachment brokering race condition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase (scoped_ptr->std::unique_ptr) Created 4 years, 7 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_win.cc ('k') | ipc/ipc_test_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « ipc/ipc_channel_win.cc ('k') | ipc/ipc_test_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698