chromium/extensions/browser/api/bluetooth_socket/bluetooth_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/bluetooth_socket/bluetooth_socket_event_dispatcher.h"

#include <utility>

#include "base/functional/bind.h"
#include "base/lazy_instance.h"
#include "content/public/browser/browser_thread.h"
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_socket.h"
#include "extensions/browser/api/bluetooth_socket/bluetooth_api_socket.h"
#include "extensions/browser/event_router.h"
#include "extensions/common/api/bluetooth_socket.h"
#include "extensions/common/extension_id.h"
#include "net/base/io_buffer.h"

namespace {

bluetooth_socket;
BluetoothApiSocket;

int kDefaultBufferSize =;

bluetooth_socket::ReceiveError MapReceiveErrorReason(
    BluetoothApiSocket::ErrorReason value) {}

bluetooth_socket::AcceptError MapAcceptErrorReason(
    BluetoothApiSocket::ErrorReason value) {}

}  // namespace

namespace extensions {
namespace api {

BrowserThread;

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

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

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

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

BluetoothSocketEventDispatcher::~BluetoothSocketEventDispatcher() = default;

BluetoothSocketEventDispatcher::SocketParams::SocketParams() = default;

BluetoothSocketEventDispatcher::SocketParams::SocketParams(
    const SocketParams& other) = default;

BluetoothSocketEventDispatcher::SocketParams::~SocketParams() = default;

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

void BluetoothSocketEventDispatcher::OnSocketListen(
    const ExtensionId& extension_id,
    int socket_id) {}

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

// static
void BluetoothSocketEventDispatcher::StartReceive(const SocketParams& params) {}

// static
void BluetoothSocketEventDispatcher::ReceiveCallback(
    const SocketParams& params,
    int bytes_read,
    scoped_refptr<net::IOBuffer> io_buffer) {}

// static
void BluetoothSocketEventDispatcher::ReceiveErrorCallback(
    const SocketParams& params,
    BluetoothApiSocket::ErrorReason error_reason,
    const std::string& error) {}

// static
void BluetoothSocketEventDispatcher::StartAccept(const SocketParams& params) {}

// static
void BluetoothSocketEventDispatcher::AcceptCallback(
    const SocketParams& params,
    const device::BluetoothDevice* device,
    scoped_refptr<device::BluetoothSocket> socket) {}

// static
void BluetoothSocketEventDispatcher::AcceptErrorCallback(
    const SocketParams& params,
    BluetoothApiSocket::ErrorReason error_reason,
    const std::string& error) {}

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

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

}  // namespace api
}  // namespace extensions