Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(415)

Unified Diff: net/tools/quic/quic_dispatcher_test.cc

Issue 467963002: Refactoring: Create per-connection packet writers in QuicDispatcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/tools/quic/quic_dispatcher_test.cc
diff --git a/net/tools/quic/quic_dispatcher_test.cc b/net/tools/quic/quic_dispatcher_test.cc
index 4c778cbd425c7f7be9858947e2bef6d08f91d0a7..33685c9cb52def01123bc225f6d7771a3fe81712 100644
--- a/net/tools/quic/quic_dispatcher_test.cc
+++ b/net/tools/quic/quic_dispatcher_test.cc
@@ -48,6 +48,7 @@ class TestDispatcher : public QuicDispatcher {
: QuicDispatcher(config,
crypto_config,
QuicSupportedVersions(),
+ new QuicDispatcher::DefaultPacketWriterFactory(),
eps) {
}
@@ -271,12 +272,11 @@ class BlockingWriter : public QuicPacketWriterWrapper {
size_t buf_len,
const IPAddressNumber& self_client_address,
const IPEndPoint& peer_client_address) OVERRIDE {
- if (write_blocked_) {
- return WriteResult(WRITE_STATUS_BLOCKED, EAGAIN);
- } else {
- return QuicPacketWriterWrapper::WritePacket(
- buffer, buf_len, self_client_address, peer_client_address);
- }
+ // It would be quite possible to actually implement this method here with
+ // the fake blocked status, but it would be significantly more work in
+ // Chromium, and since it's not called anyway, don't bother.
+ LOG(DFATAL) << "Not supported";
+ return WriteResult();
}
bool write_blocked_;
@@ -286,6 +286,8 @@ class QuicDispatcherWriteBlockedListTest : public QuicDispatcherTest {
public:
virtual void SetUp() {
writer_ = new BlockingWriter;
+ QuicDispatcherPeer::SetPacketWriterFactory(&dispatcher_,
+ new TestWriterFactory());
QuicDispatcherPeer::UseWriter(&dispatcher_, writer_);
IPEndPoint client_address(net::test::Loopback4(), 1);

Powered by Google App Engine
This is Rietveld 408576698