| 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 <stddef.h> | |
| 9 #include <stdint.h> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 #include "base/task_runner.h" | |
| 13 #include "net/base/host_port_pair.h" | |
| 14 #include "net/base/privacy_mode.h" | |
| 15 #include "net/quic/core/quic_packets.h" | |
| 16 #include "net/quic/core/quic_server_id.h" | |
| 17 #include "net/quic/core/quic_time.h" | |
| 18 | |
| 19 namespace net { | |
| 20 | |
| 21 class NetLogWithSource; | |
| 22 class QuicConfig; | |
| 23 class QuicCryptoClientConfig; | |
| 24 class QuicHttpStream; | |
| 25 class QuicStreamFactory; | |
| 26 class QuicChromiumClientSession; | |
| 27 class QuicClientPushPromiseIndex; | |
| 28 | |
| 29 namespace test { | |
| 30 | |
| 31 class QuicStreamFactoryPeer { | |
| 32 public: | |
| 33 static const QuicConfig* GetConfig(QuicStreamFactory* factory); | |
| 34 | |
| 35 static QuicCryptoClientConfig* GetCryptoConfig(QuicStreamFactory* factory); | |
| 36 | |
| 37 static bool HasActiveSession(QuicStreamFactory* factory, | |
| 38 const QuicServerId& server_id); | |
| 39 | |
| 40 static bool HasActiveJob(QuicStreamFactory* factory, | |
| 41 const QuicServerId& server_id); | |
| 42 | |
| 43 static bool HasActiveCertVerifierJob(QuicStreamFactory* factory, | |
| 44 const QuicServerId& server_id); | |
| 45 | |
| 46 static QuicChromiumClientSession* GetActiveSession( | |
| 47 QuicStreamFactory* factory, | |
| 48 const QuicServerId& server_id); | |
| 49 | |
| 50 static std::unique_ptr<QuicHttpStream> CreateFromSession( | |
| 51 QuicStreamFactory* factory, | |
| 52 QuicChromiumClientSession* session); | |
| 53 | |
| 54 static bool IsLiveSession(QuicStreamFactory* factory, | |
| 55 QuicChromiumClientSession* session); | |
| 56 | |
| 57 static void SetTaskRunner(QuicStreamFactory* factory, | |
| 58 base::TaskRunner* task_runner); | |
| 59 | |
| 60 static QuicTime::Delta GetPingTimeout(QuicStreamFactory* factory); | |
| 61 | |
| 62 static bool IsQuicDisabled(QuicStreamFactory* factory); | |
| 63 | |
| 64 static bool GetDelayTcpRace(QuicStreamFactory* factory); | |
| 65 | |
| 66 static void SetDelayTcpRace(QuicStreamFactory* factory, bool delay_tcp_race); | |
| 67 | |
| 68 static bool GetRaceCertVerification(QuicStreamFactory* factory); | |
| 69 | |
| 70 static void SetRaceCertVerification(QuicStreamFactory* factory, | |
| 71 bool race_cert_verification); | |
| 72 | |
| 73 static QuicAsyncStatus StartCertVerifyJob(QuicStreamFactory* factory, | |
| 74 const QuicServerId& server_id, | |
| 75 int cert_verify_flags, | |
| 76 const NetLogWithSource& net_log); | |
| 77 | |
| 78 static void SetYieldAfterPackets(QuicStreamFactory* factory, | |
| 79 int yield_after_packets); | |
| 80 | |
| 81 static void SetYieldAfterDuration(QuicStreamFactory* factory, | |
| 82 QuicTime::Delta yield_after_duration); | |
| 83 | |
| 84 static size_t GetNumberOfActiveJobs(QuicStreamFactory* factory, | |
| 85 const QuicServerId& server_id); | |
| 86 | |
| 87 static void MaybeInitialize(QuicStreamFactory* factory); | |
| 88 | |
| 89 static bool HasInitializedData(QuicStreamFactory* factory); | |
| 90 | |
| 91 static bool SupportsQuicAtStartUp(QuicStreamFactory* factory, | |
| 92 HostPortPair host_port_pair); | |
| 93 | |
| 94 static bool CryptoConfigCacheIsEmpty(QuicStreamFactory* factory, | |
| 95 const QuicServerId& quic_server_id); | |
| 96 | |
| 97 // Creates a dummy QUIC server config and caches it. | |
| 98 static void CacheDummyServerConfig(QuicStreamFactory* factory, | |
| 99 const QuicServerId& quic_server_id); | |
| 100 | |
| 101 static QuicClientPushPromiseIndex* GetPushPromiseIndex( | |
| 102 QuicStreamFactory* factory); | |
| 103 | |
| 104 static int GetNumPushStreamsCreated(QuicStreamFactory* factory); | |
| 105 | |
| 106 private: | |
| 107 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactoryPeer); | |
| 108 }; | |
| 109 | |
| 110 } // namespace test | |
| 111 } // namespace net | |
| 112 | |
| 113 #endif // NET_QUIC_TEST_TOOLS_QUIC_STREAM_FACTORY_PEER_H_ | |
| OLD | NEW |