| 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/chunked_upload_data_stream.h" | 9 #include "net/base/chunked_upload_data_stream.h" |
| 10 #include "net/base/elements_upload_data_stream.h" | 10 #include "net/base/elements_upload_data_stream.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 // Subclass of QuicHttpStream that closes itself when the first piece of data | 93 // Subclass of QuicHttpStream that closes itself when the first piece of data |
| 94 // is received. | 94 // is received. |
| 95 class AutoClosingStream : public QuicHttpStream { | 95 class AutoClosingStream : public QuicHttpStream { |
| 96 public: | 96 public: |
| 97 explicit AutoClosingStream(const base::WeakPtr<QuicClientSession>& session) | 97 explicit AutoClosingStream(const base::WeakPtr<QuicClientSession>& session) |
| 98 : QuicHttpStream(session) { | 98 : QuicHttpStream(session) { |
| 99 } | 99 } |
| 100 | 100 |
| 101 virtual int OnDataReceived(const char* data, int length) override { | 101 int OnDataReceived(const char* data, int length) override { |
| 102 Close(false); | 102 Close(false); |
| 103 return OK; | 103 return OK; |
| 104 } | 104 } |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 class TestPacketWriterFactory : public QuicConnection::PacketWriterFactory { | 107 class TestPacketWriterFactory : public QuicConnection::PacketWriterFactory { |
| 108 public: | 108 public: |
| 109 explicit TestPacketWriterFactory(DatagramClientSocket* socket) | 109 explicit TestPacketWriterFactory(DatagramClientSocket* socket) |
| 110 : socket_(socket) {} | 110 : socket_(socket) {} |
| 111 virtual ~TestPacketWriterFactory() {} | 111 ~TestPacketWriterFactory() override {} |
| 112 | 112 |
| 113 virtual QuicPacketWriter* Create(QuicConnection* connection) const override { | 113 QuicPacketWriter* Create(QuicConnection* connection) const override { |
| 114 return new QuicDefaultPacketWriter(socket_); | 114 return new QuicDefaultPacketWriter(socket_); |
| 115 } | 115 } |
| 116 | 116 |
| 117 private: | 117 private: |
| 118 DatagramClientSocket* socket_; | 118 DatagramClientSocket* socket_; |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 } // namespace | 121 } // namespace |
| 122 | 122 |
| 123 class QuicHttpStreamPeer { | 123 class QuicHttpStreamPeer { |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 // Set Delegate to nullptr and make sure EffectivePriority returns highest | 772 // Set Delegate to nullptr and make sure EffectivePriority returns highest |
| 773 // priority. | 773 // priority. |
| 774 reliable_stream->SetDelegate(nullptr); | 774 reliable_stream->SetDelegate(nullptr); |
| 775 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, | 775 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, |
| 776 reliable_stream->EffectivePriority()); | 776 reliable_stream->EffectivePriority()); |
| 777 reliable_stream->SetDelegate(delegate); | 777 reliable_stream->SetDelegate(delegate); |
| 778 } | 778 } |
| 779 | 779 |
| 780 } // namespace test | 780 } // namespace test |
| 781 } // namespace net | 781 } // namespace net |
| OLD | NEW |