Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Unified Diff: net/quic/quic_crypto_client_stream.h

Issue 346323002: net: Implement ChannelIDSourceChromium, which is based on Chromium's (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Rebase Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_crypto_client_stream.h
===================================================================
--- net/quic/quic_crypto_client_stream.h (revision 279242)
+++ net/quic/quic_crypto_client_stream.h (working copy)
@@ -7,6 +7,7 @@
#include <string>
+#include "net/quic/crypto/channel_id.h"
#include "net/quic/crypto/proof_verifier.h"
#include "net/quic/crypto/quic_crypto_client_config.h"
#include "net/quic/quic_config.h"
@@ -44,6 +45,25 @@
int num_sent_client_hellos() const;
private:
+ // ChannelIDSourceCallbackImpl is passed as the callback method to
+ // GetChannelIDKey. The ChannelIDSource calls this class with the result of
+ // channel ID lookup when lookup is performed asynchronously.
+ class ChannelIDSourceCallbackImpl : public ChannelIDSourceCallback {
+ public:
+ explicit ChannelIDSourceCallbackImpl(QuicCryptoClientStream* stream);
+ virtual ~ChannelIDSourceCallbackImpl();
+
+ // ChannelIDSourceCallback interface.
+ virtual void Run(scoped_ptr<ChannelIDKey>* channel_id_key) OVERRIDE;
+
+ // Cancel causes any future callbacks to be ignored. It must be called on
+ // the same thread as the callback will be made on.
+ void Cancel();
+
+ private:
+ QuicCryptoClientStream* stream_;
+ };
+
// ProofVerifierCallbackImpl is passed as the callback method to VerifyProof.
// The ProofVerifier calls this class with the result of proof verification
// when verification is performed asynchronously.
@@ -66,6 +86,7 @@
};
friend class test::CryptoTestUtils;
+ friend class ChannelIDSourceCallbackImpl;
friend class ProofVerifierCallbackImpl;
Ryan Hamilton 2014/06/25 18:55:15 I *think* that you can remove these two friend sta
wtc 2014/06/28 16:03:30 You are right. I verified these two inner classes
enum State {
@@ -75,6 +96,8 @@
STATE_RECV_REJ,
STATE_VERIFY_PROOF,
STATE_VERIFY_PROOF_COMPLETE,
+ STATE_GET_CHANNEL_ID,
+ STATE_GET_CHANNEL_ID_COMPLETE,
STATE_RECV_SHLO,
};
@@ -103,6 +126,16 @@
// Generation counter from QuicCryptoClientConfig's CachedState.
uint64 generation_counter_;
+ // channel_id_source_callback_ contains the callback object that we passed
+ // to an asynchronous channel ID lookup. The ChannelIDSource owns this
+ // object.
+ ChannelIDSourceCallbackImpl* channel_id_source_callback_;
+
+ // These members are used to store the result of an asynchronous channel ID
+ // lookup. These members must not be used after
+ // STATE_GET_CHANNEL_ID_COMPLETE.
+ scoped_ptr<ChannelIDKey> channel_id_key_;
+
// proof_verify_callback_ contains the callback object that we passed to an
// asynchronous proof verification. The ProofVerifier owns this object.
ProofVerifierCallbackImpl* proof_verify_callback_;

Powered by Google App Engine
This is Rietveld 408576698