Commit 8c37ecb0 authored by Peter Qiu's avatar Peter Qiu Committed by Commit Bot

chromecast: service_connector: properly forward interface_name for bind request

We're currently using GenericPendingReceiver::interface_name()
when forwarding the bind request to the system connector, which
is returning a reference string. However, the |interfae_name_|
is resetted in GenericPendingReceiver::PassPipe(), which is
invoked in the same bind request. This results in system connector
getting corrupted interface name.

So make a copy of the interface name, and use it for the bind
request.

Bug: 146448872
Test: Verify no crash when CastAudioOutputStream uses ServiceConnector
      to request MultiroomManager interface.

Change-Id: Ia6987045e4c6ab39f46fe097fb98e6dfa5e00468
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1977023
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarMichael Spang <spang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726543}
parent 675db58c
......@@ -73,9 +73,10 @@ void ServiceConnector::Connect(const std::string& service_name,
// If the client is browser code, forward indscriminately through the Service
// Manager. The browser generally has access unfettered to everything.
if (client_id == kBrowserProcessClientId) {
auto interface_name = *receiver.interface_name();
content::GetSystemConnector()->BindInterface(
service_manager::ServiceFilter::ByName(service_name),
*receiver.interface_name(), receiver.PassPipe());
interface_name, receiver.PassPipe());
return;
}
......
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