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

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: Comments from tsepez. 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
Index: ipc/ipc_channel.h
diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h
index c1ad4172bd169f590d025314c027e8e7ef853c4e..a008e7e15d57218769bf5d36df590144a7baa4bb 100644
--- a/ipc/ipc_channel.h
+++ b/ipc/ipc_channel.h
@@ -165,6 +165,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.
@@ -255,6 +258,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)

Powered by Google App Engine
This is Rietveld 408576698