| 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/quic/quic_connection.h" | 5 #include "net/quic/quic_connection.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <iterator> | 10 #include <iterator> |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 NOT_HANDSHAKE : packet.retransmittable_frames->HasCryptoHandshake()), | 183 NOT_HANDSHAKE : packet.retransmittable_frames->HasCryptoHandshake()), |
| 184 type(GetPacketType(packet.retransmittable_frames)), | 184 type(GetPacketType(packet.retransmittable_frames)), |
| 185 length(packet.packet->length()) { | 185 length(packet.packet->length()) { |
| 186 } | 186 } |
| 187 | 187 |
| 188 #define ENDPOINT (is_server_ ? "Server: " : " Client: ") | 188 #define ENDPOINT (is_server_ ? "Server: " : " Client: ") |
| 189 | 189 |
| 190 QuicConnection::QuicConnection(QuicConnectionId connection_id, | 190 QuicConnection::QuicConnection(QuicConnectionId connection_id, |
| 191 IPEndPoint address, | 191 IPEndPoint address, |
| 192 QuicConnectionHelperInterface* helper, | 192 QuicConnectionHelperInterface* helper, |
| 193 QuicPacketWriter* writer, | 193 const PacketWriterFactory& writer_factory, |
| 194 bool owns_writer, | 194 bool owns_writer, |
| 195 bool is_server, | 195 bool is_server, |
| 196 const QuicVersionVector& supported_versions) | 196 const QuicVersionVector& supported_versions) |
| 197 : framer_(supported_versions, helper->GetClock()->ApproximateNow(), | 197 : framer_(supported_versions, helper->GetClock()->ApproximateNow(), |
| 198 is_server), | 198 is_server), |
| 199 helper_(helper), | 199 helper_(helper), |
| 200 writer_(writer), | 200 writer_(writer_factory.Create(this)), |
| 201 owns_writer_(owns_writer), | 201 owns_writer_(owns_writer), |
| 202 encryption_level_(ENCRYPTION_NONE), | 202 encryption_level_(ENCRYPTION_NONE), |
| 203 clock_(helper->GetClock()), | 203 clock_(helper->GetClock()), |
| 204 random_generator_(helper->GetRandomGenerator()), | 204 random_generator_(helper->GetRandomGenerator()), |
| 205 connection_id_(connection_id), | 205 connection_id_(connection_id), |
| 206 peer_address_(address), | 206 peer_address_(address), |
| 207 migrating_peer_port_(0), | 207 migrating_peer_port_(0), |
| 208 last_packet_revived_(false), | 208 last_packet_revived_(false), |
| 209 last_size_(0), | 209 last_size_(0), |
| 210 last_decrypted_packet_level_(ENCRYPTION_NONE), | 210 last_decrypted_packet_level_(ENCRYPTION_NONE), |
| (...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1988 // If we changed the generator's batch state, restore original batch state. | 1988 // If we changed the generator's batch state, restore original batch state. |
| 1989 if (!already_in_batch_mode_) { | 1989 if (!already_in_batch_mode_) { |
| 1990 DVLOG(1) << "Leaving Batch Mode."; | 1990 DVLOG(1) << "Leaving Batch Mode."; |
| 1991 connection_->packet_generator_.FinishBatchOperations(); | 1991 connection_->packet_generator_.FinishBatchOperations(); |
| 1992 } | 1992 } |
| 1993 DCHECK_EQ(already_in_batch_mode_, | 1993 DCHECK_EQ(already_in_batch_mode_, |
| 1994 connection_->packet_generator_.InBatchMode()); | 1994 connection_->packet_generator_.InBatchMode()); |
| 1995 } | 1995 } |
| 1996 | 1996 |
| 1997 } // namespace net | 1997 } // namespace net |
| OLD | NEW |