chromium/extensions/browser/api/sockets_tcp/tcp_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.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "extensions/browser/api/sockets_tcp/tcp_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/extension_system.h"
#include "extensions/browser/extensions_browser_client.h"
#include "extensions/common/extension_id.h"
#include "net/base/net_errors.h"

namespace {
int kDefaultBufferSize =;
}

namespace extensions {
namespace api {

BrowserThread;

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

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

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

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

TCPSocketEventDispatcher::~TCPSocketEventDispatcher() = default;

TCPSocketEventDispatcher::ReadParams::ReadParams() = default;

TCPSocketEventDispatcher::ReadParams::ReadParams(const ReadParams& other) =
    default;

TCPSocketEventDispatcher::ReadParams::~ReadParams() = default;

void TCPSocketEventDispatcher::OnSocketConnect(const ExtensionId& extension_id,
                                               int socket_id) {}

void TCPSocketEventDispatcher::OnSocketResume(const ExtensionId& extension_id,
                                              int socket_id) {}

void TCPSocketEventDispatcher::StartSocketRead(const ExtensionId& extension_id,
                                               int socket_id) {}

// static
void TCPSocketEventDispatcher::StartRead(const ReadParams& params) {}

// static
void TCPSocketEventDispatcher::ReadCallback(
    const ReadParams& params,
    int bytes_read,
    scoped_refptr<net::IOBuffer> io_buffer,
    bool socket_destroying) {}

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

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

}  // namespace api
}  // namespace extensions