Enable _api_features.json to block APIs from service worker contexts.
[chromium-blink-merge.git] / remoting / protocol / channel_authenticator.h
blob7466b090716c7eb07c49defb0b48d31e7036acd1
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"
11 #include "net/base/net_errors.h"
13 namespace net {
14 class StreamSocket;
15 } // namespace net
17 namespace remoting {
18 namespace protocol {
20 // Interface for channel authentications that perform channel-level
21 // authentication. Depending on implementation channel authenticators
22 // may also establish SSL connection. Each instance of this interface
23 // should be used only once for one channel.
24 class ChannelAuthenticator {
25 public:
26 typedef base::Callback<void(net::Error error, scoped_ptr<net::StreamSocket>)>
27 DoneCallback;
29 virtual ~ChannelAuthenticator() {}
31 // Start authentication of the given |socket|. |done_callback| is
32 // called when authentication is finished. Callback may be invoked
33 // before this method returns.
34 virtual void SecureAndAuthenticate(
35 scoped_ptr<net::StreamSocket> socket,
36 const DoneCallback& done_callback) = 0;
39 } // namespace protocol
40 } // namespace remoting
42 #endif // REMOTING_PROTOCOL_CHANNEL_AUTHENTICATOR_H_