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

Unified Diff: net/tools/quic/test_tools/quic_test_client.cc

Issue 2588043002: Pass value and use std::move instead of const reference for ack listeners. (Closed)
Patch Set: Created 4 years 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/tools/quic/test_tools/quic_test_client.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/test_tools/quic_test_client.cc
diff --git a/net/tools/quic/test_tools/quic_test_client.cc b/net/tools/quic/test_tools/quic_test_client.cc
index 367008b9d36917a6b72d2c95594155e91952b922..035df6bc155a78d3e7e0caa2e4c34b524ec5afab 100644
--- a/net/tools/quic/test_tools/quic_test_client.cc
+++ b/net/tools/quic/test_tools/quic_test_client.cc
@@ -292,7 +292,7 @@ ssize_t QuicTestClient::GetOrCreateStreamAndSendRequest(
const SpdyHeaderBlock* headers,
StringPiece body,
bool fin,
- const scoped_refptr<QuicAckListenerInterface>& delegate) {
+ scoped_refptr<QuicAckListenerInterface> delegate) {
if (headers) {
QuicClientPushPromiseIndex::TryHandle* handle;
QuicAsyncStatus rv =
@@ -304,7 +304,7 @@ ssize_t QuicTestClient::GetOrCreateStreamAndSendRequest(
std::unique_ptr<SpdyHeaderBlock> new_headers(
new SpdyHeaderBlock(headers->Clone()));
push_promise_data_to_resend_.reset(new TestClientDataToResend(
- std::move(new_headers), body, fin, this, delegate));
+ std::move(new_headers), body, fin, this, std::move(delegate)));
return 1;
}
}
@@ -377,9 +377,9 @@ ssize_t QuicTestClient::SendData(const string& data, bool last_data) {
ssize_t QuicTestClient::SendData(
const string& data,
bool last_data,
- const scoped_refptr<QuicAckListenerInterface>& delegate) {
+ scoped_refptr<QuicAckListenerInterface> delegate) {
return GetOrCreateStreamAndSendRequest(nullptr, StringPiece(data), last_data,
- delegate);
+ std::move(delegate));
}
bool QuicTestClient::response_complete() const {
@@ -677,10 +677,10 @@ QuicTestClient::TestClientDataToResend::TestClientDataToResend(
base::StringPiece body,
bool fin,
QuicTestClient* test_client,
- const scoped_refptr<QuicAckListenerInterface>& delegate)
+ scoped_refptr<QuicAckListenerInterface> delegate)
: QuicClient::QuicDataToResend(std::move(headers), body, fin),
test_client_(test_client),
- delegate_(delegate) {}
+ delegate_(std::move(delegate)) {}
QuicTestClient::TestClientDataToResend::~TestClientDataToResend() {}
« no previous file with comments | « net/tools/quic/test_tools/quic_test_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698