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

Unified Diff: ipc/ipc_channel.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, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/attachment_broker_privileged_win_unittest.cc ('k') | ipc/ipc_channel_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel.h
diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h
index dba2150410cd2cb0edc866b996a00a666d2980e2..fdd0b352964a4a3e554b763c54276dccd0e9bf7e 100644
--- a/ipc/ipc_channel.h
+++ b/ipc/ipc_channel.h
@@ -166,6 +166,9 @@ class IPC_EXPORT Channel : public Endpoint {
// connect to a pre-existing pipe. Note, calling Connect()
// will not block the calling thread and may complete
// asynchronously.
+ //
+ // The subclass implementation must call WillConnect() at the beginning of its
+ // implementation.
virtual bool Connect() WARN_UNUSED_RESULT = 0;
// Close this Channel explicitly. May be called multiple times.
@@ -256,6 +259,16 @@ class IPC_EXPORT Channel : public Endpoint {
void* buffer_;
size_t length_;
};
+
+ // Endpoint overrides.
+ void OnSetAttachmentBrokerEndpoint() override;
+
+ // Subclasses must call this method at the beginning of their implementation
+ // of Connect().
+ void WillConnect();
+
+ private:
+ bool did_start_connect_ = false;
};
#if defined(OS_POSIX)
« no previous file with comments | « ipc/attachment_broker_privileged_win_unittest.cc ('k') | ipc/ipc_channel_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698