Commit 21d92698 authored by Daniel Nicoara's avatar Daniel Nicoara Committed by Commit Bot

Check status on initialize & shutdown the CQ

* If gRPC initialize failed we don't have a connection to begin with so
can't call Read().
* Shutdown the CompletionQueue otherwise the thread won't exit.

Bug: b/142400443
Test: internal unittests
Change-Id: Ifc2a13e36bbdc640908ca1069afed855fc8cd790
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1867313
Commit-Queue: Daniel Nicoara <dnicoara@chromium.org>
Auto-Submit: Daniel Nicoara <dnicoara@chromium.org>
Reviewed-by: default avatarAlex Sakhartchouk <alexst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707463}
parent d319e944
......@@ -138,6 +138,12 @@ void WebviewRpcInstance::ProcessRequestOnWebviewThread(
}
void WebviewRpcInstance::InitComplete(bool ok) {
if (!ok) {
destroying_ = true;
delete this;
return;
}
request_ = std::make_unique<webview::WebviewRequest>();
io_.Read(request_.get(), &read_callback_);
......@@ -263,6 +269,7 @@ WebviewAsyncService::WebviewAsyncService(
}
WebviewAsyncService::~WebviewAsyncService() {
cq_->Shutdown();
base::PlatformThread::Join(rpc_thread_);
}
......
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