OLD | NEW |
---|---|
(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_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" | |
honghaiz
2016/09/22 18:57:03
Probably do not need to include this. Is it enough
zhihuang1
2016/09/22 19:24:41
We need this for QuartcReliableStreamInterface in
| |
9 | |
10 namespace net { | |
11 class QuartcSessionInterface { | |
12 public: | |
13 virtual void StartCryptoHandshake() = 0; | |
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 | |
honghaiz
2016/09/22 18:57:04
Please explain all arguments.
zhihuang1
2016/09/22 19:24:40
Done.
| |
20 // usage (IN) | |
honghaiz
2016/09/22 18:57:03
This can be merged to the previous line?
zhihuang1
2016/09/22 19:24:41
Done.
| |
21 // context/context_len -- a context to bind to for this connection indicating | |
22 // where and how the keying material will be used. | |
23 virtual bool ExportKeyingMaterial(const std::string& label, | |
24 const uint8_t* context, | |
25 size_t context_len, | |
26 uint8_t* result, | |
27 size_t result_len) = 0; | |
28 | |
29 // For forward-compatibility | |
honghaiz
2016/09/22 18:57:05
Can you explain a little more? forward compatibili
zhihuang1
2016/09/22 19:24:41
Done.
| |
30 struct OutgoingStreamParameters {}; | |
31 virtual QuartcReliableStreamInterface* CreateOutgoingStream( | |
32 const OutgoingStreamParameters& params) = 0; | |
33 | |
34 // Implemented by WebRTC (ICE) code. Used by QUIC for sending and receiving | |
35 // (hopefully UDP) packets. | |
36 class Transport { | |
37 public: | |
38 // Called by the QuartcPacketWriter to check if the underneath transport | |
39 // writable. | |
honghaiz
2016/09/22 18:57:01
writable => "is writable"
zhihuang1
2016/09/22 19:24:41
Done.
| |
40 virtual bool CanWrite() = 0; | |
honghaiz
2016/09/22 18:57:06
Is Writable a better name?
And below, OnWritable()
zhihuang1
2016/09/22 19:24:40
We choose this is to make it consistent with the n
| |
41 // Called by the QuartcPacketWriter when writing packets to the network. | |
42 virtual int Write(const char* buffer, size_t buf_len) = 0; | |
43 | |
44 // Implemented by QUIC code. | |
45 class Observer { | |
46 virtual void OnCanWrite() = 0; | |
47 virtual bool OnReceived(const char* data, size_t data_len) = 0; | |
48 }; | |
49 virtual void SetObserver(Observer* observer) = 0; | |
50 }; | |
51 virtual void SetTransport(Transport*) = 0; | |
52 | |
53 // Implemented by WebRTC code. | |
54 class Observer { | |
55 public: | |
56 virtual void OnCryptoHandshakeComplete() = 0; | |
57 | |
58 virtual void OnIncomingStream(QuartcReliableStreamInterface* stream) = 0; | |
59 | |
60 // TODO(zhihuang) Create mapping from integer error code to WebRTC error | |
61 // code. | |
62 virtual void OnConnectionClosed(int error_code, bool from_remote) = 0; | |
63 | |
64 // TODO(zhihuang): Proof verification. | |
65 }; | |
66 virtual void SetObserver(Observer* observer) = 0; | |
67 }; | |
68 } // namespace net | |
69 | |
70 #endif // NET_QUIC_QUARTC_QUARTC_SESSION_INTERFACE_H_ | |
OLD | NEW |