| 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/tools/quic/quic_dispatcher.h" | 5 #include "net/tools/quic/quic_dispatcher.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
| 10 #include "net/quic/crypto/crypto_handshake.h" | 10 #include "net/quic/crypto/crypto_handshake.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 EXPECT_CALL(*time_wait_list_manager, | 257 EXPECT_CALL(*time_wait_list_manager, |
| 258 ProcessPacket(_, _, connection_id, _, _)).Times(1); | 258 ProcessPacket(_, _, connection_id, _, _)).Times(1); |
| 259 string data = "foo"; | 259 string data = "foo"; |
| 260 ProcessPacket(client_address, connection_id, false, "foo"); | 260 ProcessPacket(client_address, connection_id, false, "foo"); |
| 261 } | 261 } |
| 262 | 262 |
| 263 class BlockingWriter : public QuicPacketWriterWrapper { | 263 class BlockingWriter : public QuicPacketWriterWrapper { |
| 264 public: | 264 public: |
| 265 BlockingWriter() : write_blocked_(false) {} | 265 BlockingWriter() : write_blocked_(false) {} |
| 266 | 266 |
| 267 virtual bool IsWriteBlocked() const OVERRIDE { return write_blocked_; } | 267 virtual bool IsWriteBlocked() const override { return write_blocked_; } |
| 268 virtual void SetWritable() OVERRIDE { write_blocked_ = false; } | 268 virtual void SetWritable() override { write_blocked_ = false; } |
| 269 | 269 |
| 270 virtual WriteResult WritePacket( | 270 virtual WriteResult WritePacket( |
| 271 const char* buffer, | 271 const char* buffer, |
| 272 size_t buf_len, | 272 size_t buf_len, |
| 273 const IPAddressNumber& self_client_address, | 273 const IPAddressNumber& self_client_address, |
| 274 const IPEndPoint& peer_client_address) OVERRIDE { | 274 const IPEndPoint& peer_client_address) override { |
| 275 // It would be quite possible to actually implement this method here with | 275 // It would be quite possible to actually implement this method here with |
| 276 // the fake blocked status, but it would be significantly more work in | 276 // the fake blocked status, but it would be significantly more work in |
| 277 // Chromium, and since it's not called anyway, don't bother. | 277 // Chromium, and since it's not called anyway, don't bother. |
| 278 LOG(DFATAL) << "Not supported"; | 278 LOG(DFATAL) << "Not supported"; |
| 279 return WriteResult(); | 279 return WriteResult(); |
| 280 } | 280 } |
| 281 | 281 |
| 282 bool write_blocked_; | 282 bool write_blocked_; |
| 283 }; | 283 }; |
| 284 | 284 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 // And we'll resume where we left off when we get another call. | 452 // And we'll resume where we left off when we get another call. |
| 453 EXPECT_CALL(*connection2(), OnCanWrite()); | 453 EXPECT_CALL(*connection2(), OnCanWrite()); |
| 454 dispatcher_.OnCanWrite(); | 454 dispatcher_.OnCanWrite(); |
| 455 EXPECT_FALSE(dispatcher_.HasPendingWrites()); | 455 EXPECT_FALSE(dispatcher_.HasPendingWrites()); |
| 456 } | 456 } |
| 457 | 457 |
| 458 } // namespace | 458 } // namespace |
| 459 } // namespace test | 459 } // namespace test |
| 460 } // namespace tools | 460 } // namespace tools |
| 461 } // namespace net | 461 } // namespace net |
| OLD | NEW |