Commit bfeff6b1 authored by Tal Pressman's avatar Tal Pressman Committed by Commit Bot

Remove the use of SyncChannel in RenderProcessHostImpl.

It was only used for sync compositing in Android WebViews, but those
were converted to mojo, leaving this unused.

Bug: 526842, 1111231
Change-Id: I491659a6a696da6a317f6ae9eda318e81be1c1af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2550145
Commit-Queue: Tal Pressman <talp@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#831243}
parent eeb5fb92
...@@ -410,10 +410,6 @@ void AgentSchedulingGroupHost::SetUpIPC() { ...@@ -410,10 +410,6 @@ void AgentSchedulingGroupHost::SetUpIPC() {
bootstrap.PassPipe(), /*ipc_task_runner=*/io_task_runner, bootstrap.PassPipe(), /*ipc_task_runner=*/io_task_runner,
/*proxy_task_runner=*/base::ThreadTaskRunnerHandle::Get()); /*proxy_task_runner=*/base::ThreadTaskRunnerHandle::Get());
// TODO(crbug.com/1111231): Android WebViews (that support synchronous
// compositing) send sync messages from the browser to the renderer, and
// therefore need a `SyncChannel`. However, we don't plan to support
// WebViews at this stage, so a plain `ChannelProxy` is fine for now.
channel_ = ChannelProxy::Create( channel_ = ChannelProxy::Create(
std::move(channel_factory), /*listener=*/this, std::move(channel_factory), /*listener=*/this,
/*ipc_task_runner=*/io_task_runner, /*ipc_task_runner=*/io_task_runner,
......
...@@ -228,7 +228,6 @@ ...@@ -228,7 +228,6 @@
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
#include "content/public/browser/android/java_interfaces.h" #include "content/public/browser/android/java_interfaces.h"
#include "ipc/ipc_sync_channel.h"
#include "media/audio/android/audio_manager_android.h" #include "media/audio/android/audio_manager_android.h"
#include "third_party/blink/public/mojom/android_font_lookup/android_font_lookup.mojom.h" #include "third_party/blink/public/mojom/android_font_lookup/android_font_lookup.mojom.h"
#endif #endif
...@@ -1889,24 +1888,11 @@ void RenderProcessHostImpl::InitializeChannelProxy() { ...@@ -1889,24 +1888,11 @@ void RenderProcessHostImpl::InitializeChannelProxy() {
ResetChannelProxy(); ResetChannelProxy();
// Do NOT expand ifdef or run time condition checks here! Synchronous DCHECK(!channel_);
// IPCs from browser process are banned. It is only narrowly allowed channel_ = IPC::ChannelProxy::Create(
// for Android WebView to maintain backward compatibility. std::move(channel_factory), this,
// See crbug.com/526842 for details. /*ipc_task_runner=*/io_task_runner.get(),
#if defined(OS_ANDROID) /*listener_task_runner=*/base::ThreadTaskRunnerHandle::Get());
if (GetContentClient()->UsingSynchronousCompositing()) {
// Android never performs a clean shutdown, so we pass nullptr for
// shudown_event to indicate that we never intend to signal a shutdown.
channel_ =
IPC::SyncChannel::Create(this, io_task_runner.get(),
base::ThreadTaskRunnerHandle::Get(), nullptr);
}
#endif // OS_ANDROID
if (!channel_) {
channel_ = std::make_unique<IPC::ChannelProxy>(
this, io_task_runner.get(), base::ThreadTaskRunnerHandle::Get());
}
channel_->Init(std::move(channel_factory), true /* create_pipe_now */);
// Note that Channel send is effectively paused and unpaused at various points // Note that Channel send is effectively paused and unpaused at various points
// during startup, and existing code relies on a fragile relative message // during startup, and existing code relies on a fragile relative message
...@@ -3563,21 +3549,7 @@ bool RenderProcessHostImpl::Send(IPC::Message* msg) { ...@@ -3563,21 +3549,7 @@ bool RenderProcessHostImpl::Send(IPC::Message* msg) {
if (!channel_) if (!channel_)
return false; return false;
#if !defined(OS_ANDROID)
DCHECK(!message->is_sync()); DCHECK(!message->is_sync());
#else
if (message->is_sync()) {
// If Init() hasn't been called yet since construction or the last
// ProcessDied() we avoid blocking on sync IPC.
if (!IsInitializedAndNotDead())
return false;
// Likewise if we've done Init(), but process launch has not yet
// completed, we avoid blocking on sync IPC.
if (child_process_launcher_.get() && child_process_launcher_->IsStarting())
return false;
}
#endif
// Allow tests to watch IPCs sent to the renderer. // Allow tests to watch IPCs sent to the renderer.
if (ipc_send_watcher_for_testing_) if (ipc_send_watcher_for_testing_)
......
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