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_http_stream.h" | 5 #include "net/quic/quic_http_stream.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 #include "net/base/test_completion_callback.h" | 10 #include "net/base/test_completion_callback.h" |
11 #include "net/base/upload_bytes_element_reader.h" | 11 #include "net/base/upload_bytes_element_reader.h" |
12 #include "net/base/upload_data_stream.h" | 12 #include "net/base/upload_data_stream.h" |
13 #include "net/http/http_response_headers.h" | 13 #include "net/http/http_response_headers.h" |
14 #include "net/quic/congestion_control/receive_algorithm_interface.h" | 14 #include "net/quic/congestion_control/receive_algorithm_interface.h" |
15 #include "net/quic/congestion_control/send_algorithm_interface.h" | 15 #include "net/quic/congestion_control/send_algorithm_interface.h" |
16 #include "net/quic/crypto/crypto_protocol.h" | 16 #include "net/quic/crypto/crypto_protocol.h" |
17 #include "net/quic/crypto/quic_decrypter.h" | 17 #include "net/quic/crypto/quic_decrypter.h" |
18 #include "net/quic/crypto/quic_encrypter.h" | 18 #include "net/quic/crypto/quic_encrypter.h" |
| 19 #include "net/quic/crypto/quic_server_info.h" |
19 #include "net/quic/quic_client_session.h" | 20 #include "net/quic/quic_client_session.h" |
20 #include "net/quic/quic_connection.h" | 21 #include "net/quic/quic_connection.h" |
21 #include "net/quic/quic_connection_helper.h" | 22 #include "net/quic/quic_connection_helper.h" |
22 #include "net/quic/quic_default_packet_writer.h" | 23 #include "net/quic/quic_default_packet_writer.h" |
23 #include "net/quic/quic_http_utils.h" | 24 #include "net/quic/quic_http_utils.h" |
24 #include "net/quic/quic_reliable_client_stream.h" | 25 #include "net/quic/quic_reliable_client_stream.h" |
25 #include "net/quic/quic_write_blocked_list.h" | 26 #include "net/quic/quic_write_blocked_list.h" |
26 #include "net/quic/spdy_utils.h" | 27 #include "net/quic/spdy_utils.h" |
27 #include "net/quic/test_tools/mock_clock.h" | 28 #include "net/quic/test_tools/mock_clock.h" |
28 #include "net/quic/test_tools/mock_crypto_client_stream_factory.h" | 29 #include "net/quic/test_tools/mock_crypto_client_stream_factory.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 connection_id_, peer_addr_, | 197 connection_id_, peer_addr_, |
197 helper_.get(), writer_.get()); | 198 helper_.get(), writer_.get()); |
198 connection_->set_visitor(&visitor_); | 199 connection_->set_visitor(&visitor_); |
199 connection_->SetSendAlgorithm(send_algorithm_); | 200 connection_->SetSendAlgorithm(send_algorithm_); |
200 connection_->SetReceiveAlgorithm(receive_algorithm_); | 201 connection_->SetReceiveAlgorithm(receive_algorithm_); |
201 crypto_config_.SetDefaults(); | 202 crypto_config_.SetDefaults(); |
202 session_.reset( | 203 session_.reset( |
203 new QuicClientSession(connection_, | 204 new QuicClientSession(connection_, |
204 scoped_ptr<DatagramClientSocket>(socket), | 205 scoped_ptr<DatagramClientSocket>(socket), |
205 writer_.Pass(), NULL, | 206 writer_.Pass(), NULL, |
| 207 make_scoped_ptr((QuicServerInfo*)NULL), |
206 &crypto_client_stream_factory_, | 208 &crypto_client_stream_factory_, |
207 "www.google.com", DefaultQuicConfig(), | 209 "www.google.com", DefaultQuicConfig(), |
208 &crypto_config_, NULL)); | 210 &crypto_config_, NULL)); |
209 session_->GetCryptoStream()->CryptoConnect(); | 211 session_->GetCryptoStream()->CryptoConnect(); |
210 EXPECT_TRUE(session_->IsCryptoHandshakeConfirmed()); | 212 EXPECT_TRUE(session_->IsCryptoHandshakeConfirmed()); |
211 stream_.reset(use_closing_stream_ ? | 213 stream_.reset(use_closing_stream_ ? |
212 new AutoClosingStream(session_->GetWeakPtr()) : | 214 new AutoClosingStream(session_->GetWeakPtr()) : |
213 new QuicHttpStream(session_->GetWeakPtr())); | 215 new QuicHttpStream(session_->GetWeakPtr())); |
214 } | 216 } |
215 | 217 |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 // Set Delegate to NULL and make sure EffectivePriority returns highest | 608 // Set Delegate to NULL and make sure EffectivePriority returns highest |
607 // priority. | 609 // priority. |
608 reliable_stream->SetDelegate(NULL); | 610 reliable_stream->SetDelegate(NULL); |
609 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, | 611 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, |
610 reliable_stream->EffectivePriority()); | 612 reliable_stream->EffectivePriority()); |
611 reliable_stream->SetDelegate(delegate); | 613 reliable_stream->SetDelegate(delegate); |
612 } | 614 } |
613 | 615 |
614 } // namespace test | 616 } // namespace test |
615 } // namespace net | 617 } // namespace net |
OLD | NEW |