OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2016 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_QUARTC_QUARTC_SESSION_INTERFACE_H_ | |
6 #define NET_QUIC_QUARTC_QUARTC_SESSION_INTERFACE_H_ | |
7 | |
8 #include "net/quic/quartc/quartc_reliable_stream_interface.h" | |
9 | |
10 namespace net { | |
Ryan Hamilton
2016/09/23 19:56:45
nit: newline after
| |
11 class QuartcSessionInterface { | |
Ryan Hamilton
2016/09/23 19:56:45
nit: class comment, please
| |
12 public: | |
13 virtual void StartCryptoHandshake() = 0; | |
Ryan Hamilton
2016/09/23 19:56:45
What does this method do when the underlying sessi
zhihuang1
2016/09/24 06:54:05
Then it just call QuicSession::Initialize().
I t
| |
14 | |
15 // Only needed when using SRTP with QuicTransport | |
16 // Key Exporter interface from RFC 5705 | |
17 // Arguments are: | |
18 // label -- the exporter label. | |
19 // part of the RFC defining each exporter usage (IN) | |
20 // context/context_len -- a context to bind to for this connection; | |
21 // optional, can be NULL, 0 (IN) | |
22 // use_context -- whether to use the context value | |
23 // (needed to distinguish no context from | |
24 // zero-length ones). | |
25 // result -- where to put the computed value | |
26 // result_len -- the length of the computed value | |
27 virtual bool ExportKeyingMaterial(const std::string& label, | |
28 const uint8_t* context, | |
29 size_t context_len, | |
30 bool used_context, | |
31 uint8_t* result, | |
32 size_t result_len) = 0; | |
33 | |
34 // For forward-compatibility. We can add more parameters to the function | |
Ryan Hamilton
2016/09/23 19:56:45
nit: Avoid using first person in comments.
zhihuang1
2016/09/24 06:54:05
Done.
| |
35 // through the struct without actually changing the API. | |
36 struct OutgoingStreamParameters {}; | |
37 virtual QuartcReliableStreamInterface* CreateOutgoingStream( | |
38 const OutgoingStreamParameters& params) = 0; | |
39 | |
40 // Implemented by WebRTC (ICE) code. Used by QUIC for sending and receiving | |
41 // (hopefully UDP) packets. | |
42 class Transport { | |
43 public: | |
44 // Called by the QuartcPacketWriter to check if the underneath transport | |
45 // writable. | |
46 virtual bool CanWrite() = 0; | |
Ryan Hamilton
2016/09/23 19:56:44
nit: newlines between methods, please
zhihuang1
2016/09/24 06:54:05
Done.
| |
47 // Called by the QuartcPacketWriter when writing packets to the network. | |
48 virtual int Write(const char* buffer, size_t buf_len) = 0; | |
49 | |
50 // Implemented by QUIC code. | |
Ryan Hamilton
2016/09/23 19:56:44
Can you add a comment to explain what this class d
zhihuang1
2016/09/24 06:54:06
Sure. I should have done this.
| |
51 class Observer { | |
Ryan Hamilton
2016/09/23 19:56:45
I think the same Observer->Delegate change would b
zhihuang1
2016/09/24 06:54:06
Done.
| |
52 virtual void OnCanWrite() = 0; | |
53 virtual bool OnReceived(const char* data, size_t data_len) = 0; | |
54 }; | |
55 virtual void SetObserver(Observer* observer) = 0; | |
56 }; | |
57 | |
58 // Implemented by WebRTC code. | |
59 class Observer { | |
Ryan Hamilton
2016/09/23 19:56:45
I think the same Observer->Delegate change would b
zhihuang1
2016/09/24 06:54:06
Done.
| |
60 public: | |
61 virtual void OnCryptoHandshakeComplete() = 0; | |
62 | |
63 virtual void OnIncomingStream(QuartcReliableStreamInterface* stream) = 0; | |
64 | |
65 // TODO(zhihuang) Create mapping from integer error code to WebRTC error | |
66 // code. | |
67 virtual void OnConnectionClosed(int error_code, bool from_remote) = 0; | |
68 | |
69 // TODO(zhihuang): Proof verification. | |
70 }; | |
71 virtual void SetObserver(Observer* observer) = 0; | |
72 }; | |
73 } // namespace net | |
74 | |
75 #endif // NET_QUIC_QUARTC_QUARTC_SESSION_INTERFACE_H_ | |
OLD | NEW |