| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 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 REMOTING_PROTOCOL_QUIC_CHANNEL_FACTORY_H_ | |
| 6 #define REMOTING_PROTOCOL_QUIC_CHANNEL_FACTORY_H_ | |
| 7 | |
| 8 #include "base/memory/scoped_ptr.h" | |
| 9 #include "remoting/protocol/stream_channel_factory.h" | |
| 10 | |
| 11 namespace net { | |
| 12 class QuicP2PSession; | |
| 13 } // namespace net | |
| 14 | |
| 15 namespace remoting { | |
| 16 namespace protocol { | |
| 17 | |
| 18 class DatagramChannelFactory; | |
| 19 | |
| 20 // QuicChannelFactory is responsible for QUIC connection between client and | |
| 21 // host. | |
| 22 class QuicChannelFactory : public StreamChannelFactory { | |
| 23 public: | |
| 24 QuicChannelFactory(const std::string& session_id, bool is_server); | |
| 25 ~QuicChannelFactory() override; | |
| 26 | |
| 27 // QuicConfig handshake handlers for the client side. | |
| 28 const std::string& CreateSessionInitiateConfigMessage(); | |
| 29 bool ProcessSessionAcceptConfigMessage(const std::string& message); | |
| 30 | |
| 31 // QuicConfig handshake handlers for the server side. | |
| 32 bool ProcessSessionInitiateConfigMessage(const std::string& message); | |
| 33 const std::string& CreateSessionAcceptConfigMessage(); | |
| 34 | |
| 35 // Creates a QUIC connection using a datagram channel created using |factory|. | |
| 36 // Must be called after successful handshake using the methods above. | |
| 37 // |shared_secret| must contain the shared key generated by the authentication | |
| 38 // handshake. | |
| 39 void Start(DatagramChannelFactory* factory, const std::string& shared_secret); | |
| 40 | |
| 41 // StreamChannelFactory interface. | |
| 42 void CreateChannel(const std::string& name, | |
| 43 const ChannelCreatedCallback& callback) override; | |
| 44 void CancelChannelCreation(const std::string& name) override; | |
| 45 | |
| 46 net::QuicP2PSession* GetP2PSessionForTests(); | |
| 47 | |
| 48 private: | |
| 49 class Core; | |
| 50 scoped_ptr<Core> core_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(QuicChannelFactory); | |
| 53 }; | |
| 54 | |
| 55 } // namespace protocol | |
| 56 } // namespace remoting | |
| 57 | |
| 58 #endif // REMOTING_PROTOCOL_QUIC_CHANNEL_FACTORY_H_ | |
| OLD | NEW |