chromium/extensions/browser/api/bluetooth_socket/bluetooth_socket_api.h

// 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.

#ifndef EXTENSIONS_BROWSER_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H_
#define EXTENSIONS_BROWSER_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H_

#include <stddef.h>

#include <optional>
#include <string>
#include <unordered_set>
#include <vector>

#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/values.h"
#include "content/public/browser/browser_thread.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "extensions/browser/api/api_resource_manager.h"
#include "extensions/browser/api/bluetooth_socket/bluetooth_api_socket.h"
#include "extensions/browser/extension_function.h"
#include "extensions/browser/extension_function_histogram_value.h"
#include "extensions/common/api/bluetooth_socket.h"

namespace device {
class BluetoothSocket;
}

namespace net {
class IOBuffer;
}

namespace extensions {

namespace api {

class BluetoothSocketEventDispatcher;

// Asynchronous API function that performs its work on the BluetoothApiSocket
// thread while providing methods to manage resources of that class. This
// follows the pattern of AsyncApiFunction, but does not derive from it,
// because BluetoothApiSocket methods must be called on the UI Thread.
class BluetoothSocketAsyncApiFunction : public ExtensionFunction {};

class BluetoothSocketCreateFunction : public BluetoothSocketAsyncApiFunction {};

class BluetoothSocketUpdateFunction : public BluetoothSocketAsyncApiFunction {};

class BluetoothSocketSetPausedFunction
    : public BluetoothSocketAsyncApiFunction {};

class BluetoothSocketListenFunction : public BluetoothSocketAsyncApiFunction {};

class BluetoothSocketListenUsingRfcommFunction
    : public BluetoothSocketListenFunction {};

class BluetoothSocketListenUsingL2capFunction
    : public BluetoothSocketListenFunction {};

class BluetoothSocketAbstractConnectFunction :
    public BluetoothSocketAsyncApiFunction {};

class BluetoothSocketConnectFunction :
    public BluetoothSocketAbstractConnectFunction {};

class BluetoothSocketDisconnectFunction
    : public BluetoothSocketAsyncApiFunction {};

class BluetoothSocketCloseFunction : public BluetoothSocketAsyncApiFunction {};

class BluetoothSocketSendFunction : public BluetoothSocketAsyncApiFunction {};

class BluetoothSocketGetInfoFunction : public BluetoothSocketAsyncApiFunction {};

class BluetoothSocketGetSocketsFunction
    : public BluetoothSocketAsyncApiFunction {};

}  // namespace api
}  // namespace extensions

#endif  // EXTENSIONS_BROWSER_API_BLUETOOTH_SOCKET_BLUETOOTH_SOCKET_API_H_