diff --git a/ipc/ipc_mojo_bootstrap.cc b/ipc/ipc_mojo_bootstrap.cc index 568f2c0c01274b..a017111a647150 100644 --- a/ipc/ipc_mojo_bootstrap.cc +++ b/ipc/ipc_mojo_bootstrap.cc @@ -980,6 +980,11 @@ class ChannelAssociatedGroupController if (!client) return; + if (!endpoint->task_runner()->RunsTasksInCurrentSequence() && + !proxy_task_runner_->RunsTasksInCurrentSequence()) { + return; + } + TRACE_EVENT( TRACE_CATEGORY_OR_DISABLED_BY_DEFAULT_MOJOM("mojom"), // Using client->interface_name() is safe here because this is a static @@ -993,8 +998,6 @@ class ChannelAssociatedGroupController perfetto::Flow::Global(message.GetTraceId())(ctx); }); - DCHECK(endpoint->task_runner()->RunsTasksInCurrentSequence() || - proxy_task_runner_->RunsTasksInCurrentSequence()); // Sync messages should never make their way to this method. DCHECK(!message.has_flag(mojo::Message::kFlagIsSync)); @@ -1024,11 +1027,14 @@ class ChannelAssociatedGroupController if (!client) return; + if (!endpoint->task_runner()->RunsTasksInCurrentSequence() && + !proxy_task_runner_->RunsTasksInCurrentSequence()) { + return; + } + // Using client->interface_name() is safe here because this is a static // string defined for each mojo interface. TRACE_EVENT0("mojom", client->interface_name()); - DCHECK(endpoint->task_runner()->RunsTasksInCurrentSequence() || - proxy_task_runner_->RunsTasksInCurrentSequence()); MessageWrapper message_wrapper = endpoint->PopSyncMessage(message_id); // The message must have already been dequeued by the endpoint waking up