#include "device/bluetooth/server_socket.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ptr_util.h"
#include "device/bluetooth/bluetooth_device.h"
#include "device/bluetooth/bluetooth_socket.h"
#include "device/bluetooth/device.h"
#include "device/bluetooth/socket.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "net/base/io_buffer.h"
namespace bluetooth {
namespace {
void HoldReferenceUntilDisconnected(
scoped_refptr<device::BluetoothSocket> server_socket,
mojom::ServerSocket::DisconnectCallback callback) { … }
}
ServerSocket::ServerSocket(
scoped_refptr<device::BluetoothSocket> bluetooth_socket)
: … { … }
ServerSocket::~ServerSocket() { … }
void ServerSocket::Accept(AcceptCallback callback) { … }
void ServerSocket::Disconnect(DisconnectCallback callback) { … }
void ServerSocket::OnAccept(
AcceptCallback callback,
const device::BluetoothDevice* device,
scoped_refptr<device::BluetoothSocket> bluetooth_socket) { … }
void ServerSocket::OnAcceptError(AcceptCallback callback,
const std::string& error_message) { … }
}