#include "remoting/host/file_transfer/rtc_log_file_operations.h"
#include <algorithm>
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/i18n/time_formatting.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/time.h"
#include "remoting/protocol/connection_to_client.h"
#include "remoting/protocol/file_transfer_helpers.h"
#include "remoting/protocol/webrtc_event_log_data.h"
namespace remoting {
namespace {
class RtcLogFileReader : public FileOperations::Reader { … };
class RtcLogFileWriter : public FileOperations::Writer { … };
RtcLogFileReader::RtcLogFileReader(protocol::ConnectionToClient* connection)
: … { … }
RtcLogFileReader::~RtcLogFileReader() = default;
void RtcLogFileReader::Open(OpenCallback callback) { … }
void RtcLogFileReader::ReadChunk(std::size_t size, ReadCallback callback) { … }
const base::FilePath& RtcLogFileReader::filename() const { … }
std::uint64_t RtcLogFileReader::size() const { … }
FileOperations::State RtcLogFileReader::state() const { … }
void RtcLogFileReader::DoOpen(OpenCallback callback) { … }
void RtcLogFileReader::DoReadChunk(std::size_t size, ReadCallback callback) { … }
int RtcLogFileReader::ReadPartially(int maximum_to_read,
std::vector<std::uint8_t>& output) { … }
void RtcLogFileWriter::Open(const base::FilePath& filename, Callback callback) { … }
void RtcLogFileWriter::WriteChunk(std::vector<std::uint8_t> data,
Callback callback) { … }
void RtcLogFileWriter::Close(Callback callback) { … }
FileOperations::State RtcLogFileWriter::state() const { … }
}
RtcLogFileOperations::RtcLogFileOperations(
protocol::ConnectionToClient* connection)
: … { … }
RtcLogFileOperations::~RtcLogFileOperations() = default;
std::unique_ptr<FileOperations::Reader> RtcLogFileOperations::CreateReader() { … }
std::unique_ptr<FileOperations::Writer> RtcLogFileOperations::CreateWriter() { … }
}