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

Unified Diff: net/quic/quic_p2p_session.h

Issue 474383003: Initial P2P implementation for WebRTC on QUIC prototype Base URL: https://chromium.googlesource.com/chromium/src.git@tests-squashed
Patch Set: Created 6 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_p2p_server_session.cc ('k') | net/quic/quic_p2p_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « net/quic/quic_p2p_server_session.cc ('k') | net/quic/quic_p2p_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698