Commit a7e8d6a3 authored by Max Morin's avatar Max Morin Committed by Commit Bot

Add group_id member in ForwardingAudioStreamFactory

Actually using it is TODO.

No-Try: true
Bug: 824019
Change-Id: I9053827dba2504218559be523574b71ef079c72b
Reviewed-on: https://chromium-review.googlesource.com/1046646
Commit-Queue: Max Morin <maxmorin@chromium.org>
Reviewed-by: default avatarOlga Sharonova <olka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556421}
parent d98b020f
......@@ -23,7 +23,8 @@ ForwardingAudioStreamFactory::ForwardingAudioStreamFactory(
std::unique_ptr<AudioStreamBrokerFactory> broker_factory)
: WebContentsObserver(web_contents),
connector_(std::move(connector)),
broker_factory_(std::move(broker_factory)) {
broker_factory_(std::move(broker_factory)),
group_id_(base::UnguessableToken::Create()) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(web_contents);
DCHECK(broker_factory_);
......
......@@ -11,6 +11,7 @@
#include "base/containers/flat_set.h"
#include "base/containers/unique_ptr_adapters.h"
#include "base/macros.h"
#include "base/unguessable_token.h"
#include "content/browser/media/audio_stream_broker.h"
#include "content/common/content_export.h"
#include "content/common/media/renderer_audio_input_stream_factory.mojom.h"
......@@ -42,6 +43,8 @@ class CONTENT_EXPORT ForwardingAudioStreamFactory final
~ForwardingAudioStreamFactory() final;
const base::UnguessableToken& group_id() { return group_id_; }
// TODO(https://crbug.com/803102): Add loopback and muting streams.
// TODO(https://crbug.com/787806): Automatically restore streams on audio
// service restart.
......@@ -81,6 +84,11 @@ class CONTENT_EXPORT ForwardingAudioStreamFactory final
const std::unique_ptr<service_manager::Connector> connector_;
const std::unique_ptr<AudioStreamBrokerFactory> broker_factory_;
// Unique id indentifying all streams belonging to the WebContents owning
// |this|.
// TODO(https://crbug.com/824019): Use this for loopback.
const base::UnguessableToken group_id_;
// Lazily acquired. Reset on connection error and when we no longer have any
// streams. Note: we don't want muting to force the connection to be open,
// since we want to clean up the service when not in use. If we have active
......
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