Commit 7943dd68 authored by Istiaque Ahmed's avatar Istiaque Ahmed Committed by Commit Bot

Add main thread enforcing DCHECK in Dispatcher's messaging IPC handler.

Dispatcher is expected to receive messaging IPCs for main thread and not
worker threads.
Add the check to Dispatcher::OnDeliverMesage, similar to what existed
for other messages, e.g. Dispatcher::OnDispatchOnDisconnect.

Bug: None
Test: No visible changes expected.
Change-Id: I0c11b302b9d9610b1f8792ebf2a385e0aec9fb77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1508601Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638679}
parent 4d66a60c
......@@ -936,6 +936,7 @@ void Dispatcher::OnCancelSuspend(const std::string& extension_id) {
void Dispatcher::OnDeliverMessage(int worker_thread_id,
const PortId& target_port_id,
const Message& message) {
DCHECK_EQ(kMainThreadId, worker_thread_id);
bindings_system_->GetMessagingService()->DeliverMessage(
script_context_set_.get(), target_port_id, message,
NULL); // All render frames.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment