chromium/remoting/host/file_transfer/file_transfer_message_handler.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Used if the provided filename can't be used. (E.g., if it is empty, or if
// it consists entirely of disallowed characters.)
constexpr char kDefaultFileName[] =;

// The max SCTP message size that can be safely sent in a cross-browser fashion
// is 16 KiB. Thus, 8 KiB should be a safe value even with messaging overhead.
constexpr std::size_t kChunkSize =;  // 8 KiB

// The max number of chunks that should be queued for sending at one time. This
// helps smooth out spiky IO latency.
constexpr std::size_t kMaxQueuedChunks =;  // 128 * 8 KiB = 1 MiB

}  // namespace

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) {}

}  // namespace remoting