chromium/extensions/browser/api/sockets_tcp_server/tcp_server_socket_event_dispatcher.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "extensions/browser/api/sockets_tcp_server/tcp_server_socket_event_dispatcher.h"

#include <utility>

#include "base/functional/bind.h"
#include "base/lazy_instance.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/browser/api/socket/tcp_socket.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/common/extension_id.h"
#include "net/base/net_errors.h"

namespace extensions {
namespace api {

BrowserThread;

static base::LazyInstance<BrowserContextKeyedAPIFactory<
    TCPServerSocketEventDispatcher>>::DestructorAtExit g_factory =;

// static
BrowserContextKeyedAPIFactory<TCPServerSocketEventDispatcher>*
TCPServerSocketEventDispatcher::GetFactoryInstance() {}

// static
TCPServerSocketEventDispatcher* TCPServerSocketEventDispatcher::Get(
    content::BrowserContext* context) {}

TCPServerSocketEventDispatcher::TCPServerSocketEventDispatcher(
    content::BrowserContext* context)
    :{}

TCPServerSocketEventDispatcher::~TCPServerSocketEventDispatcher() = default;

TCPServerSocketEventDispatcher::AcceptParams::AcceptParams() = default;

TCPServerSocketEventDispatcher::AcceptParams::AcceptParams(
    const AcceptParams& other) = default;

TCPServerSocketEventDispatcher::AcceptParams::~AcceptParams() = default;

void TCPServerSocketEventDispatcher::OnServerSocketListen(
    const ExtensionId& extension_id,
    int socket_id) {}

void TCPServerSocketEventDispatcher::OnServerSocketResume(
    const ExtensionId& extension_id,
    int socket_id) {}

void TCPServerSocketEventDispatcher::StartSocketAccept(
    const ExtensionId& extension_id,
    int socket_id) {}

// static
void TCPServerSocketEventDispatcher::StartAccept(const AcceptParams& params) {}

// static
void TCPServerSocketEventDispatcher::AcceptCallback(
    const AcceptParams& params,
    int result_code,
    mojo::PendingRemote<network::mojom::TCPConnectedSocket> socket,
    const std::optional<net::IPEndPoint>& remote_addr,
    mojo::ScopedDataPipeConsumerHandle receive_pipe_handle,
    mojo::ScopedDataPipeProducerHandle send_pipe_handle) {}

// static
void TCPServerSocketEventDispatcher::PostEvent(const AcceptParams& params,
                                               std::unique_ptr<Event> event) {}

// static
void TCPServerSocketEventDispatcher::DispatchEvent(
    void* browser_context_id,
    const ExtensionId& extension_id,
    std::unique_ptr<Event> event) {}

}  // namespace api
}  // namespace extensions