| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 return crypto_stream_.get(); | 45 return crypto_stream_.get(); |
| 46 } | 46 } |
| 47 ReliableQuicStream* CreateOutgoingDynamicStream( | 47 ReliableQuicStream* CreateOutgoingDynamicStream( |
| 48 net::SpdyPriority priority) override; | 48 net::SpdyPriority priority) override; |
| 49 | 49 |
| 50 // QuicSession optional overrides. | 50 // QuicSession optional overrides. |
| 51 void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override; | 51 void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) override; |
| 52 | 52 |
| 53 // QuicConnectionVisitorInterface overrides. | 53 // QuicConnectionVisitorInterface overrides. |
| 54 void OnConnectionClosed(net::QuicErrorCode error, | 54 void OnConnectionClosed(net::QuicErrorCode error, |
| 55 const std::string& error_details, |
| 55 net::ConnectionCloseSource source) override; | 56 net::ConnectionCloseSource source) override; |
| 56 | 57 |
| 57 // Exports keying material for SRTP. | 58 // Exports keying material for SRTP. |
| 58 bool ExportKeyingMaterial(base::StringPiece label, | 59 bool ExportKeyingMaterial(base::StringPiece label, |
| 59 base::StringPiece context, | 60 base::StringPiece context, |
| 60 size_t result_len, | 61 size_t result_len, |
| 61 string* result); | 62 std::string* result); |
| 62 | 63 |
| 63 // Decrypts an incoming QUIC packet to a data stream. | 64 // Decrypts an incoming QUIC packet to a data stream. |
| 64 bool OnReadPacket(const char* data, size_t data_len); | 65 bool OnReadPacket(const char* data, size_t data_len); |
| 65 | 66 |
| 66 // Called when peers have established forward-secure encryption | 67 // Called when peers have established forward-secure encryption |
| 67 sigslot::signal0<> SignalHandshakeComplete; | 68 sigslot::signal0<> SignalHandshakeComplete; |
| 68 // Called when connection closes locally, or remotely by peer. | 69 // Called when connection closes locally, or remotely by peer. |
| 69 sigslot::signal2<net::QuicErrorCode, bool> SignalConnectionClosed; | 70 sigslot::signal2<net::QuicErrorCode, bool> SignalConnectionClosed; |
| 70 // Called when an incoming QUIC stream is created so we can process data | 71 // Called when an incoming QUIC stream is created so we can process data |
| 71 // from it by registering a listener to | 72 // from it by registering a listener to |
| 72 // ReliableQuicStream::SignalDataReceived. | 73 // ReliableQuicStream::SignalDataReceived. |
| 73 sigslot::signal1<ReliableQuicStream*> SignalIncomingStream; | 74 sigslot::signal1<ReliableQuicStream*> SignalIncomingStream; |
| 74 | 75 |
| 75 protected: | 76 protected: |
| 76 // Sets the QUIC crypto stream and takes ownership of it. | 77 // Sets the QUIC crypto stream and takes ownership of it. |
| 77 void SetCryptoStream(net::QuicCryptoStream* crypto_stream); | 78 void SetCryptoStream(net::QuicCryptoStream* crypto_stream); |
| 78 | 79 |
| 79 // QuicSession override. | 80 // QuicSession override. |
| 80 ReliableQuicStream* CreateIncomingDynamicStream( | 81 ReliableQuicStream* CreateIncomingDynamicStream( |
| 81 net::QuicStreamId id) override; | 82 net::QuicStreamId id) override; |
| 82 | 83 |
| 83 virtual ReliableQuicStream* CreateDataStream(net::QuicStreamId id); | 84 virtual ReliableQuicStream* CreateDataStream(net::QuicStreamId id); |
| 84 | 85 |
| 85 private: | 86 private: |
| 86 std::unique_ptr<net::QuicCryptoStream> crypto_stream_; | 87 std::unique_ptr<net::QuicCryptoStream> crypto_stream_; |
| 88 net::QuicClock clock_; // For recording packet receipt time |
| 87 | 89 |
| 88 RTC_DISALLOW_COPY_AND_ASSIGN(QuicSession); | 90 RTC_DISALLOW_COPY_AND_ASSIGN(QuicSession); |
| 89 }; | 91 }; |
| 90 | 92 |
| 91 } // namespace cricket | 93 } // namespace cricket |
| 92 | 94 |
| 93 #endif // WEBRTC_P2P_QUIC_QUICSESSION_H_ | 95 #endif // WEBRTC_P2P_QUIC_QUICSESSION_H_ |
| OLD | NEW |