chromium/content/browser/broadcast_channel/broadcast_channel_service.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#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 {

// There is a one-to-one mapping of BroadcastChannel instances in the renderer
// and Connection instances in the browser. The Connection is owned by a
// BroadcastChannelService.
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) {}
}  // namespace content