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