| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_PROTOCOL_TETHERING_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TETHERING_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TETHERING_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TETHERING_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" | 9 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 using Response = DevToolsProtocolClient::Response; | 22 using Response = DevToolsProtocolClient::Response; |
| 23 using CreateServerSocketCallback = | 23 using CreateServerSocketCallback = |
| 24 base::Callback<scoped_ptr<net::ServerSocket>(std::string*)>; | 24 base::Callback<scoped_ptr<net::ServerSocket>(std::string*)>; |
| 25 | 25 |
| 26 TetheringHandler(const CreateServerSocketCallback& socket_callback, | 26 TetheringHandler(const CreateServerSocketCallback& socket_callback, |
| 27 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 27 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| 28 ~TetheringHandler(); | 28 ~TetheringHandler(); |
| 29 | 29 |
| 30 void SetClient(scoped_ptr<Client> client); | 30 void SetClient(scoped_ptr<Client> client); |
| 31 | 31 |
| 32 Response Bind(DevToolsCommandId command_id, int port); | 32 Response Bind(int session_id, DevToolsCommandId command_id, int port); |
| 33 Response Unbind(DevToolsCommandId command_id, int port); | 33 Response Unbind(int session_id, DevToolsCommandId command_id, int port); |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 class TetheringImpl; | 36 class TetheringImpl; |
| 37 | 37 |
| 38 void Accepted(uint16 port, const std::string& name); | 38 void Accepted(uint16 port, const std::string& name); |
| 39 bool Activate(); | 39 bool Activate(); |
| 40 | 40 |
| 41 void SendBindSuccess(DevToolsCommandId command_id); | 41 void SendBindSuccess(int session_id, DevToolsCommandId command_id); |
| 42 void SendUnbindSuccess(DevToolsCommandId command_id); | 42 void SendUnbindSuccess(int session_id, DevToolsCommandId command_id); |
| 43 void SendInternalError(DevToolsCommandId command_id, | 43 void SendInternalError(int session_id, |
| 44 DevToolsCommandId command_id, |
| 44 const std::string& message); | 45 const std::string& message); |
| 45 | 46 |
| 46 scoped_ptr<Client> client_; | 47 scoped_ptr<Client> client_; |
| 47 CreateServerSocketCallback socket_callback_; | 48 CreateServerSocketCallback socket_callback_; |
| 48 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 49 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 49 bool is_active_; | 50 bool is_active_; |
| 50 base::WeakPtrFactory<TetheringHandler> weak_factory_; | 51 base::WeakPtrFactory<TetheringHandler> weak_factory_; |
| 51 | 52 |
| 52 static TetheringImpl* impl_; | 53 static TetheringImpl* impl_; |
| 53 | 54 |
| 54 DISALLOW_COPY_AND_ASSIGN(TetheringHandler); | 55 DISALLOW_COPY_AND_ASSIGN(TetheringHandler); |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 } // namespace tethering | 58 } // namespace tethering |
| 58 } // namespace devtools | 59 } // namespace devtools |
| 59 } // namespace content | 60 } // namespace content |
| 60 | 61 |
| 61 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TETHERING_HANDLER_H_ | 62 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TETHERING_HANDLER_H_ |
| OLD | NEW |