| 302 | } |
| 303 | |
| 304 | virtual unique_ptr<TraceBufferChunk> GetChunk(size_t* index) OVERRIDE { |
| 305 | // This function may be called when adding normal events or indirectly from |
| 306 | // AddMetadataEventsWhileLocked(). We can not DECHECK(!IsFull()) because we |
| 307 | // have to add the metadata events and flush thread-local buffers even if |
| 308 | // the buffer is full. |
| 309 | *index = chunks_.size(); |
| 310 | chunks_.push_back(nullptr); // Put NULL in the slot of a in-flight chunk. |
| 311 | ++in_flight_chunk_count_; |
| 312 | // + 1 because zero chunk_seq is not allowed. |
| 313 | return unique_ptr<TraceBufferChunk>( |
| 314 | new TraceBufferChunk(static_cast<uint32_t>(*index) + 1)); |
| 315 | } |
| 316 | |
| 317 | virtual void ReturnChunk(size_t index, |
| 318 | unique_ptr<TraceBufferChunk> chunk) OVERRIDE { |
no test coverage detected