summaryrefslogtreecommitdiffstats
path: root/chromium/ipc/ipc_mojo_bootstrap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ipc/ipc_mojo_bootstrap.cc')
-rw-r--r--chromium/ipc/ipc_mojo_bootstrap.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/chromium/ipc/ipc_mojo_bootstrap.cc b/chromium/ipc/ipc_mojo_bootstrap.cc
index c5aa68030a5..42926d83598 100644
--- a/chromium/ipc/ipc_mojo_bootstrap.cc
+++ b/chromium/ipc/ipc_mojo_bootstrap.cc
@@ -673,9 +673,12 @@ class ChannelAssociatedGroupController
void OnSyncMessageEventReady() {
DCHECK(task_runner_->RunsTasksInCurrentSequence());
- scoped_refptr<Endpoint> keepalive(this);
+ // SUBTLE: The order of these scoped_refptrs matters.
+ // `controller_keepalive` MUST outlive `keepalive` because the Endpoint
+ // holds raw pointer to the AssociatedGroupController.
scoped_refptr<AssociatedGroupController> controller_keepalive(
controller_.get());
+ scoped_refptr<Endpoint> keepalive(this);
base::AutoLock locker(controller_->lock_);
bool more_to_process = false;
if (!sync_messages_.empty()) {