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

Side by Side Diff: net/quic/quic_crypto_stream.h

Issue 11300020: Add QuicStream and friends to QUIC code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: License Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_QUIC_CRYPTO_STREAM_H_
6 #define NET_QUIC_QUIC_CRYPTO_STREAM_H_
7
8 #include "net/quic/crypto/crypto_framer.h"
9 #include "net/quic/reliable_quic_stream.h"
10
11 namespace net {
12
13 class QuicSession;
14
15 // Crypto handshake messages in QUIC take place over a reserved
16 // reliable stream with the id 1. Each endpoint (client and server)
17 // will allocate an instance of a subclass of QuicCryptoStream
18 // to send and receive handshake messages. (In the normal 1-RTT
19 // handshake, the client will send a client hello, CHLO, message.
20 // The server will receive this message and respond with a server
21 // hello message, SHLO. At this point both sides will have established
22 // a crypto context they can use to send encrypted messages.
23 //
24 // For more details: http://goto.google.com/quic-crypto
25 class QuicCryptoStream : public ReliableQuicStream,
26 public CryptoFramerVisitorInterface {
27
28 public:
29 explicit QuicCryptoStream(QuicSession* session);
30
31 // CryptoFramerVisitorInterface implementation
32 virtual void OnError(CryptoFramer* framer) OVERRIDE;
33 virtual void OnHandshakeMessage(const CryptoHandshakeMessage& message) = 0;
34
35 // ReliableQuicStream implementation
36 virtual uint32 ProcessData(const char* data, uint32 data_len) OVERRIDE;
37
38 // Sends |message| to the peer.
39 void SendHandshakeMessage(const CryptoHandshakeMessage& message);
40
41 bool handshake_complete() { return handshake_complete_; }
42
43 protected:
44 // Closes the connection
45 void CloseConnection(QuicErrorCode error);
46
47 void set_handshake_complete(bool complete) {
48 handshake_complete_ = complete;
49 }
50
51 private:
52 CryptoFramer crypto_framer_;
53 bool handshake_complete_;
54 };
jar (doing other things) 2012/10/31 22:37:37 nit: NO_COPY_AND_ASSIGN macro.
Ryan Hamilton 2012/11/01 22:52:20 Fixed upstream.
55
56 } // namespace net
57
58 #endif // NET_QUIC_QUIC_CRYPTO_STREAM_H_
OLDNEW
« no previous file with comments | « net/net.gyp ('k') | net/quic/quic_crypto_stream.cc » ('j') | net/quic/quic_crypto_stream_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698