| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_FAKE_AUTHENTICATOR_H_ | 5 #ifndef REMOTING_PROTOCOL_FAKE_AUTHENTICATOR_H_ |
| 6 #define REMOTING_PROTOCOL_FAKE_AUTHENTICATOR_H_ | 6 #define REMOTING_PROTOCOL_FAKE_AUTHENTICATOR_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "remoting/protocol/authenticator.h" | 10 #include "remoting/protocol/authenticator.h" |
| 11 #include "remoting/protocol/channel_authenticator.h" | 11 #include "remoting/protocol/channel_authenticator.h" |
| 12 | 12 |
| 13 namespace remoting { | 13 namespace remoting { |
| 14 namespace protocol { | 14 namespace protocol { |
| 15 | 15 |
| 16 class FakeChannelAuthenticator : public ChannelAuthenticator { | 16 class FakeChannelAuthenticator : public ChannelAuthenticator { |
| 17 public: | 17 public: |
| 18 FakeChannelAuthenticator(bool accept, bool async); | 18 FakeChannelAuthenticator(bool accept, bool async); |
| 19 ~FakeChannelAuthenticator() override; | 19 ~FakeChannelAuthenticator() override; |
| 20 | 20 |
| 21 // ChannelAuthenticator interface. | 21 // ChannelAuthenticator interface. |
| 22 void SecureAndAuthenticate(scoped_ptr<net::StreamSocket> socket, | 22 void SecureAndAuthenticate(scoped_ptr<P2PStreamSocket> socket, |
| 23 const DoneCallback& done_callback) override; | 23 const DoneCallback& done_callback) override; |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 void OnAuthBytesWritten(int result); | 26 void OnAuthBytesWritten(int result); |
| 27 void OnAuthBytesRead(int result); | 27 void OnAuthBytesRead(int result); |
| 28 | 28 |
| 29 void CallDoneCallback(); | 29 void CallDoneCallback(); |
| 30 | 30 |
| 31 int result_; | 31 int result_; |
| 32 bool async_; | 32 bool async_; |
| 33 | 33 |
| 34 scoped_ptr<net::StreamSocket> socket_; | 34 scoped_ptr<P2PStreamSocket> socket_; |
| 35 DoneCallback done_callback_; | 35 DoneCallback done_callback_; |
| 36 | 36 |
| 37 bool did_read_bytes_; | 37 bool did_read_bytes_; |
| 38 bool did_write_bytes_; | 38 bool did_write_bytes_; |
| 39 | 39 |
| 40 base::WeakPtrFactory<FakeChannelAuthenticator> weak_factory_; | 40 base::WeakPtrFactory<FakeChannelAuthenticator> weak_factory_; |
| 41 | 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(FakeChannelAuthenticator); | 42 DISALLOW_COPY_AND_ASSIGN(FakeChannelAuthenticator); |
| 43 }; | 43 }; |
| 44 | 44 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 FakeAuthenticator::Action action_; | 106 FakeAuthenticator::Action action_; |
| 107 bool async_; | 107 bool async_; |
| 108 | 108 |
| 109 DISALLOW_COPY_AND_ASSIGN(FakeHostAuthenticatorFactory); | 109 DISALLOW_COPY_AND_ASSIGN(FakeHostAuthenticatorFactory); |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 } // namespace protocol | 112 } // namespace protocol |
| 113 } // namespace remoting | 113 } // namespace remoting |
| 114 | 114 |
| 115 #endif // REMOTING_PROTOCOL_FAKE_AUTHENTICATOR_H_ | 115 #endif // REMOTING_PROTOCOL_FAKE_AUTHENTICATOR_H_ |
| OLD | NEW |