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.
5 #ifndef REMOTING_PROTOCOL_QUIC_CHANNEL_FACTORY_H_
6 #define REMOTING_PROTOCOL_QUIC_CHANNEL_FACTORY_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "remoting/protocol/stream_channel_factory.h"
18 class DatagramChannelFactory
;
20 // QuicChannelFactory is responsible for QUIC connection between client and
22 class QuicChannelFactory
: public StreamChannelFactory
{
24 QuicChannelFactory(const std::string
& session_id
, bool is_server
);
25 ~QuicChannelFactory() override
;
27 // QuicConfig handshake handlers for the client side.
28 const std::string
& CreateSessionInitiateConfigMessage();
29 bool ProcessSessionAcceptConfigMessage(const std::string
& message
);
31 // QuicConfig handshake handlers for the server side.
32 bool ProcessSessionInitiateConfigMessage(const std::string
& message
);
33 const std::string
& CreateSessionAcceptConfigMessage();
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
39 void Start(DatagramChannelFactory
* factory
, const std::string
& shared_secret
);
41 // StreamChannelFactory interface.
42 void CreateChannel(const std::string
& name
,
43 const ChannelCreatedCallback
& callback
) override
;
44 void CancelChannelCreation(const std::string
& name
) override
;
46 net::QuicP2PSession
* GetP2PSessionForTests();
50 scoped_ptr
<Core
> core_
;
52 DISALLOW_COPY_AND_ASSIGN(QuicChannelFactory
);
55 } // namespace protocol
56 } // namespace remoting
58 #endif // REMOTING_PROTOCOL_QUIC_CHANNEL_FACTORY_H_