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