| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/quic_spdy_server_stream.h" | 5 #include "net/tools/quic/quic_spdy_server_stream.h" |
| 6 | 6 |
| 7 #include "base/strings/string_number_conversions.h" | 7 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/string_piece.h" | 8 #include "base/strings/string_piece.h" |
| 9 #include "net/quic/quic_connection.h" | 9 #include "net/quic/quic_connection.h" |
| 10 #include "net/quic/quic_flags.h" | 10 #include "net/quic/quic_flags.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 headers_string_ = | 97 headers_string_ = |
| 98 net::SpdyUtils::SerializeUncompressedHeaders(request_headers); | 98 net::SpdyUtils::SerializeUncompressedHeaders(request_headers); |
| 99 | 99 |
| 100 // New streams rely on having the peer's flow control receive window | 100 // New streams rely on having the peer's flow control receive window |
| 101 // negotiated in the config. | 101 // negotiated in the config. |
| 102 session_.config()->SetInitialStreamFlowControlWindowToSend( | 102 session_.config()->SetInitialStreamFlowControlWindowToSend( |
| 103 kInitialStreamFlowControlWindowForTest); | 103 kInitialStreamFlowControlWindowForTest); |
| 104 session_.config()->SetInitialSessionFlowControlWindowToSend( | 104 session_.config()->SetInitialSessionFlowControlWindowToSend( |
| 105 kInitialSessionFlowControlWindowForTest); | 105 kInitialSessionFlowControlWindowForTest); |
| 106 stream_ = new QuicSpdyServerStreamPeer(5, &session_); | 106 stream_ = new QuicSpdyServerStreamPeer(::net::test::kClientDataStreamId1, |
| 107 &session_); |
| 107 // Register stream_ in dynamic_stream_map_ and pass ownership to session_. | 108 // Register stream_ in dynamic_stream_map_ and pass ownership to session_. |
| 108 session_.ActivateStream(stream_); | 109 session_.ActivateStream(stream_); |
| 109 | 110 |
| 110 QuicInMemoryCachePeer::ResetForTests(); | 111 QuicInMemoryCachePeer::ResetForTests(); |
| 111 } | 112 } |
| 112 | 113 |
| 113 ~QuicSpdyServerStreamTest() override { | 114 ~QuicSpdyServerStreamTest() override { |
| 114 QuicInMemoryCachePeer::ResetForTests(); | 115 QuicInMemoryCachePeer::ResetForTests(); |
| 115 } | 116 } |
| 116 | 117 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 StringPiece data(arr, arraysize(arr)); | 439 StringPiece data(arr, arraysize(arr)); |
| 439 QuicStreamFrame frame(stream_->id(), true, 0, data); | 440 QuicStreamFrame frame(stream_->id(), true, 0, data); |
| 440 // Verify that we don't crash when we get a invalid headers in stream frame. | 441 // Verify that we don't crash when we get a invalid headers in stream frame. |
| 441 stream_->OnStreamFrame(frame); | 442 stream_->OnStreamFrame(frame); |
| 442 } | 443 } |
| 443 | 444 |
| 444 } // namespace | 445 } // namespace |
| 445 } // namespace test | 446 } // namespace test |
| 446 } // namespace tools | 447 } // namespace tools |
| 447 } // namespace net | 448 } // namespace net |
| OLD | NEW |