diff --git a/test/logging/memory_log_writer.cc b/test/logging/memory_log_writer.cc index 2eb1cffb48..f57f0317a9 100644 --- a/test/logging/memory_log_writer.cc +++ b/test/logging/memory_log_writer.cc @@ -21,25 +21,18 @@ class MemoryLogWriter final : public RtcEventLogOutput { explicit MemoryLogWriter(std::map* target, std::string filename) : target_(target), filename_(filename) {} - ~MemoryLogWriter() final { - size_t size; - buffer_.GetSize(&size); - target_->insert({filename_, std::string(buffer_.GetBuffer(), size)}); - } + ~MemoryLogWriter() final { target_->insert({filename_, std::move(buffer_)}); } bool IsActive() const override { return true; } bool Write(const std::string& value) override { - size_t written; - int error; - return buffer_.WriteAll(value.data(), value.size(), &written, &error) == - rtc::SR_SUCCESS; - RTC_DCHECK_EQ(value.size(), written); + buffer_.append(value); + return true; } void Flush() override {} private: std::map* const target_; const std::string filename_; - rtc::MemoryStream buffer_; + std::string buffer_; }; class MemoryLogWriterFactory : public LogWriterFactoryInterface { diff --git a/test/logging/memory_log_writer.h b/test/logging/memory_log_writer.h index daef297b88..e795b2fd10 100644 --- a/test/logging/memory_log_writer.h +++ b/test/logging/memory_log_writer.h @@ -15,7 +15,6 @@ #include #include -#include "rtc_base/memory_stream.h" #include "test/logging/log_writer.h" namespace webrtc {