Chromium Code Reviews| Index: net/quic/test_tools/crypto_test_utils.h |
| diff --git a/net/quic/test_tools/crypto_test_utils.h b/net/quic/test_tools/crypto_test_utils.h |
| index cc16d4699b627fee761a420ba1ba3ff7acbc7668..acc687944080f3122e53e36b7924cbb7adad5923 100644 |
| --- a/net/quic/test_tools/crypto_test_utils.h |
| +++ b/net/quic/test_tools/crypto_test_utils.h |
| @@ -38,6 +38,15 @@ class PacketSavingConnection; |
| class CryptoTestUtils { |
| public: |
| + // An interface for a source of tasks to run. |
| + class TaskSource { |
|
wtc
2014/07/09 01:03:53
I'd appreciate suggestion for a better name.
If t
|
| + public: |
| + virtual ~TaskSource() {} |
| + |
| + // Runs all pending tasks in this source. |
| + virtual void RunPending() = 0; |
| + }; |
| + |
| // FakeClientOptions bundles together a number of options for configuring |
| // HandshakeWithFakeClient. |
| struct FakeClientOptions { |
| @@ -50,6 +59,10 @@ class CryptoTestUtils { |
| // If channel_id_enabled is true then the client will attempt to send a |
| // ChannelID. |
| bool channel_id_enabled; |
| + |
| + // If channel_id_source_async is true then the client will use an async |
| + // ChannelIDSource for testing. Ignored if channel_id_enabled is false. |
| + bool channel_id_source_async; |
| }; |
| // returns: the number of client hellos that the client sent. |
| @@ -69,12 +82,13 @@ class CryptoTestUtils { |
| QuicConfig* config, |
| QuicCryptoServerConfig* crypto_config); |
| - // CommunicateHandshakeMessages moves messages from |a| to |b| and back until |
| - // |a|'s handshake has completed. |
| + // CommunicateHandshakeMessages moves messages from |a| to |b| and back and |
| + // runs pending tasks in |task_source| until |a|'s handshake has completed. |
| static void CommunicateHandshakeMessages(PacketSavingConnection* a_conn, |
| QuicCryptoStream* a, |
| PacketSavingConnection* b_conn, |
| - QuicCryptoStream* b); |
| + QuicCryptoStream* b, |
| + TaskSource* task_source = NULL); |
|
wtc
2014/07/09 01:03:52
It seems that the Style Guide allows this use of d
Ryan Hamilton
2014/07/09 16:54:39
The way I read the style guide, it's not just that
wtc
2014/07/09 19:44:42
Done. Added a CommunicateHandshakeMessagesAndDoWor
|
| // AdvanceHandshake attempts to moves messages from |a| to |b| and |b| to |a|. |
| // Returns the number of messages moved. |