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

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

Issue 2363393004: Remove usage of BalsaHeaders from QuicClient. Also move QuicDataToResend from QuicClient to QuicCli… (Closed)
Patch Set: Fix win Created 4 years, 3 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/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 c2a95aa102a98ade248edff5209ed3c5ee119a57..41846fd7d14d7c4cb611697c457829f999a3b216 100644
--- a/net/tools/quic/test_tools/quic_test_client.cc
+++ b/net/tools/quic/test_tools/quic_test_client.cc
@@ -321,10 +321,10 @@ ssize_t QuicTestClient::GetOrCreateStreamAndSendRequest(
return 1;
if (rv == QUIC_PENDING) {
// May need to retry request if asynchronous rendezvous fails.
- auto* new_headers = new BalsaHeaders;
- new_headers->CopyFrom(*headers);
- push_promise_data_to_resend_.reset(
- new TestClientDataToResend(new_headers, body, fin, this, delegate));
+ std::unique_ptr<SpdyHeaderBlock> new_headers(new SpdyHeaderBlock(
+ SpdyBalsaUtils::RequestHeadersToSpdyHeaders(*headers)));
+ push_promise_data_to_resend_.reset(new TestClientDataToResend(
+ std::move(new_headers), body, fin, this, delegate));
return 1;
}
}
@@ -359,13 +359,14 @@ ssize_t QuicTestClient::GetOrCreateStreamAndSendRequest(
ret = body.length();
}
if (FLAGS_enable_quic_stateless_reject_support) {
- BalsaHeaders* new_headers = nullptr;
+ std::unique_ptr<SpdyHeaderBlock> new_headers;
if (headers) {
- new_headers = new BalsaHeaders;
- new_headers->CopyFrom(*headers);
+ new_headers.reset(new SpdyHeaderBlock(
+ SpdyBalsaUtils::RequestHeadersToSpdyHeaders(*headers)));
}
- std::unique_ptr<QuicClient::QuicDataToResend> data_to_resend(
- new TestClientDataToResend(new_headers, body, fin, this, delegate));
+ std::unique_ptr<QuicClientBase::QuicDataToResend> data_to_resend(
+ new TestClientDataToResend(std::move(new_headers), body, fin, this,
+ delegate));
client()->MaybeAddQuicDataToResend(std::move(data_to_resend));
}
return ret;
@@ -736,12 +737,11 @@ void QuicTestClient::WaitForWriteToFlush() {
}
void QuicTestClient::TestClientDataToResend::Resend() {
- test_client_->GetOrCreateStreamAndSendRequest(headers_, body_, fin_,
+ BalsaHeaders balsa_headers;
+ SpdyBalsaUtils::SpdyHeadersToRequestHeaders(*headers_, &balsa_headers);
+ test_client_->GetOrCreateStreamAndSendRequest(&balsa_headers, body_, fin_,
delegate_);
- if (headers_ != nullptr) {
- delete headers_;
- headers_ = nullptr;
- }
+ headers_.reset();
}
// static
« 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