| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_HOST_SECURITY_KEY_GNUBBY_AUTH_HANDLER_H_ | 5 #ifndef REMOTING_HOST_SECURITY_KEY_GNUBBY_AUTH_HANDLER_H_ |
| 6 #define REMOTING_HOST_SECURITY_KEY_GNUBBY_AUTH_HANDLER_H_ | 6 #define REMOTING_HOST_SECURITY_KEY_GNUBBY_AUTH_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 | 12 |
| 13 namespace base { | 13 namespace base { |
| 14 class FilePath; | 14 class FilePath; |
| 15 class TimeDelta; |
| 15 } // namespace base | 16 } // namespace base |
| 16 | 17 |
| 17 namespace remoting { | 18 namespace remoting { |
| 18 | 19 |
| 19 // Class responsible for proxying authentication data between a local gnubbyd | 20 // Class responsible for proxying authentication data between a local gnubbyd |
| 20 // and the client. | 21 // and the client. |
| 21 class GnubbyAuthHandler { | 22 class GnubbyAuthHandler { |
| 22 public: | 23 public: |
| 23 virtual ~GnubbyAuthHandler() {} | 24 virtual ~GnubbyAuthHandler() {} |
| 24 | 25 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 46 | 47 |
| 47 // Returns true if |gnubby_connection_id| represents a valid connection. | 48 // Returns true if |gnubby_connection_id| represents a valid connection. |
| 48 virtual bool IsValidConnectionId(int gnubby_connection_id) const = 0; | 49 virtual bool IsValidConnectionId(int gnubby_connection_id) const = 0; |
| 49 | 50 |
| 50 // Sends the gnubby response from the client to the local gnubby agent. | 51 // Sends the gnubby response from the client to the local gnubby agent. |
| 51 virtual void SendClientResponse(int gnubby_connection_id, | 52 virtual void SendClientResponse(int gnubby_connection_id, |
| 52 const std::string& response) = 0; | 53 const std::string& response) = 0; |
| 53 | 54 |
| 54 // Closes the gnubby connection represented by |gnubby_connection_id|. | 55 // Closes the gnubby connection represented by |gnubby_connection_id|. |
| 55 virtual void SendErrorAndCloseConnection(int gnubby_connection_id) = 0; | 56 virtual void SendErrorAndCloseConnection(int gnubby_connection_id) = 0; |
| 57 |
| 58 // Returns the number of active gnubby connections. |
| 59 virtual size_t GetActiveConnectionCountForTest() const = 0; |
| 60 |
| 61 // Sets the timeout used when waiting for a gnubby response. |
| 62 virtual void SetRequestTimeoutForTest(const base::TimeDelta& timeout) = 0; |
| 56 }; | 63 }; |
| 57 | 64 |
| 58 } // namespace remoting | 65 } // namespace remoting |
| 59 | 66 |
| 60 #endif // REMOTING_HOST_SECURITY_KEY_GNUBBY_AUTH_HANDLER_H_ | 67 #endif // REMOTING_HOST_SECURITY_KEY_GNUBBY_AUTH_HANDLER_H_ |
| OLD | NEW |