#include "content/renderer/media/batching_media_log.h"
#include <sstream>
#include "base/functional/bind.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/default_tick_clock.h"
#include "media/base/logging_override_if_enabled.h"
namespace {
std::string ToJSON(const media::MediaLogRecord& event) { … }
void Log(const media::MediaLogRecord& event) { … }
}
namespace content {
BatchingMediaLog::BatchingMediaLog(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
std::vector<std::unique_ptr<EventHandler>> event_handlers)
: … { … }
BatchingMediaLog::~BatchingMediaLog() { … }
void BatchingMediaLog::Stop() { … }
void BatchingMediaLog::OnWebMediaPlayerDestroyedLocked() { … }
void BatchingMediaLog::AddLogRecordLocked(
std::unique_ptr<media::MediaLogRecord> event) { … }
std::string BatchingMediaLog::GetErrorMessageLocked() { … }
std::string BatchingMediaLog::MediaEventToMessageString(
const media::MediaLogRecord& event) { … }
void BatchingMediaLog::SendQueuedMediaEvents() { … }
void BatchingMediaLog::SetTickClockForTesting(
const base::TickClock* tick_clock) { … }
void BatchingMediaLog::MaybeQueueEvent_Locked(
std::unique_ptr<media::MediaLogRecord> event) { … }
}