Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_DEVTOOLS_REMOTE_H_ | 5 #ifndef CHROME_BROWSER_DEBUGGER_DEVTOOLS_REMOTE_H_ |
| 6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_REMOTE_H_ | 6 #define CHROME_BROWSER_DEBUGGER_DEVTOOLS_REMOTE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <netinet/in.h> | |
| 10 | |
| 9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 11 | 13 |
| 12 class DevToolsRemoteMessage; | 14 class DevToolsRemoteMessage; |
| 13 class ListenSocket; | 15 class ListenSocket; |
| 14 | 16 |
| 15 // This interface should be implemented by a class that wants to handle | 17 // This interface should be implemented by a class that wants to handle |
| 16 // DevToolsRemoteMessages dispatched by some entity. It must extend | 18 // DevToolsRemoteMessages dispatched by some entity. It must extend |
| 17 class DevToolsRemoteListener | 19 class DevToolsRemoteListener |
| 18 : public base::RefCountedThreadSafe<DevToolsRemoteListener> { | 20 : public base::RefCountedThreadSafe<DevToolsRemoteListener> { |
| 19 public: | 21 public: |
| 20 DevToolsRemoteListener() {} | 22 DevToolsRemoteListener() {} |
| 21 virtual void HandleMessage(const DevToolsRemoteMessage& message) = 0; | 23 virtual void HandleMessage(const DevToolsRemoteMessage& message) = 0; |
| 22 // This method is invoked on the UI thread whenever the debugger connection | 24 // This method is invoked on the UI thread whenever the debugger connection |
| 23 // has been lost. | 25 // has been lost. |
| 24 virtual void OnConnectionLost() = 0; | 26 virtual void OnConnectionLost() = 0; |
| 25 virtual void OnAcceptConnection(ListenSocket* connection) {} | 27 virtual void OnAcceptConnection(ListenSocket* connection) {} |
| 28 virtual int protocol() {return IPPROTO_TCP; } | |
|
Mike Belshe
2011/04/06 18:32:53
nit: in pure virtual interface classes, we try to
| |
| 26 | 29 |
| 27 protected: | 30 protected: |
| 28 friend class base::RefCountedThreadSafe<DevToolsRemoteListener>; | 31 friend class base::RefCountedThreadSafe<DevToolsRemoteListener>; |
| 29 | 32 |
| 30 virtual ~DevToolsRemoteListener() {} | 33 virtual ~DevToolsRemoteListener() {} |
| 31 | 34 |
| 32 private: | 35 private: |
| 33 DISALLOW_COPY_AND_ASSIGN(DevToolsRemoteListener); | 36 DISALLOW_COPY_AND_ASSIGN(DevToolsRemoteListener); |
| 34 }; | 37 }; |
| 35 | 38 |
| 36 // Interface exposed by DevToolsProtocolHandler to receive reply messages | 39 // Interface exposed by DevToolsProtocolHandler to receive reply messages |
| 37 // from registered tools. | 40 // from registered tools. |
| 38 class OutboundSocketDelegate { | 41 class OutboundSocketDelegate { |
| 39 public: | 42 public: |
| 40 virtual ~OutboundSocketDelegate() {} | 43 virtual ~OutboundSocketDelegate() {} |
| 41 virtual void Send(const DevToolsRemoteMessage& message) = 0; | 44 virtual void Send(const DevToolsRemoteMessage& message) = 0; |
| 42 }; | 45 }; |
| 43 | 46 |
| 44 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_REMOTE_H_ | 47 #endif // CHROME_BROWSER_DEBUGGER_DEVTOOLS_REMOTE_H_ |
| OLD | NEW |