Commit 16ebf6e3 authored by khmel@google.com's avatar khmel@google.com Committed by Commit Bot

arc: Handle possible auth instance deletion.

RequestAccountInfo -> OnAccountInfoReady is implmented as truly async
calls. It seems that it is possible the case when instance is removed
after making a request and this leads to crash (however it is pretty
rare case).

TEST=N/A
BUG=801947

Change-Id: I0ae3f7a250e0796d2174ea5252e33db84f949592
Reviewed-on: https://chromium-review.googlesource.com/1120777Reviewed-by: default avatarLuis Hector Chavez <lhchavez@chromium.org>
Commit-Queue: Yury Khmel <khmel@google.com>
Cr-Commit-Position: refs/heads/master@{#571915}
parent 2285ed7f
......@@ -233,7 +233,10 @@ void ArcAuthService::OnAccountInfoReady(mojom::AccountInfoPtr account_info,
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
auto* instance = ARC_GET_INSTANCE_FOR_METHOD(arc_bridge_service_->auth(),
OnAccountInfoReady);
DCHECK(instance);
if (!instance) {
LOG(ERROR) << "Auth instance is not available.";
return;
}
instance->OnAccountInfoReady(std::move(account_info), status);
}
......
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