Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: net/quic/quic_data_writer.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_data_writer.h ('k') | net/quic/quic_data_writer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_data_writer.cc
diff --git a/net/quic/quic_data_writer.cc b/net/quic/quic_data_writer.cc
index be8b357668d6b08435da36b76d8f2fdd96e9be07..1c6e47fe6aa66d2ba7bdb18c535b4274e97c14bc 100644
--- a/net/quic/quic_data_writer.cc
+++ b/net/quic/quic_data_writer.cc
@@ -16,22 +16,15 @@ using std::numeric_limits;
namespace net {
-QuicDataWriter::QuicDataWriter(size_t size)
- : buffer_(new char[size]),
- capacity_(size),
- length_(0) {
+QuicDataWriter::QuicDataWriter(size_t size, char* buffer)
+ : buffer_(buffer), capacity_(size), length_(0) {
}
QuicDataWriter::~QuicDataWriter() {
- delete[] buffer_;
}
-char* QuicDataWriter::take() {
- char* rv = buffer_;
- buffer_ = nullptr;
- capacity_ = 0;
- length_ = 0;
- return rv;
+char* QuicDataWriter::data() {
+ return buffer_;
}
bool QuicDataWriter::WriteUInt8(uint8 value) {
« no previous file with comments | « net/quic/quic_data_writer.h ('k') | net/quic/quic_data_writer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698