OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/tools/quic/test_tools/quic_test_utils.h" | 5 #include "net/tools/quic/test_tools/quic_test_utils.h" |
6 | 6 |
7 #include "base/sha1.h" | 7 #include "base/sha1.h" |
8 #include "net/quic/quic_connection.h" | 8 #include "net/quic/quic_connection.h" |
9 #include "net/quic/test_tools/quic_connection_peer.h" | 9 #include "net/quic/test_tools/quic_connection_peer.h" |
10 #include "net/quic/test_tools/quic_test_utils.h" | 10 #include "net/quic/test_tools/quic_test_utils.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 uint64 SimpleRandom::RandUint64() { | 58 uint64 SimpleRandom::RandUint64() { |
59 unsigned char hash[base::kSHA1Length]; | 59 unsigned char hash[base::kSHA1Length]; |
60 base::SHA1HashBytes(reinterpret_cast<unsigned char*>(&seed_), sizeof(seed_), | 60 base::SHA1HashBytes(reinterpret_cast<unsigned char*>(&seed_), sizeof(seed_), |
61 hash); | 61 hash); |
62 memcpy(&seed_, hash, sizeof(seed_)); | 62 memcpy(&seed_, hash, sizeof(seed_)); |
63 return seed_; | 63 return seed_; |
64 } | 64 } |
65 | 65 |
66 TestSession::TestSession(QuicConnection* connection, | 66 TestSession::TestSession(QuicConnection* connection, |
67 const QuicConfig& config) | 67 const QuicConfig& config) |
68 : QuicSession(connection, config, connection->is_server()), | 68 : QuicSession(connection, config), |
69 crypto_stream_(NULL) { | 69 crypto_stream_(NULL) { |
70 } | 70 } |
71 | 71 |
72 TestSession::~TestSession() {} | 72 TestSession::~TestSession() {} |
73 | 73 |
74 void TestSession::SetCryptoStream(QuicCryptoStream* stream) { | 74 void TestSession::SetCryptoStream(QuicCryptoStream* stream) { |
75 crypto_stream_ = stream; | 75 crypto_stream_ = stream; |
76 } | 76 } |
77 | 77 |
78 QuicCryptoStream* TestSession::GetCryptoStream() { | 78 QuicCryptoStream* TestSession::GetCryptoStream() { |
(...skipping 23 matching lines...) Expand all Loading... |
102 | 102 |
103 MockAckNotifierDelegate::MockAckNotifierDelegate() { | 103 MockAckNotifierDelegate::MockAckNotifierDelegate() { |
104 } | 104 } |
105 | 105 |
106 MockAckNotifierDelegate::~MockAckNotifierDelegate() { | 106 MockAckNotifierDelegate::~MockAckNotifierDelegate() { |
107 } | 107 } |
108 | 108 |
109 } // namespace test | 109 } // namespace test |
110 } // namespace tools | 110 } // namespace tools |
111 } // namespace net | 111 } // namespace net |
OLD | NEW |