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

Side by Side Diff: net/tools/quic/test_tools/quic_test_utils.cc

Issue 497553004: Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase with TOT 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 unified diff | Download patch
« no previous file with comments | « net/tools/quic/quic_server_session_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/test_tools/quic_test_utils.h" 5 #include "net/tools/quic/test_tools/quic_test_utils.h"
6 6
7 #include "net/quic/quic_connection.h" 7 #include "net/quic/quic_connection.h"
8 #include "net/quic/test_tools/quic_connection_peer.h" 8 #include "net/quic/test_tools/quic_connection_peer.h"
9 #include "net/quic/test_tools/quic_test_utils.h" 9 #include "net/quic/test_tools/quic_test_utils.h"
10 #include "net/tools/quic/quic_epoll_connection_helper.h" 10 #include "net/tools/quic/quic_epoll_connection_helper.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 TestWriterFactory::TestWriterFactory() : current_writer_(NULL) {} 132 TestWriterFactory::TestWriterFactory() : current_writer_(NULL) {}
133 TestWriterFactory::~TestWriterFactory() {} 133 TestWriterFactory::~TestWriterFactory() {}
134 134
135 QuicPacketWriter* TestWriterFactory::Create(QuicPacketWriter* writer, 135 QuicPacketWriter* TestWriterFactory::Create(QuicPacketWriter* writer,
136 QuicConnection* connection) { 136 QuicConnection* connection) {
137 return new PerConnectionPacketWriter(this, writer, connection); 137 return new PerConnectionPacketWriter(this, writer, connection);
138 } 138 }
139 139
140 void TestWriterFactory::OnPacketSent(WriteResult result) { 140 void TestWriterFactory::OnPacketSent(WriteResult result) {
141 if (current_writer_ != NULL) { 141 if (current_writer_ != NULL && result.status == WRITE_STATUS_ERROR) {
142 current_writer_->connection()->OnPacketSent(result); 142 current_writer_->connection()->OnWriteError(result.error_code);
143 current_writer_ = NULL; 143 current_writer_ = NULL;
144 } 144 }
145 } 145 }
146 146
147 void TestWriterFactory::Unregister(PerConnectionPacketWriter* writer) { 147 void TestWriterFactory::Unregister(PerConnectionPacketWriter* writer) {
148 if (current_writer_ == writer) { 148 if (current_writer_ == writer) {
149 current_writer_ = NULL; 149 current_writer_ = NULL;
150 } 150 }
151 } 151 }
152 152
(...skipping 20 matching lines...) Expand all
173 factory_->current_writer_ = this; 173 factory_->current_writer_ = this;
174 return QuicPerConnectionPacketWriter::WritePacket(buffer, 174 return QuicPerConnectionPacketWriter::WritePacket(buffer,
175 buf_len, 175 buf_len,
176 self_address, 176 self_address,
177 peer_address); 177 peer_address);
178 } 178 }
179 179
180 } // namespace test 180 } // namespace test
181 } // namespace tools 181 } // namespace tools
182 } // namespace net 182 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/quic/quic_server_session_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698