Commit 04e9c2e2 authored by Josh Nohle's avatar Josh Nohle Committed by Commit Bot

[Nearby] Send HTTP response to notifier before invoking callback

Fixes a segfault encountered during manual testing.

Change-Id: I5a8719b8b55dc6475cce522f669c72dda5fd5c92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2370925
Auto-Submit: Josh Nohle <nohle@chromium.org>
Commit-Queue: James Vecore <vecore@google.com>
Reviewed-by: default avatarJames Vecore <vecore@google.com>
Cr-Commit-Position: refs/heads/master@{#800883}
parent 4777693c
...@@ -385,13 +385,13 @@ void NearbyShareClientImpl::OnFlowSuccess( ...@@ -385,13 +385,13 @@ void NearbyShareClientImpl::OnFlowSuccess(
OnApiCallFailed(NearbyShareHttpError::kResponseMalformed); OnApiCallFailed(NearbyShareHttpError::kResponseMalformed);
return; return;
} }
std::move(result_callback).Run(response);
notifier_->NotifyOfResponse(response); notifier_->NotifyOfResponse(response);
std::move(result_callback).Run(response);
} }
void NearbyShareClientImpl::OnApiCallFailed(NearbyShareHttpError error) { void NearbyShareClientImpl::OnApiCallFailed(NearbyShareHttpError error) {
NS_LOG(ERROR) << "Nearby Share RPC call failed with error " << error;
std::move(error_callback_).Run(error); std::move(error_callback_).Run(error);
NS_LOG(ERROR) << error;
} }
NearbyShareClientFactoryImpl::NearbyShareClientFactoryImpl( NearbyShareClientFactoryImpl::NearbyShareClientFactoryImpl(
......
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