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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 : QuicConnection(connection_id, | 83 : QuicConnection(connection_id, |
84 address, | 84 address, |
85 helper, | 85 helper, |
86 alarm_factory, | 86 alarm_factory, |
87 writer, | 87 writer, |
88 true /* owns_writer */, | 88 true /* owns_writer */, |
89 Perspective::IS_CLIENT, | 89 Perspective::IS_CLIENT, |
90 versions) {} | 90 versions) {} |
91 | 91 |
92 void SetSendAlgorithm(SendAlgorithmInterface* send_algorithm) { | 92 void SetSendAlgorithm(SendAlgorithmInterface* send_algorithm) { |
93 QuicConnectionPeer::SetSendAlgorithm(this, send_algorithm); | 93 QuicConnectionPeer::SetSendAlgorithm(this, kDefaultPathId, send_algorithm); |
94 } | 94 } |
95 }; | 95 }; |
96 | 96 |
97 // Subclass of QuicHttpStream that closes itself when the first piece of data | 97 // Subclass of QuicHttpStream that closes itself when the first piece of data |
98 // is received. | 98 // is received. |
99 class AutoClosingStream : public QuicHttpStream { | 99 class AutoClosingStream : public QuicHttpStream { |
100 public: | 100 public: |
101 explicit AutoClosingStream( | 101 explicit AutoClosingStream( |
102 const base::WeakPtr<QuicChromiumClientSession>& session) | 102 const base::WeakPtr<QuicChromiumClientSession>& session) |
103 : QuicHttpStream(session) {} | 103 : QuicHttpStream(session) {} |
(...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1907 EXPECT_TRUE(AtEof()); | 1907 EXPECT_TRUE(AtEof()); |
1908 | 1908 |
1909 // QuicHttpStream::GetTotalSent/ReceivedBytes includes only headers. | 1909 // QuicHttpStream::GetTotalSent/ReceivedBytes includes only headers. |
1910 EXPECT_EQ(static_cast<int64_t>(spdy_request_headers_frame_length), | 1910 EXPECT_EQ(static_cast<int64_t>(spdy_request_headers_frame_length), |
1911 stream_->GetTotalSentBytes()); | 1911 stream_->GetTotalSentBytes()); |
1912 EXPECT_EQ(0, stream_->GetTotalReceivedBytes()); | 1912 EXPECT_EQ(0, stream_->GetTotalReceivedBytes()); |
1913 } | 1913 } |
1914 | 1914 |
1915 } // namespace test | 1915 } // namespace test |
1916 } // namespace net | 1916 } // namespace net |
OLD | NEW |