Instrumenting internals of AccountIdFetcher::Start to locate the source of jankiness.
[chromium-blink-merge.git] / remoting / protocol / channel_authenticator.h
blob8bef908df5cc810777fe2e2ec2239efd505681e0
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 net {
13 class StreamSocket;
14 } // namespace net
16 namespace remoting {
17 namespace protocol {
19 // Interface for channel authentications that perform channel-level
20 // authentication. Depending on implementation channel authenticators
21 // may also establish SSL connection. Each instance of this interface
22 // should be used only once for one channel.
23 class ChannelAuthenticator {
24 public:
25 typedef base::Callback<void(int error, scoped_ptr<net::StreamSocket>)>
26 DoneCallback;
28 virtual ~ChannelAuthenticator() {}
30 // Start authentication of the given |socket|. |done_callback| is called when
31 // authentication is finished. Callback may be invoked before this method
32 // returns, and may delete the calling authenticator.
33 virtual void SecureAndAuthenticate(
34 scoped_ptr<net::StreamSocket> socket,
35 const DoneCallback& done_callback) = 0;
38 } // namespace protocol
39 } // namespace remoting
41 #endif // REMOTING_PROTOCOL_CHANNEL_AUTHENTICATOR_H_