Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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. | |
| 4 | |
| 5 #ifndef REMOTING_HOST_GNUBBY_AUTH_HANDLER_H_ | |
| 6 #define REMOTING_HOST_GNUBBY_AUTH_HANDLER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/files/file_path.h" | |
|
Sergey Ulanov
2014/02/11 08:20:38
nit: FilePath can be forward-declared.
psj
2014/02/12 09:01:01
Done.
| |
| 12 #include "base/logging.h" | |
|
Sergey Ulanov
2014/02/11 08:20:38
This can be remove if you remove DCHECK below - se
psj
2014/02/12 09:01:01
Done.
| |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 | |
| 15 namespace remoting { | |
| 16 namespace protocol { | |
|
Sergey Ulanov
2014/02/11 08:20:38
nit: empty line above this one
psj
2014/02/12 09:01:01
Done.
| |
| 17 class ClientStub; | |
| 18 } // namespace protocol | |
| 19 | |
| 20 // Class responsible for proxying authentication data between a local gnubbyd | |
| 21 // and the client. | |
| 22 class GnubbyAuthHandler { | |
| 23 public: | |
| 24 virtual ~GnubbyAuthHandler() {} | |
| 25 | |
| 26 // Creates a platform-specific GnubbyAuthHandler. | |
| 27 static scoped_ptr<GnubbyAuthHandler> Create( | |
| 28 protocol::ClientStub* client_stub); | |
| 29 | |
| 30 // Specify the name of the socket to listen to gnubby requests on. | |
| 31 static void SetGnubbySocketName(const base::FilePath& gnubby_socket_name); | |
| 32 | |
| 33 // A message was received from the client. | |
| 34 virtual void DeliverClientMessage(const std::string& message) = 0; | |
| 35 | |
| 36 // Send data to client. | |
| 37 virtual void DeliverHostDataMessage(int connection_id, | |
| 38 const std::string& data) const = 0; | |
| 39 | |
| 40 protected: | |
| 41 explicit GnubbyAuthHandler(protocol::ClientStub* client_stub) | |
| 42 : client_stub_(client_stub) { | |
| 43 DCHECK(client_stub_); | |
| 44 } | |
| 45 | |
| 46 // Interface through which communication with the client occurs. | |
| 47 protocol::ClientStub* client_stub_; | |
|
Sergey Ulanov
2014/02/11 08:20:38
Please move this to GnubbyAuthHandlerPosix. Gnubby
psj
2014/02/12 09:01:01
Done.
| |
| 48 | |
| 49 private: | |
| 50 DISALLOW_COPY_AND_ASSIGN(GnubbyAuthHandler); | |
| 51 }; | |
| 52 | |
| 53 } // namespace remoting | |
| 54 | |
| 55 #endif // REMOTING_HOST_GNUBBY_AUTH_HANDLER_H_ | |
| OLD | NEW |