#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "base/trace_event/trace_buffer.h"
#include <memory>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/trace_event/heap_profiler.h"
#include "base/trace_event/trace_event_impl.h"
namespace base {
namespace trace_event {
namespace {
class TraceBufferRingBuffer : public TraceBuffer { … };
class TraceBufferVector : public TraceBuffer { … };
}
TraceBufferChunk::TraceBufferChunk(uint32_t seq) : … { … }
TraceBufferChunk::~TraceBufferChunk() = default;
void TraceBufferChunk::Reset(uint32_t new_seq) { … }
TraceEvent* TraceBufferChunk::AddTraceEvent(size_t* event_index) { … }
void TraceBufferChunk::EstimateTraceMemoryOverhead(
TraceEventMemoryOverhead* overhead) { … }
TraceResultBuffer::OutputCallback
TraceResultBuffer::SimpleOutput::GetCallback() { … }
void TraceResultBuffer::SimpleOutput::Append(
const std::string& json_trace_output) { … }
TraceResultBuffer::TraceResultBuffer() : … { … }
TraceResultBuffer::~TraceResultBuffer() = default;
void TraceResultBuffer::SetOutputCallback(OutputCallback json_chunk_callback) { … }
void TraceResultBuffer::Start() { … }
void TraceResultBuffer::AddFragment(const std::string& trace_fragment) { … }
void TraceResultBuffer::Finish() { … }
TraceBuffer* TraceBuffer::CreateTraceBufferRingBuffer(size_t max_chunks) { … }
TraceBuffer* TraceBuffer::CreateTraceBufferVectorOfSize(size_t max_chunks) { … }
}
}