| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef NET_QUIC_TEST_TOOLS_QUIC_STREAM_FACTORY_PEER_H_ | 5 #ifndef NET_QUIC_TEST_TOOLS_QUIC_STREAM_FACTORY_PEER_H_ |
| 6 #define NET_QUIC_TEST_TOOLS_QUIC_STREAM_FACTORY_PEER_H_ | 6 #define NET_QUIC_TEST_TOOLS_QUIC_STREAM_FACTORY_PEER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/task_runner.h" | 12 #include "base/task_runner.h" |
| 13 #include "net/base/host_port_pair.h" | 13 #include "net/base/host_port_pair.h" |
| 14 #include "net/base/privacy_mode.h" | 14 #include "net/base/privacy_mode.h" |
| 15 #include "net/log/net_log.h" |
| 15 #include "net/quic/core/quic_protocol.h" | 16 #include "net/quic/core/quic_protocol.h" |
| 16 #include "net/quic/core/quic_server_id.h" | 17 #include "net/quic/core/quic_server_id.h" |
| 17 #include "net/quic/core/quic_time.h" | 18 #include "net/quic/core/quic_time.h" |
| 18 | 19 |
| 19 namespace net { | 20 namespace net { |
| 20 | 21 |
| 21 class QuicConfig; | 22 class QuicConfig; |
| 22 class QuicCryptoClientConfig; | 23 class QuicCryptoClientConfig; |
| 23 class QuicHttpStream; | 24 class QuicHttpStream; |
| 24 class QuicStreamFactory; | 25 class QuicStreamFactory; |
| 25 class QuicChromiumClientSession; | 26 class QuicChromiumClientSession; |
| 26 class QuicClientPushPromiseIndex; | 27 class QuicClientPushPromiseIndex; |
| 27 | 28 |
| 28 namespace test { | 29 namespace test { |
| 29 | 30 |
| 30 class QuicStreamFactoryPeer { | 31 class QuicStreamFactoryPeer { |
| 31 public: | 32 public: |
| 32 static const QuicConfig* GetConfig(QuicStreamFactory* factory); | 33 static const QuicConfig* GetConfig(QuicStreamFactory* factory); |
| 33 | 34 |
| 34 static QuicCryptoClientConfig* GetCryptoConfig(QuicStreamFactory* factory); | 35 static QuicCryptoClientConfig* GetCryptoConfig(QuicStreamFactory* factory); |
| 35 | 36 |
| 36 static bool HasActiveSession(QuicStreamFactory* factory, | 37 static bool HasActiveSession(QuicStreamFactory* factory, |
| 37 const QuicServerId& server_id); | 38 const QuicServerId& server_id); |
| 38 | 39 |
| 40 static bool HasActiveCertVerifierJob(QuicStreamFactory* factory, |
| 41 const QuicServerId& server_id); |
| 42 |
| 39 static QuicChromiumClientSession* GetActiveSession( | 43 static QuicChromiumClientSession* GetActiveSession( |
| 40 QuicStreamFactory* factory, | 44 QuicStreamFactory* factory, |
| 41 const QuicServerId& server_id); | 45 const QuicServerId& server_id); |
| 42 | 46 |
| 43 static std::unique_ptr<QuicHttpStream> CreateFromSession( | 47 static std::unique_ptr<QuicHttpStream> CreateFromSession( |
| 44 QuicStreamFactory* factory, | 48 QuicStreamFactory* factory, |
| 45 QuicChromiumClientSession* session); | 49 QuicChromiumClientSession* session); |
| 46 | 50 |
| 47 static bool IsLiveSession(QuicStreamFactory* factory, | 51 static bool IsLiveSession(QuicStreamFactory* factory, |
| 48 QuicChromiumClientSession* session); | 52 QuicChromiumClientSession* session); |
| 49 | 53 |
| 50 static void SetTaskRunner(QuicStreamFactory* factory, | 54 static void SetTaskRunner(QuicStreamFactory* factory, |
| 51 base::TaskRunner* task_runner); | 55 base::TaskRunner* task_runner); |
| 52 | 56 |
| 53 static int GetNumberOfLossyConnections(QuicStreamFactory* factory, | 57 static int GetNumberOfLossyConnections(QuicStreamFactory* factory, |
| 54 uint16_t port); | 58 uint16_t port); |
| 55 | 59 |
| 56 static bool IsQuicDisabled(QuicStreamFactory* factory, uint16_t port); | 60 static bool IsQuicDisabled(QuicStreamFactory* factory, uint16_t port); |
| 57 | 61 |
| 58 static bool GetDelayTcpRace(QuicStreamFactory* factory); | 62 static bool GetDelayTcpRace(QuicStreamFactory* factory); |
| 59 | 63 |
| 60 static void SetDelayTcpRace(QuicStreamFactory* factory, bool delay_tcp_race); | 64 static void SetDelayTcpRace(QuicStreamFactory* factory, bool delay_tcp_race); |
| 61 | 65 |
| 66 static bool GetRaceCertVerification(QuicStreamFactory* factory); |
| 67 |
| 68 static void SetRaceCertVerification(QuicStreamFactory* factory, |
| 69 bool race_cert_verification); |
| 70 |
| 71 static QuicAsyncStatus StartCertVerifyJob(QuicStreamFactory* factory, |
| 72 const QuicServerId& server_id, |
| 73 int cert_verify_flags, |
| 74 const BoundNetLog& net_log); |
| 75 |
| 62 static void SetYieldAfterPackets(QuicStreamFactory* factory, | 76 static void SetYieldAfterPackets(QuicStreamFactory* factory, |
| 63 int yield_after_packets); | 77 int yield_after_packets); |
| 64 | 78 |
| 65 static void SetYieldAfterDuration(QuicStreamFactory* factory, | 79 static void SetYieldAfterDuration(QuicStreamFactory* factory, |
| 66 QuicTime::Delta yield_after_duration); | 80 QuicTime::Delta yield_after_duration); |
| 67 | 81 |
| 68 static size_t GetNumberOfActiveJobs(QuicStreamFactory* factory, | 82 static size_t GetNumberOfActiveJobs(QuicStreamFactory* factory, |
| 69 const QuicServerId& server_id); | 83 const QuicServerId& server_id); |
| 70 | 84 |
| 71 static int GetNumTimeoutsWithOpenStreams(QuicStreamFactory* factory); | 85 static int GetNumTimeoutsWithOpenStreams(QuicStreamFactory* factory); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 92 static int GetNumPushStreamsCreated(QuicStreamFactory* factory); | 106 static int GetNumPushStreamsCreated(QuicStreamFactory* factory); |
| 93 | 107 |
| 94 private: | 108 private: |
| 95 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactoryPeer); | 109 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactoryPeer); |
| 96 }; | 110 }; |
| 97 | 111 |
| 98 } // namespace test | 112 } // namespace test |
| 99 } // namespace net | 113 } // namespace net |
| 100 | 114 |
| 101 #endif // NET_QUIC_TEST_TOOLS_QUIC_STREAM_FACTORY_PEER_H_ | 115 #endif // NET_QUIC_TEST_TOOLS_QUIC_STREAM_FACTORY_PEER_H_ |
| OLD | NEW |