1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "net/tools/quic/test_tools/quic_dispatcher_peer.h"
7 #include "net/tools/quic/quic_dispatcher.h"
8 #include "net/tools/quic/quic_packet_writer_wrapper.h"
15 void QuicDispatcherPeer::SetTimeWaitListManager(
16 QuicDispatcher
* dispatcher
,
17 QuicTimeWaitListManager
* time_wait_list_manager
) {
18 dispatcher
->time_wait_list_manager_
.reset(time_wait_list_manager
);
22 void QuicDispatcherPeer::UseWriter(QuicDispatcher
* dispatcher
,
23 QuicPacketWriterWrapper
* writer
) {
24 writer
->set_writer(dispatcher
->writer_
.release());
25 dispatcher
->writer_
.reset(writer
);
29 QuicPacketWriter
* QuicDispatcherPeer::GetWriter(QuicDispatcher
* dispatcher
) {
30 return dispatcher
->writer_
.get();
34 void QuicDispatcherPeer::SetPacketWriterFactory(
35 QuicDispatcher
* dispatcher
,
36 QuicDispatcher::PacketWriterFactory
* packet_writer_factory
) {
37 dispatcher
->packet_writer_factory_
.reset(packet_writer_factory
);
41 QuicConnectionHelperInterface
* QuicDispatcherPeer::GetHelper(
42 QuicDispatcher
* dispatcher
) {
43 return dispatcher
->helper_
.get();
47 QuicDispatcher::WriteBlockedList
* QuicDispatcherPeer::GetWriteBlockedList(
48 QuicDispatcher
* dispatcher
) {
49 return &dispatcher
->write_blocked_list_
;
53 QuicErrorCode
QuicDispatcherPeer::GetAndClearLastError(
54 QuicDispatcher
* dispatcher
) {
55 QuicErrorCode ret
= dispatcher
->last_error_
;
56 dispatcher
->last_error_
= QUIC_NO_ERROR
;