OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_DEVTOOLS_TETHERING_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_TETHERING_HANDLER_H_ |
6 #define CONTENT_BROWSER_DEVTOOLS_TETHERING_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_TETHERING_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "content/browser/devtools/devtools_protocol.h" | 10 #include "content/browser/devtools/devtools_protocol.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 class DevToolsHttpHandlerDelegate; | 14 class DevToolsHttpHandlerDelegate; |
15 | 15 |
16 // This class implements reversed tethering handler. | 16 // This class implements reversed tethering handler. |
17 class TetheringHandler : public DevToolsProtocol::Handler { | 17 class TetheringHandler : public DevToolsProtocol::Handler { |
18 public: | 18 public: |
19 static const char kDomain[]; | |
20 | |
21 TetheringHandler(DevToolsHttpHandlerDelegate* delegate); | 19 TetheringHandler(DevToolsHttpHandlerDelegate* delegate); |
22 virtual ~TetheringHandler(); | 20 virtual ~TetheringHandler(); |
23 | 21 |
24 void Accepted(int port, const std::string& name); | 22 void Accepted(int port, const std::string& name); |
25 | 23 |
26 private: | 24 private: |
27 class BoundSocket; | 25 class BoundSocket; |
28 scoped_refptr<DevToolsProtocol::Response> OnBind( | 26 scoped_refptr<DevToolsProtocol::Response> OnBind( |
29 scoped_refptr<DevToolsProtocol::Command> command); | 27 scoped_refptr<DevToolsProtocol::Command> command); |
30 scoped_refptr<DevToolsProtocol::Response> OnUnbind( | 28 scoped_refptr<DevToolsProtocol::Response> OnUnbind( |
31 scoped_refptr<DevToolsProtocol::Command> command); | 29 scoped_refptr<DevToolsProtocol::Command> command); |
32 | 30 |
33 typedef std::map<int, BoundSocket*> BoundSockets; | 31 typedef std::map<int, BoundSocket*> BoundSockets; |
34 BoundSockets bound_sockets_; | 32 BoundSockets bound_sockets_; |
35 DevToolsHttpHandlerDelegate* delegate_; | 33 DevToolsHttpHandlerDelegate* delegate_; |
36 DISALLOW_COPY_AND_ASSIGN(TetheringHandler); | 34 DISALLOW_COPY_AND_ASSIGN(TetheringHandler); |
37 }; | 35 }; |
38 | 36 |
39 } // namespace content | 37 } // namespace content |
40 | 38 |
41 #endif // CONTENT_BROWSER_DEVTOOLS_TETHERING_HANDLER_H_ | 39 #endif // CONTENT_BROWSER_DEVTOOLS_TETHERING_HANDLER_H_ |
OLD | NEW |