Roll src/third_party/WebKit 176b227:44a3ab6 (svn 200849:200851)
[chromium-blink-merge.git] / remoting / protocol / channel_authenticator.h
blobe29e7d8cc5850244b4ff603f37d7307715e8e954
1 // Copyright (c) 2012 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_CHANNEL_AUTHENTICATOR_H_
6 #define REMOTING_PROTOCOL_CHANNEL_AUTHENTICATOR_H_
8 #include <string>
10 #include "base/callback_forward.h"
12 namespace remoting {
13 namespace protocol {
15 class P2PStreamSocket;
17 // Interface for channel authentications that perform channel-level
18 // authentication. Depending on implementation channel authenticators
19 // may also establish SSL connection. Each instance of this interface
20 // should be used only once for one channel.
21 class ChannelAuthenticator {
22 public:
23 typedef base::Callback<void(int error, scoped_ptr<P2PStreamSocket>)>
24 DoneCallback;
26 virtual ~ChannelAuthenticator() {}
28 // Start authentication of the given |socket|. |done_callback| is called when
29 // authentication is finished. Callback may be invoked before this method
30 // returns, and may delete the calling authenticator.
31 virtual void SecureAndAuthenticate(
32 scoped_ptr<P2PStreamSocket> socket,
33 const DoneCallback& done_callback) = 0;
36 } // namespace protocol
37 } // namespace remoting
39 #endif // REMOTING_PROTOCOL_CHANNEL_AUTHENTICATOR_H_