OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_PROTOCOL_CHANNEL_AUTHENTICATOR_H_ | 5 #ifndef REMOTING_PROTOCOL_CHANNEL_AUTHENTICATOR_H_ |
6 #define REMOTING_PROTOCOL_CHANNEL_AUTHENTICATOR_H_ | 6 #define REMOTING_PROTOCOL_CHANNEL_AUTHENTICATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 DISALLOW_COPY_AND_ASSIGN(HostChannelAuthenticator); | 71 DISALLOW_COPY_AND_ASSIGN(HostChannelAuthenticator); |
72 }; | 72 }; |
73 | 73 |
74 class ClientChannelAuthenticator : public ChannelAuthenticator { | 74 class ClientChannelAuthenticator : public ChannelAuthenticator { |
75 public: | 75 public: |
76 ClientChannelAuthenticator(const std::string& shared_secret); | 76 ClientChannelAuthenticator(const std::string& shared_secret); |
77 virtual ~ClientChannelAuthenticator(); | 77 virtual ~ClientChannelAuthenticator(); |
78 | 78 |
79 // ChannelAuthenticator overrides. | 79 // ChannelAuthenticator overrides. |
80 virtual void Authenticate(net::SSLSocket* socket, | 80 virtual void Authenticate(net::SSLSocket* socket, |
81 const DoneCallback& done_callback); | 81 const DoneCallback& done_callback) OVERRIDE; |
82 | 82 |
83 private: | 83 private: |
84 void DoAuthWrite(); | 84 void DoAuthWrite(); |
85 void OnAuthBytesWritten(int result); | 85 void OnAuthBytesWritten(int result); |
86 bool HandleAuthBytesWritten(int result); | 86 bool HandleAuthBytesWritten(int result); |
87 | 87 |
88 std::string shared_secret_; | 88 std::string shared_secret_; |
89 net::SSLSocket* socket_; | 89 net::SSLSocket* socket_; |
90 DoneCallback done_callback_; | 90 DoneCallback done_callback_; |
91 | 91 |
92 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; | 92 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; |
93 | 93 |
94 net::OldCompletionCallbackImpl<ClientChannelAuthenticator> | 94 net::OldCompletionCallbackImpl<ClientChannelAuthenticator> |
95 auth_write_callback_; | 95 auth_write_callback_; |
96 | 96 |
97 DISALLOW_COPY_AND_ASSIGN(ClientChannelAuthenticator); | 97 DISALLOW_COPY_AND_ASSIGN(ClientChannelAuthenticator); |
98 }; | 98 }; |
99 | 99 |
100 } // namespace protocol | 100 } // namespace protocol |
101 } // namespace remoting | 101 } // namespace remoting |
102 | 102 |
103 #endif // REMOTING_PROTOCOL_CHANNEL_AUTHENTICATOR_H_ | 103 #endif // REMOTING_PROTOCOL_CHANNEL_AUTHENTICATOR_H_ |
OLD | NEW |