12a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
22a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
32a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// found in the LICENSE file.
42a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#ifndef NET_QUIC_TEST_TOOLS_RELIABLE_QUIC_STREAM_PEER_H_
62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#define NET_QUIC_TEST_TOOLS_RELIABLE_QUIC_STREAM_PEER_H_
72a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
82a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "base/basictypes.h"
92a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "net/quic/quic_protocol.h"
102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
112a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace net {
122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
132a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class ReliableQuicStream;
142a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace test {
162a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class ReliableQuicStreamPeer {
182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) public:
192a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  static void SetWriteSideClosed(bool value, ReliableQuicStream* stream);
202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  static void SetStreamBytesWritten(QuicStreamOffset stream_bytes_written,
212a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)                                    ReliableQuicStream* stream);
225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  static void CloseReadSide(ReliableQuicStream* stream);
235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  static bool FinSent(ReliableQuicStream* stream);
255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  static bool RstSent(ReliableQuicStream* stream);
262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
27e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch  static uint32 SizeOfQueuedData(ReliableQuicStream* stream);
28e5d81f57cb97b3b6b7fccc9c5610d21eb81db09dBen Murdoch
29f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)  static void SetFecPolicy(ReliableQuicStream* stream, FecPolicy fec_policy);
30f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)
31116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch  static bool StreamContributesToConnectionFlowControl(
32116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch      ReliableQuicStream* stream);
33116680a4aac90f2aa7413d9095a592090648e557Ben Murdoch
342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) private:
352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)  DISALLOW_COPY_AND_ASSIGN(ReliableQuicStreamPeer);
362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)};
372a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
382a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}  // namespace test
392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)}  // namespace net
402a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)
412a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif  // NET_QUIC_TEST_TOOLS_RELIABLE_QUIC_STREAM_PEER_H_
42