OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_DEBUGGER_DEBUGGER_IO_SOCKET_H__ | 5 #ifndef CHROME_BROWSER_DEBUGGER_DEBUGGER_IO_SOCKET_H__ |
6 #define CHROME_BROWSER_DEBUGGER_DEBUGGER_IO_SOCKET_H__ | 6 #define CHROME_BROWSER_DEBUGGER_DEBUGGER_IO_SOCKET_H__ |
7 | 7 |
8 #include "chrome/browser/debugger/debugger_io.h" | 8 #include "chrome/browser/debugger/debugger_io.h" |
9 #include "net/base/telnet_server.h" | 9 #include "net/base/telnet_server.h" |
10 | 10 |
11 class DebuggerHost; | 11 class DebuggerHost; |
12 class MessageLoop; | 12 class MessageLoop; |
13 | 13 |
14 // Interaction with the underlying Socket object MUST happen in the IO thread. | 14 // Interaction with the underlying Socket object MUST happen in the IO thread. |
15 // However, Debugger will call into this object from the main thread. As a resu
lt | 15 // However, Debugger will call into this object from the main thread. As a |
16 // we wind up having helper methods that we call with InvokeLater into the IO | 16 // result we wind up having helper methods that we call with InvokeLater into |
17 // thread. | 17 // the IO thread. |
18 | 18 |
19 class DebuggerInputOutputSocket: public DebuggerInputOutput, | 19 class DebuggerInputOutputSocket: public DebuggerInputOutput, |
20 public ListenSocket::ListenSocketDelegate { | 20 public ListenSocket::ListenSocketDelegate { |
21 public: | 21 public: |
22 DebuggerInputOutputSocket(int port); | 22 DebuggerInputOutputSocket(int port); |
23 virtual ~DebuggerInputOutputSocket(); | 23 virtual ~DebuggerInputOutputSocket(); |
24 | 24 |
25 // SocketDelegate - called in IO thread by Socket | 25 // SocketDelegate - called in IO thread by Socket |
26 virtual void DidAccept(ListenSocket* server, ListenSocket* connection); | 26 virtual void DidAccept(ListenSocket* server, ListenSocket* connection); |
27 virtual void DidRead(ListenSocket* connection, const std::string& data); | 27 virtual void DidRead(ListenSocket* connection, const std::string& data); |
(...skipping 26 matching lines...) Expand all Loading... |
54 scoped_refptr<ListenSocket> server_; | 54 scoped_refptr<ListenSocket> server_; |
55 scoped_refptr<ListenSocket> connection_; | 55 scoped_refptr<ListenSocket> connection_; |
56 MessageLoop* ui_loop_; | 56 MessageLoop* ui_loop_; |
57 MessageLoop* io_loop_; | 57 MessageLoop* io_loop_; |
58 int port_; | 58 int port_; |
59 | 59 |
60 DISALLOW_EVIL_CONSTRUCTORS(DebuggerInputOutputSocket); | 60 DISALLOW_EVIL_CONSTRUCTORS(DebuggerInputOutputSocket); |
61 }; | 61 }; |
62 | 62 |
63 #endif // CHROME_BROWSER_DEBUGGER_DEBUGGER_IO_SOCKET_H__ | 63 #endif // CHROME_BROWSER_DEBUGGER_DEBUGGER_IO_SOCKET_H__ |
OLD | NEW |