| Index: net/quic/quic_p2p_session.h
|
| diff --git a/net/quic/quic_p2p_session.h b/net/quic/quic_p2p_session.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ab75f67c7e60dd0fe547e452526fcf33d321e9c8
|
| --- /dev/null
|
| +++ b/net/quic/quic_p2p_session.h
|
| @@ -0,0 +1,86 @@
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef NET_QUIC_QUIC_P2P_SESSION_H_
|
| +#define NET_QUIC_QUIC_P2P_SESSION_H_
|
| +
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "base/strings/string_piece.h"
|
| +#include "net/base/hash_value.h"
|
| +#include "net/quic/quic_client_session_base.h"
|
| +#include "net/quic/quic_message_stream.h"
|
| +#include "net/quic/quic_protocol.h"
|
| +#include "net/quic/quic_server_id.h"
|
| +
|
| +namespace net {
|
| +
|
| +class QuicConfig;
|
| +class QuicConnection;
|
| +class QuicCryptoClientConfig;
|
| +class QuicCryptoServerConfig;
|
| +class X509Certificate;
|
| +
|
| +class NET_EXPORT QuicP2PSession : public QuicClientSessionBase {
|
| + public:
|
| + class NET_EXPORT Delegate {
|
| + public:
|
| + virtual ~Delegate() {}
|
| + virtual void OnHandshakeComplete() = 0;
|
| + // TODO(dmz) merge QuicMessageStream::ReadDelegate?
|
| + };
|
| + static QuicP2PSession* Create(bool is_server_role,
|
| + X509Certificate* local_identity,
|
| + base::StringPiece private_key,
|
| + HashValue remote_fingerprint,
|
| + QuicConnectionHelperInterface* helper,
|
| + QuicPacketWriter* writer,
|
| + Delegate* delegate,
|
| + QuicMessageStream::ReadDelegate* read_delegate);
|
| +
|
| + // TODO split
|
| + QuicP2PSession(const QuicConfig& config,
|
| + QuicConnection* connection,
|
| + Delegate* delegate,
|
| + QuicMessageStream::ReadDelegate* read_delegate);
|
| + virtual ~QuicP2PSession();
|
| +
|
| + virtual bool Connect() = 0;
|
| +
|
| + bool GetPeerCertificate(X509Certificate** cert);
|
| +
|
| + bool OnPacketRead(const char* data, size_t data_len);
|
| + int WriteMessage(QuicStreamId stream_id, const char* data, size_t data_len);
|
| +
|
| + bool ExportKeyingMaterial(base::StringPiece label,
|
| + base::StringPiece context,
|
| + size_t result_len,
|
| + string* result);
|
| +
|
| + bool is_server_role() const { return connection()->is_server(); }
|
| +
|
| + virtual void OnCryptoHandshakeEvent(CryptoHandshakeEvent event) OVERRIDE;
|
| +
|
| + virtual void OnProofValid(
|
| + const QuicCryptoClientConfig::CachedState& cached) OVERRIDE {}
|
| +
|
| + virtual void OnProofVerifyDetailsAvailable(
|
| + const ProofVerifyDetails& verify_details) OVERRIDE {}
|
| +
|
| + protected:
|
| + // QuicSession methods:
|
| + virtual QuicDataStream* CreateIncomingDataStream(QuicStreamId id) OVERRIDE;
|
| + virtual QuicDataStream* CreateOutgoingDataStream() OVERRIDE;
|
| +
|
| + private:
|
| + QuicDataStream* CreateDataStream(QuicStreamId id);
|
| +
|
| + Delegate* delegate_;
|
| + QuicMessageStream::ReadDelegate* read_delegate_;
|
| + scoped_ptr<QuicCryptoStream> crypto_stream_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(QuicP2PSession);
|
| +};
|
| +
|
| +} // namespace net
|
| +
|
| +#endif // NET_QUIC_QUIC_P2P_SESSION_H_
|
|
|