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

Unified Diff: net/quic/test_tools/simple_quic_framer.cc

Issue 2417023003: Remove stl_util's deletion functions from: (Closed)
Patch Set: internal snapshot 10 Created 4 years, 2 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/test_tools/simple_quic_framer.h ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/simple_quic_framer.cc
diff --git a/net/quic/test_tools/simple_quic_framer.cc b/net/quic/test_tools/simple_quic_framer.cc
index 2dcd179b28a30423916548a10db159573b01acff..6ffb1211adaccdef331056b9bd82fcf86183d8e8 100644
--- a/net/quic/test_tools/simple_quic_framer.cc
+++ b/net/quic/test_tools/simple_quic_framer.cc
@@ -7,7 +7,7 @@
#include <memory>
#include "base/macros.h"
-#include "base/stl_util.h"
+#include "base/memory/ptr_util.h"
#include "net/quic/core/crypto/quic_decrypter.h"
#include "net/quic/core/crypto/quic_encrypter.h"
@@ -22,10 +22,7 @@ class SimpleFramerVisitor : public QuicFramerVisitorInterface {
public:
SimpleFramerVisitor() : error_(QUIC_NO_ERROR) {}
- ~SimpleFramerVisitor() override {
- base::STLDeleteElements(&stream_frames_);
- base::STLDeleteElements(&stream_data_);
- }
+ ~SimpleFramerVisitor() override {}
void OnError(QuicFramer* framer) override { error_ = framer->error(); }
@@ -59,9 +56,9 @@ class SimpleFramerVisitor : public QuicFramerVisitorInterface {
string* string_data = new string();
StringPiece(frame.data_buffer, frame.data_length)
.AppendToString(string_data);
- stream_data_.push_back(string_data);
+ stream_data_.push_back(base::WrapUnique(string_data));
// TODO(ianswett): A pointer isn't necessary with emplace_back.
- stream_frames_.push_back(new QuicStreamFrame(
+ stream_frames_.push_back(base::MakeUnique<QuicStreamFrame>(
frame.stream_id, frame.fin, frame.offset, StringPiece(*string_data)));
return true;
}
@@ -129,7 +126,7 @@ class SimpleFramerVisitor : public QuicFramerVisitorInterface {
const vector<QuicRstStreamFrame>& rst_stream_frames() const {
return rst_stream_frames_;
}
- const vector<QuicStreamFrame*>& stream_frames() const {
+ const vector<std::unique_ptr<QuicStreamFrame>>& stream_frames() const {
return stream_frames_;
}
const vector<QuicStopWaitingFrame>& stop_waiting_frames() const {
@@ -150,14 +147,14 @@ class SimpleFramerVisitor : public QuicFramerVisitorInterface {
vector<QuicStopWaitingFrame> stop_waiting_frames_;
vector<QuicPaddingFrame> padding_frames_;
vector<QuicPingFrame> ping_frames_;
- vector<QuicStreamFrame*> stream_frames_;
+ vector<std::unique_ptr<QuicStreamFrame>> stream_frames_;
vector<QuicRstStreamFrame> rst_stream_frames_;
vector<QuicGoAwayFrame> goaway_frames_;
vector<QuicConnectionCloseFrame> connection_close_frames_;
vector<QuicWindowUpdateFrame> window_update_frames_;
vector<QuicBlockedFrame> blocked_frames_;
vector<QuicPathCloseFrame> path_close_frames_;
- vector<string*> stream_data_;
+ vector<std::unique_ptr<string>> stream_data_;
DISALLOW_COPY_AND_ASSIGN(SimpleFramerVisitor);
};
@@ -219,7 +216,8 @@ const vector<QuicPingFrame>& SimpleQuicFramer::ping_frames() const {
return visitor_->ping_frames();
}
-const vector<QuicStreamFrame*>& SimpleQuicFramer::stream_frames() const {
+const vector<std::unique_ptr<QuicStreamFrame>>&
+SimpleQuicFramer::stream_frames() const {
return visitor_->stream_frames();
}
« no previous file with comments | « net/quic/test_tools/simple_quic_framer.h ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698