OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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. |
| 4 |
| 5 #ifndef NET_QUIC_TEST_TOOLS_QUIC_STREAM_FACTORY_PEER_H_ |
| 6 #define NET_QUIC_TEST_TOOLS_QUIC_STREAM_FACTORY_PEER_H_ |
| 7 |
| 8 #include "base/basictypes.h" |
| 9 #include "base/task_runner.h" |
| 10 #include "net/base/host_port_pair.h" |
| 11 #include "net/base/privacy_mode.h" |
| 12 #include "net/quic/quic_protocol.h" |
| 13 #include "net/quic/quic_server_id.h" |
| 14 #include "net/quic/quic_time.h" |
| 15 |
| 16 namespace net { |
| 17 |
| 18 class QuicConfig; |
| 19 class QuicCryptoClientConfig; |
| 20 class QuicHttpStream; |
| 21 class QuicStreamFactory; |
| 22 class QuicChromiumClientSession; |
| 23 |
| 24 namespace test { |
| 25 |
| 26 class QuicStreamFactoryPeer { |
| 27 public: |
| 28 static const QuicConfig* GetConfig(QuicStreamFactory* factory); |
| 29 |
| 30 static QuicCryptoClientConfig* GetCryptoConfig(QuicStreamFactory* factory); |
| 31 |
| 32 static bool HasActiveSession(QuicStreamFactory* factory, |
| 33 const HostPortPair& host_port_pair); |
| 34 |
| 35 static QuicChromiumClientSession* GetActiveSession( |
| 36 QuicStreamFactory* factory, |
| 37 const HostPortPair& host_port_pair); |
| 38 |
| 39 static scoped_ptr<QuicHttpStream> CreateFromSession( |
| 40 QuicStreamFactory* factory, |
| 41 QuicChromiumClientSession* session); |
| 42 |
| 43 static bool IsLiveSession(QuicStreamFactory* factory, |
| 44 QuicChromiumClientSession* session); |
| 45 |
| 46 static void SetTaskRunner(QuicStreamFactory* factory, |
| 47 base::TaskRunner* task_runner); |
| 48 |
| 49 static int GetNumberOfLossyConnections(QuicStreamFactory* factory, |
| 50 uint16 port); |
| 51 |
| 52 static bool IsQuicDisabled(QuicStreamFactory* factory, uint16 port); |
| 53 |
| 54 static bool GetDelayTcpRace(QuicStreamFactory* factory); |
| 55 |
| 56 static void SetDelayTcpRace(QuicStreamFactory* factory, bool delay_tcp_race); |
| 57 |
| 58 static void SetYieldAfterPackets(QuicStreamFactory* factory, |
| 59 int yield_after_packets); |
| 60 |
| 61 static void SetYieldAfterDuration(QuicStreamFactory* factory, |
| 62 QuicTime::Delta yield_after_duration); |
| 63 |
| 64 static size_t GetNumberOfActiveJobs(QuicStreamFactory* factory, |
| 65 const QuicServerId& server_id); |
| 66 |
| 67 static int GetNumTimeoutsWithOpenStreams(QuicStreamFactory* factory); |
| 68 |
| 69 static int GetNumPublicResetsPostHandshake(QuicStreamFactory* factory); |
| 70 |
| 71 static void MaybeInitialize(QuicStreamFactory* factory); |
| 72 |
| 73 static bool HasInitializedData(QuicStreamFactory* factory); |
| 74 |
| 75 static bool SupportsQuicAtStartUp(QuicStreamFactory* factory, |
| 76 HostPortPair host_port_pair); |
| 77 |
| 78 static bool CryptoConfigCacheIsEmpty(QuicStreamFactory* factory, |
| 79 QuicServerId& quic_server_id); |
| 80 |
| 81 // Creates a dummy QUIC server config and caches it. |
| 82 static void CacheDummyServerConfig(QuicStreamFactory* factory, |
| 83 const QuicServerId& quic_server_id); |
| 84 |
| 85 private: |
| 86 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactoryPeer); |
| 87 }; |
| 88 |
| 89 } // namespace test |
| 90 } // namespace net |
| 91 |
| 92 #endif // NET_QUIC_TEST_TOOLS_QUIC_STREAM_FACTORY_PEER_H_ |
OLD | NEW |