#include "remoting/host/file_transfer/file_transfer_message_handler.h"
#include <cstddef>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "net/base/filename_util.h"
#include "remoting/base/compound_buffer.h"
#include "remoting/protocol/file_transfer_helpers.h"
#include "url/gurl.h"
namespace remoting {
namespace {
constexpr char kDefaultFileName[] = …;
constexpr std::size_t kChunkSize = …;
constexpr std::size_t kMaxQueuedChunks = …;
}
FileTransferMessageHandler::FileTransferMessageHandler(
const std::string& name,
std::unique_ptr<protocol::MessagePipe> pipe,
std::unique_ptr<FileOperations> file_operations)
: … { … }
FileTransferMessageHandler::~FileTransferMessageHandler() = default;
void FileTransferMessageHandler::OnConnected() { … }
void FileTransferMessageHandler::OnIncomingMessage(
std::unique_ptr<CompoundBuffer> buffer) { … }
void FileTransferMessageHandler::OnDisconnecting() { … }
void FileTransferMessageHandler::OnMetadata(
protocol::FileTransfer::Metadata metadata) { … }
void FileTransferMessageHandler::OnData(std::vector<std::uint8_t> data) { … }
void FileTransferMessageHandler::OnEnd() { … }
void FileTransferMessageHandler::OnRequestTransfer() { … }
void FileTransferMessageHandler::OnSuccess() { … }
void FileTransferMessageHandler::OnError(protocol::FileTransfer_Error error) { … }
void FileTransferMessageHandler::OnOpenResult(
FileOperations::Reader::OpenResult result) { … }
void FileTransferMessageHandler::OnReadResult(
FileOperations::Reader::ReadResult result) { … }
void FileTransferMessageHandler::OnChunkSent() { … }
void FileTransferMessageHandler::OnWritingComplete() { … }
void FileTransferMessageHandler::OnWriteError(
protocol::FileTransfer_Error error) { … }
void FileTransferMessageHandler::ReadNextChunk() { … }
void FileTransferMessageHandler::Cancel() { … }
void FileTransferMessageHandler::SendError(protocol::FileTransfer_Error error) { … }
void FileTransferMessageHandler::UnexpectedMessage(base::Location from_here,
const char* message) { … }
void FileTransferMessageHandler::SetState(State state) { … }
}