#include "content/browser/broadcast_channel/broadcast_channel_service.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "content/browser/broadcast_channel/broadcast_channel_provider.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "third_party/blink/public/mojom/broadcastchannel/broadcast_channel.mojom.h"
namespace content {
class BroadcastChannelService::Connection
: public blink::mojom::BroadcastChannelClient { … };
BroadcastChannelService::Connection::Connection(
const blink::StorageKey& storage_key,
const std::string& name,
mojo::PendingAssociatedRemote<blink::mojom::BroadcastChannelClient> client,
mojo::PendingAssociatedReceiver<blink::mojom::BroadcastChannelClient>
connection,
BroadcastChannelService* service)
: … { … }
void BroadcastChannelService::Connection::OnMessage(
blink::CloneableMessage message) { … }
BroadcastChannelService::BroadcastChannelService() = default;
BroadcastChannelService::~BroadcastChannelService() = default;
void BroadcastChannelService::UnregisterConnection(Connection* c) { … }
void BroadcastChannelService::ReceivedMessageOnConnection(
Connection* c,
const blink::CloneableMessage& message) { … }
void BroadcastChannelService::ConnectToChannel(
const blink::StorageKey& storage_key,
const std::string& name,
mojo::PendingAssociatedRemote<blink::mojom::BroadcastChannelClient> client,
mojo::PendingAssociatedReceiver<blink::mojom::BroadcastChannelClient>
connection) { … }
void BroadcastChannelService::AddReceiver(
std::unique_ptr<BroadcastChannelProvider> provider,
mojo::PendingReceiver<blink::mojom::BroadcastChannelProvider>
pending_receiver) { … }
void BroadcastChannelService::AddAssociatedReceiver(
std::unique_ptr<BroadcastChannelProvider> provider,
mojo::PendingAssociatedReceiver<blink::mojom::BroadcastChannelProvider>
pending_associated_receiver) { … }
}