Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: remoting/host/gnubby_connection.h

Issue 138753005: Add gnubby authentication to remoting host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actually add braces Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_CONNECTION_H_
6 #define REMOTING_HOST_GNUBBY_CONNECTION_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/single_thread_task_runner.h"
13 #include "base/threading/non_thread_safe.h"
14 #include "net/base/io_buffer.h"
15 #include "net/socket/stream_socket.h"
16
17 namespace base {
18 class SingleThreadTaskRunner;
19 } // namespace base
20
21 namespace remoting {
22 namespace protocol {
23 class ClientStub;
24 } // namespace protocol
25
26 class GnubbyAuthHandler;
27
28 // Class responsible for a single gnubbyd connection.
29
30 class GnubbyConnection : public base::NonThreadSafe {
31 public:
32 GnubbyConnection(
33 GnubbyAuthHandler* auth_handler,
34 int connection_id,
35 net::StreamSocket* socket);
36
37 virtual ~GnubbyConnection();
38
39 // Read data from a gnubbyd connection.
40 virtual void Read();
41
42 // Write data to a gnubbyd connection.
43 virtual void Write(const std::string& data);
44
45 private:
46 // Called when gnubbyd sends data.
47 void OnRead(int result);
48
49 // Called when data sent to gnubbyd.
50 void OnWrite(int result);
51
52 // A socket error occurred.
53 void Error(int result);
54
55 // The gnubby auth handler used to send messages to the webapp.
56 GnubbyAuthHandler* auth_handler_;
57
58 // The connection id.
59 int connection_id_;
60
61 // Socket that gnubbyd is connected to.
62 scoped_ptr<net::StreamSocket> socket_;
63
64 // Input I/O buffer for socket reads.
65 scoped_refptr<net::IOBufferWithSize> in_buffer_;
66
67 DISALLOW_COPY_AND_ASSIGN(GnubbyConnection);
68 };
69
70 } // namespace remoting
71
72 #endif // REMOTING_HOST_GNUBBY_CONNECTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698