#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/media/webrtc/webrtc_event_log_history.h"
#include <limits>
#include <utility>
#include <vector>
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "chrome/browser/media/webrtc/webrtc_event_log_manager_common.h"
namespace webrtc_event_logging {
const size_t kWebRtcEventLogMaxUploadIdBytes = …;
namespace {
const char kCaptureTimeLinePrefix[] = …;
const char kUploadTimeLinePrefix[] = …;
const char kUploadIdLinePrefix[] = …;
const char kEOL[] = …;
static_assert …;
std::string DeltaFromEpochSeconds(base::Time time) { … }
base::Time StringToTime(const std::string& time) { … }
bool ParseTime(const std::string& line,
const std::string& prefix,
base::Time* out) { … }
bool ParseString(const std::string& line,
const std::string& prefix,
std::string* out) { … }
}
std::unique_ptr<WebRtcEventLogHistoryFileWriter>
WebRtcEventLogHistoryFileWriter::Create(const base::FilePath& path) { … }
WebRtcEventLogHistoryFileWriter::WebRtcEventLogHistoryFileWriter(
const base::FilePath& path)
: … { … }
bool WebRtcEventLogHistoryFileWriter::Init() { … }
bool WebRtcEventLogHistoryFileWriter::WriteCaptureTime(
base::Time capture_time) { … }
bool WebRtcEventLogHistoryFileWriter::WriteUploadTime(base::Time upload_time) { … }
bool WebRtcEventLogHistoryFileWriter::WriteUploadId(
const std::string& upload_id) { … }
void WebRtcEventLogHistoryFileWriter::Delete() { … }
base::FilePath WebRtcEventLogHistoryFileWriter::path() const { … }
bool WebRtcEventLogHistoryFileWriter::Write(const std::string& str) { … }
std::unique_ptr<WebRtcEventLogHistoryFileReader>
WebRtcEventLogHistoryFileReader::Create(const base::FilePath& path) { … }
WebRtcEventLogHistoryFileReader::WebRtcEventLogHistoryFileReader(
const base::FilePath& path)
: … { … }
WebRtcEventLogHistoryFileReader::WebRtcEventLogHistoryFileReader(
WebRtcEventLogHistoryFileReader&& other)
: … { … }
bool WebRtcEventLogHistoryFileReader::Init() { … }
std::string WebRtcEventLogHistoryFileReader::LocalId() const { … }
base::Time WebRtcEventLogHistoryFileReader::CaptureTime() const { … }
base::Time WebRtcEventLogHistoryFileReader::UploadTime() const { … }
std::string WebRtcEventLogHistoryFileReader::UploadId() const { … }
base::FilePath WebRtcEventLogHistoryFileReader::path() const { … }
bool WebRtcEventLogHistoryFileReader::operator<(
const WebRtcEventLogHistoryFileReader& other) const { … }
bool WebRtcEventLogHistoryFileReader::Parse(const std::string& file_contents) { … }
}