| // Copyright 2015 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #ifndef REMOTING_PROTOCOL_QUIC_CHANNEL_FACTORY_H_ |
| #define REMOTING_PROTOCOL_QUIC_CHANNEL_FACTORY_H_ |
| |
| #include "base/memory/scoped_ptr.h" |
| #include "remoting/protocol/stream_channel_factory.h" |
| |
| namespace net { |
| class QuicP2PSession; |
| } // namespace net |
| |
| namespace remoting { |
| namespace protocol { |
| |
| class DatagramChannelFactory; |
| |
| // QuicChannelFactory is responsible for QUIC connection between client and |
| // host. |
| class QuicChannelFactory : public StreamChannelFactory { |
| public: |
| QuicChannelFactory(const std::string& session_id, bool is_server); |
| ~QuicChannelFactory() override; |
| |
| // QuicConfig handshake handlers for the client side. |
| const std::string& CreateSessionInitiateConfigMessage(); |
| bool ProcessSessionAcceptConfigMessage(const std::string& message); |
| |
| // QuicConfig handshake handlers for the server side. |
| bool ProcessSessionInitiateConfigMessage(const std::string& message); |
| const std::string& CreateSessionAcceptConfigMessage(); |
| |
| // Creates a QUIC connection using a datagram channel created using |factory|. |
| // Must be called after successful handshake using the methods above. |
| // |shared_secret| must contain the shared key generated by the authentication |
| // handshake. |
| void Start(DatagramChannelFactory* factory, const std::string& shared_secret); |
| |
| // StreamChannelFactory interface. |
| void CreateChannel(const std::string& name, |
| const ChannelCreatedCallback& callback) override; |
| void CancelChannelCreation(const std::string& name) override; |
| |
| net::QuicP2PSession* GetP2PSessionForTests(); |
| |
| private: |
| class Core; |
| scoped_ptr<Core> core_; |
| |
| DISALLOW_COPY_AND_ASSIGN(QuicChannelFactory); |
| }; |
| |
| } // namespace protocol |
| } // namespace remoting |
| |
| #endif // REMOTING_PROTOCOL_QUIC_CHANNEL_FACTORY_H_ |