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

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

Issue 218923002: Merge internal change: 63891842 - QuicServerId changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
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 d9fa2194317d37285f80bd6cba214b52443cc8f3..ac25a5baaa7c7f4435c88f60f13bc3385115193e 100644
--- a/net/tools/quic/test_tools/quic_test_client.cc
+++ b/net/tools/quic/test_tools/quic_test_client.cc
@@ -10,7 +10,7 @@
#include "net/cert/cert_verify_result.h"
#include "net/cert/x509_certificate.h"
#include "net/quic/crypto/proof_verifier.h"
-#include "net/quic/quic_session_key.h"
+#include "net/quic/quic_server_id.h"
#include "net/quic/test_tools/quic_connection_peer.h"
#include "net/quic/test_tools/quic_test_utils.h"
#include "net/tools/balsa/balsa_headers.h"
@@ -22,6 +22,7 @@
#include "url/gurl.h"
using base::StringPiece;
+using net::QuicServerId;
using net::test::kInitialFlowControlWindowForTest;
using net::test::QuicConnectionPeer;
using std::string;
@@ -101,11 +102,11 @@ BalsaHeaders* MungeHeaders(const BalsaHeaders* const_headers,
class MockableQuicClient : public QuicClient {
public:
MockableQuicClient(IPEndPoint server_address,
- const QuicSessionKey& server_key,
+ const QuicServerId& server_id,
const QuicVersionVector& supported_versions,
uint32 initial_flow_control_window)
: QuicClient(server_address,
- server_key,
+ server_id,
supported_versions,
false,
initial_flow_control_window),
@@ -113,12 +114,12 @@ class MockableQuicClient : public QuicClient {
test_writer_(NULL) {}
MockableQuicClient(IPEndPoint server_address,
- const QuicSessionKey& server_key,
+ const QuicServerId& server_id,
const QuicConfig& config,
const QuicVersionVector& supported_versions,
uint32 initial_flow_control_window)
: QuicClient(server_address,
- server_key,
+ server_id,
config,
supported_versions,
initial_flow_control_window),
@@ -160,48 +161,56 @@ class MockableQuicClient : public QuicClient {
QuicPacketWriterWrapper* test_writer_;
};
-QuicTestClient::QuicTestClient(IPEndPoint address,
- const QuicSessionKey& server_key,
+QuicTestClient::QuicTestClient(IPEndPoint server_address,
+ const string& server_hostname,
const QuicVersionVector& supported_versions)
- : client_(new MockableQuicClient(address,
- server_key,
+ : client_(new MockableQuicClient(server_address,
+ QuicServerId(server_hostname,
+ server_address.port(),
+ false,
+ kPrivacyModeDisabled),
supported_versions,
kInitialFlowControlWindowForTest)) {
- Initialize(address, server_key, true);
+ Initialize(server_address, server_hostname, true);
}
-QuicTestClient::QuicTestClient(IPEndPoint address,
- const QuicSessionKey& server_key,
+QuicTestClient::QuicTestClient(IPEndPoint server_address,
+ const string& server_hostname,
bool secure,
const QuicVersionVector& supported_versions)
- : client_(new MockableQuicClient(address,
- server_key,
+ : client_(new MockableQuicClient(server_address,
+ QuicServerId(server_hostname,
+ server_address.port(),
+ secure,
+ kPrivacyModeDisabled),
supported_versions,
kInitialFlowControlWindowForTest)) {
- Initialize(address, server_key, secure);
+ Initialize(server_address, server_hostname, secure);
}
QuicTestClient::QuicTestClient(
- IPEndPoint address,
- const QuicSessionKey& server_key,
+ IPEndPoint server_address,
+ const string& server_hostname,
bool secure,
const QuicConfig& config,
const QuicVersionVector& supported_versions,
uint32 client_initial_flow_control_receive_window)
: client_(
- new MockableQuicClient(address,
- server_key,
+ new MockableQuicClient(server_address,
+ QuicServerId(server_hostname,
+ server_address.port(),
+ secure,
+ kPrivacyModeDisabled),
config,
supported_versions,
client_initial_flow_control_receive_window)) {
- Initialize(address, server_key, secure);
+ Initialize(server_address, server_hostname, secure);
}
void QuicTestClient::Initialize(IPEndPoint address,
- const QuicSessionKey& server_key,
+ const string& hostname,
bool secure) {
server_address_ = address;
- server_key_ = server_key;
priority_ = 3;
connect_attempted_ = false;
secure_ = secure;
@@ -240,9 +249,9 @@ ssize_t QuicTestClient::SendMessage(const HTTPMessage& message) {
if (!connected()) {
GURL url(message.headers()->request_uri().as_string());
if (!url.host().empty()) {
- client_->set_server_key(
- QuicSessionKey(url.host(), url.EffectiveIntPort(),
- url.SchemeIs("https"), kPrivacyModeDisabled));
+ client_->set_server_id(
+ QuicServerId(url.host(), url.EffectiveIntPort(),
+ url.SchemeIs("https"), kPrivacyModeDisabled));
}
}
@@ -323,7 +332,7 @@ QuicTagValueMap QuicTestClient::GetServerConfig() const {
net::QuicCryptoClientConfig* config =
QuicClientPeer::GetCryptoConfig(client_.get());
net::QuicCryptoClientConfig::CachedState* state =
- config->LookupOrCreate(client_->server_key());
+ config->LookupOrCreate(client_->server_id());
const net::CryptoHandshakeMessage* handshake_msg = state->GetServerConfig();
if (handshake_msg != NULL) {
return handshake_msg->tag_value_map();
« net/quic/quic_server_id_test.cc ('K') | « 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